Initial commit

This commit is contained in:
2026-08-24 22:20:36 +02:00
commit 62f7b1278a
251 changed files with 16670 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
const Game = require("../../../Game/Game");
const isAuthenticated = require("../../../Utility/isAuthenticated");
module.exports = async (res, req) => {
res.onAborted(() => res.isAborted = true);
const state = req.getQuery("state");
const hasPermission = await isAuthenticated(res, req);
if (!hasPermission) return;
if (!state) return res.cork(() => res.writeStatus("400").end("Missing new game state!"));
Game.state = parseInt(state);
res.cork(() => res
.writeStatus("200")
.end(`New game state is set to be ${state}`));
};