From 139625f6ee29f3c15591edb1febf71bfeb682016 Mon Sep 17 00:00:00 2001 From: Mario <100047175+Mariopizza1@users.noreply.github.com> Date: Thu, 2 Mar 2023 10:41:49 +0200 Subject: [PATCH] Update PlaceLauncher.php --- game/PlaceLauncher.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/game/PlaceLauncher.php b/game/PlaceLauncher.php index e7870cf..ed2d8b0 100644 --- a/game/PlaceLauncher.php +++ b/game/PlaceLauncher.php @@ -105,11 +105,12 @@ function generateRandomString($length = 25) { } else if ($okbrahh == 0) { $accesstoken = generateRandomString(500); echo $accesstoken; - $okaccesstoken = $con->prepare('INSERT INTO accesstokens (ip, accesstoken, placeid) VALUES (:ip, :accesstoken, :placeid)'); + $okaccesstoken = $con->prepare('INSERT INTO accesstokens (ip, accesstoken, placeid, jobid) VALUES (:ip, :accesstoken, :placeid, :jobid)'); $okaccesstoken->bindParam(':ip', $AvailableGameservers[1]); $okaccesstoken->bindParam(':accesstoken', $accesstoken); $okaccesstoken->bindParam(':placeid', $placeid); - $okaccesstoken->execute(); + $okaccesstoken->bindParam(':jobid', $jobid); + $okaccesstoken->execute(); $RCCServiceSoap = new Roblox\Grid\Rcc\RCCServiceSoap("192.168.1.129", 64989); $https = "https://"; $script = 'print("Starting a new gameserver with JobID: " .. "' . $jobid . '" .. " and PlaceID: " .. "' . $placeid . '") @@ -177,7 +178,7 @@ function generateRandomString($length = 25) { --settings().Network.PhysicsSend = 0 -- 1==RoundRobin game:GetService("Players").PlayerAdded:connect(function(player) if game.Players.NumPlayers ~= 0 then - print(game:HttpGet(url .. "/api/UpdatePlayerCount?accesstoken=" .. accesstoken .. "&playercount=" .. game.Players.NumPlayers)) + print(loadfile(url .. "/api/UpdatePlayerCount?accesstoken=" .. accesstoken .. "&playercount=" .. game.Players.NumPlayers)) print("Successfully Updated Player count for JobID: " . "' . $jobid . '") else print(loadfile(url .. "/api/CloseJob?accesstoken=" .. accesstoken)) @@ -215,7 +216,7 @@ function generateRandomString($length = 25) { $result = $RCCServiceSoap->OpenJob($job, $funny); $sendthatjob = $con->prepare('INSERT INTO jobs (jobid, placeid, port, ip) VALUES (:jobid, :placeid, :port, :ip)'); $sendthatjob->bindParam(':jobid', $jobid); - $sendthatjob->bindParam(':placeid', $placeid); // another temporary thing since we don't have random token generator thing and token table + $sendthatjob->bindParam(':placeid', $placeid); $sendthatjob->bindParam(':port', $port); $sendthatjob->bindParam(':ip', $AvailableGameservers[1]); $sendthatjob->execute();