From b366c31385d6bb8a9299576add84006e536517e4 Mon Sep 17 00:00:00 2001 From: I-Have-An-Issue <34550332+I-Have-An-Issue@users.noreply.github.com> Date: Mon, 20 Feb 2023 04:52:01 -0500 Subject: [PATCH] Update LUA --- example.env | 4 ++-- src/lua/gameserver.lua | 11 ++++------- src/lua/place.lua | 4 ++-- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/example.env b/example.env index 62cd812..c64eccd 100644 --- a/example.env +++ b/example.env @@ -12,5 +12,5 @@ RENDER_USER_HEIGHT=420 RENDER_ASSET_WIDTH=420 RENDER_ASSET_HEIGHT=420 -RENDER_PLACE_WIDTH=854 -RENDER_PLACE_HEIGHT=480 +RENDER_PLACE_WIDTH=768 +RENDER_PLACE_HEIGHT=432 diff --git a/src/lua/gameserver.lua b/src/lua/gameserver.lua index 51e98a3..ebb9698 100644 --- a/src/lua/gameserver.lua +++ b/src/lua/gameserver.lua @@ -41,7 +41,6 @@ if baseUrl ~= nil then pcall(function() game:GetService("Players"):SetAbuseReportUrl(baseUrl .. "/AbuseReport/InGameChatHandler.ashx") end) pcall(function() game:GetService("ScriptInformationProvider"):SetAssetUrl(baseUrl .. "/Asset/") end) pcall(function() game:GetService("ContentProvider"):SetBaseUrl(baseUrl .. "/") end) --- pcall(function() game:GetService("Players"):SetChatFilterUrl(baseUrl .. "/Game/ChatFilter.ashx") end) game:GetService("BadgeService"):SetPlaceId(placeId) @@ -59,8 +58,8 @@ if baseUrl ~= nil then end pcall(function() game:GetService("NetworkServer"):SetIsPlayerAuthenticationRequired(true) end) -settings().Diagnostics.LuaRamLimit = 0 +settings().Diagnostics.LuaRamLimit = 0 game:GetService("Players").PlayerAdded:connect(function(player) print("Player " .. player.userId .. " added") @@ -79,10 +78,8 @@ end ns:Start(port) -local success, error = spawn(function() +spawn(function() while wait(5) do - -- UGLY HACK BECAUSE FOR SOME REASON HTTPPOST AND POSTASYNC CRASHES?? - -- WHAT THE FUCK? local playerIds = "" local players = game.Players:GetChildren() for i, player in pairs(players) do @@ -95,12 +92,12 @@ local success, error = spawn(function() end end - game:HttpGet('http://kapish.fun/server/ping/' .. placeId .. '?players=' .. playerIds .. "&key=" .. key) + pcall(function() game:HttpGet('http://kapish.fun/server/ping/' .. placeId .. '?players=' .. playerIds .. "&key=" .. key) end) end end) spawn(function() - while wait(10) do + while wait(60) do if #game.Players:GetPlayers() == 0 then pcall(function() game:HttpGet("https://kapish.fun/dielol/" .. placeId.."?key=" .. key) end) end diff --git a/src/lua/place.lua b/src/lua/place.lua index 5dee862..17b042b 100644 --- a/src/lua/place.lua +++ b/src/lua/place.lua @@ -1,4 +1,4 @@ -local jobId, type, format, x, y, baseUrl, assetId = ... +local jobId, type, format, x, y, baseUrl, assetId, key = ... print(("[%s] Started RenderJob for type '%s' with assetId %d ..."):format(jobId, type, assetId)) @@ -11,7 +11,7 @@ game:GetService("ContentProvider"):SetBaseUrl(baseUrl) game:GetService("ScriptContext").ScriptsDisabled = true game:GetService("StarterGui").ShowDevelopmentGui = false -game:Load(("%s/asset/?id=%d"):format(baseUrl, assetId)) +game:Load(("%s//asset/?id=%d&placelol=true&key=%s"):format(baseUrl, assetId, key)) game:GetService("ScriptContext").ScriptsDisabled = true game:GetService("StarterGui").ShowDevelopmentGui = false