From 46b05a211fcdd22bb62efc7e2d668a9e05c6c626 Mon Sep 17 00:00:00 2001 From: I-Have-An-Issue <34550332+I-Have-An-Issue@users.noreply.github.com> Date: Tue, 21 Feb 2023 18:21:20 -0500 Subject: [PATCH] Fix bug where games wouldnt be named by their placeid --- src/lua/gameserver.lua | 2 ++ src/routes/game/start.js | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lua/gameserver.lua b/src/lua/gameserver.lua index ebb9698..e24202b 100644 --- a/src/lua/gameserver.lua +++ b/src/lua/gameserver.lua @@ -100,6 +100,8 @@ spawn(function() while wait(60) do if #game.Players:GetPlayers() == 0 then pcall(function() game:HttpGet("https://kapish.fun/dielol/" .. placeId.."?key=" .. key) end) + else + pcall(function() game:HttpGet("https://kapish.fun/renewlol/" .. placeId.."?key=" .. key) end) end end end) diff --git a/src/routes/game/start.js b/src/routes/game/start.js index be351ba..9467afc 100644 --- a/src/routes/game/start.js +++ b/src/routes/game/start.js @@ -10,9 +10,9 @@ app.get("/:id", async (request, response) => { const job = new GameJob() const result = await job.StartGame(request.params.id, request.query.port).catch((_) => _) - global.games.set(job.id, job) + global.games.set(request.params.id, job) job.proc.once("exit", () => { - global.games.delete(job.id) + global.games.delete(request.params.id) }) return response.json({ success: true })