Fuck it, I guess let anyone use the secret query args
This commit is contained in:
parent
070d276e8a
commit
a76a44e1b8
10
js/main.js
10
js/main.js
@ -1053,13 +1053,7 @@ class Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
let query;
|
let query = new URLSearchParams(location.search);
|
||||||
if (location.host.match(/localhost/)) {
|
|
||||||
query = new URLSearchParams(location.search);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
query = new URLSearchParams;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pick a tileset
|
// Pick a tileset
|
||||||
// These alternative ones only exist locally for me at the moment, since
|
// These alternative ones only exist locally for me at the moment, since
|
||||||
@ -1093,8 +1087,8 @@ async function main() {
|
|||||||
// Pick a level (set)
|
// Pick a level (set)
|
||||||
// TODO error handling :(
|
// TODO error handling :(
|
||||||
let stored_game;
|
let stored_game;
|
||||||
if (query.get('setpath')) {
|
|
||||||
let path = query.get('setpath');
|
let path = query.get('setpath');
|
||||||
|
if (path && path.match(/^levels[/]/)) {
|
||||||
let data = await fetch(path);
|
let data = await fetch(path);
|
||||||
if (path.match(/\.(?:dat|ccl)$/i)) {
|
if (path.match(/\.(?:dat|ccl)$/i)) {
|
||||||
stored_game = dat.parse_game(data);
|
stored_game = dat.parse_game(data);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user