Fix bug where games wouldnt be named by their placeid

This commit is contained in:
I-Have-An-Issue 2023-02-21 18:21:20 -05:00
parent 115a44d76f
commit 46b05a211f
No known key found for this signature in database
GPG Key ID: E55435DEA0825091
2 changed files with 4 additions and 2 deletions

View File

@ -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)

View File

@ -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 })