Fix gameservers for real this time

This commit is contained in:
I-Have-An-Issue 2023-02-21 17:49:42 -05:00
parent bce1dfcf90
commit e92ac41318
No known key found for this signature in database
GPG Key ID: E55435DEA0825091
2 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,7 @@ class GameJob extends Job {
{ type: "LUA_TNUMBER", value: id },
{ type: "LUA_TNUMBER", value: port },
{ type: "LUA_TSTRING", value: process.env.ARBITER_TOKEN },
],
},
}).catch((e) => reject(e))

View File

@ -16,6 +16,7 @@ function getGameById(id) {
app.get("/:id", async (request, response) => {
const game = global.games.get(getGameById(request.params.id)?.id)
if (game) return response.status(400).json({ error: "Game is running" })
const job = new GameJob()
const result = await job.StartGame(request.params.id, request.query.port).catch((_) => _)