From d835487616f00bb04e8ca73201c9d23f1b0a9f03 Mon Sep 17 00:00:00 2001 From: I-Have-An-Issue <34550332+I-Have-An-Issue@users.noreply.github.com> Date: Sun, 12 Feb 2023 23:42:17 -0500 Subject: [PATCH] abc --- src/lua/gameserver.lua | 12 +++++------- src/routes/game/execute.js | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/lua/gameserver.lua b/src/lua/gameserver.lua index 236826c..ce3ea7c 100644 --- a/src/lua/gameserver.lua +++ b/src/lua/gameserver.lua @@ -41,14 +41,13 @@ function keepAlive(LeavingPlayer) ["PlayerList"] = update(LeavingPlayer), }) - game:GetService("HttpService"):PostAsync("https://dungblx.cf/API/KeepAlive", body) + return game:GetService("HttpService"):PostAsync("https://dungblx.cf/API/KeepAlive", body) end) if not success then - local message = Instance.new("Message") - message.Text = "Ping Error: " .. result - message.Parent = workspace - game:GetService("Debris"):AddItem(message, 5) + local Hint = Instance.new("Hint") + Hint.Text = result + Hint.Parent = workspace end end @@ -128,8 +127,7 @@ end ------------------------------ RENEW GAME JOB SERVICE ------------------------------- spawn(function() - while true do - wait(30) + while wait(30) do if #game.Players:GetPlayers() == 0 then pcall(function() game:HttpGet(baseUrl .. "/arbiter/" .. jobId .. "/kill") end) else diff --git a/src/routes/game/execute.js b/src/routes/game/execute.js index 09bcacc..d740057 100644 --- a/src/routes/game/execute.js +++ b/src/routes/game/execute.js @@ -11,7 +11,7 @@ app.post("/:token", async (request, response) => { if (!game) return response.status(404).json({ error: "Game is not running" }) const { script } = request.body - const jobResponse = await game.Execute(randomUUID(), script) + const jobResponse = await game.Execute(randomUUID(), script).catch((_) => _) return response.json({ response: jobResponse }) })