From e9943c083ea8ed456df732767ec2911eab2e9463 Mon Sep 17 00:00:00 2001 From: Mario <100047175+Mariopizza1@users.noreply.github.com> Date: Thu, 2 Mar 2023 21:38:35 +0200 Subject: [PATCH] Update PlaceLauncher.php --- game/PlaceLauncher.php | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/game/PlaceLauncher.php b/game/PlaceLauncher.php index ed2d8b0..8d7ea7f 100644 --- a/game/PlaceLauncher.php +++ b/game/PlaceLauncher.php @@ -1,11 +1,6 @@ "0 or 1 is not an error - it is a sign that we should wait", @@ -36,10 +31,10 @@ if ($momentoftruth == 1) { if ($moretrolling == 1) { header("Location: /"); } else if ($moretrolling == 0) { - $checkifjobalreadyexists = $con->prepare('SELECT COUNT(*) FROM jobs WHERE placeid=:placeid AND isonline=:isonline'); + $checkifjobalreadyexists = $con->prepare('SELECT COUNT(*) FROM jobs WHERE placeid=:placeid AND hasended=:hasended'); $checkifjobalreadyexists->bindParam(':placeid', $placeid); - $helppdo = '1'; - $checkifjobalreadyexists->bindParam(':isonline', $helppdo); + $helppdo = '0'; + $checkifjobalreadyexists->bindParam(':hasended', $helppdo); $checkifjobalreadyexists->execute(); $okcheck = $checkifjobalreadyexists->fetchColumn(); if ($okcheck == 1) { @@ -48,23 +43,23 @@ if ($momentoftruth == 1) { $hahatroll->bindParam(':passedplacelauncher', $passedplacelauncher); $hahatroll->bindParam(':token', $token); $hahatroll->execute(); - $getjobforalready = $con->prepare('SELECT jobid FROM jobs WHERE placeid=:placeid AND isonline=:isonline'); + $getjobforalready = $con->prepare('SELECT jobid FROM jobs WHERE placeid=:placeid AND hasended=:hasended'); $getjobforalready->bindParam(':placeid', $placeid); - $getjobforalready->bindParam(':isonline', $helppdo); + $getjobforalready->bindParam(':hasended', $helppdo); $getjobforalready->execute(); $china2 = $getjobforalready->fetch(PDO::FETCH_BOTH); $jobid = $china2['jobid']; $response = [ "jobId" => $jobid, "status" => $status, - "joinScriptUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/game/join?token=". $token ."&jobid=". $jobid, - "authenticationUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/Login/Negotiate.ashx", + "joinScriptUrl" => $site['url'] ."/game/join?token=". $token ."&jobid=". $jobid, + "authenticationUrl" => $site['url'] ."/Login/Negotiate.ashx", "authenticationTicket" => $token, "message" => $allstatus[$status] ]; echo json_encode($response); } else if ($okcheck == 0) { - $passedplacelauncher = '0'; // IF THIS IS 0 THEN IT MEANS PLACELAUNCHER HASN'T PASSED MAKE SURE THIS IS ONLY IN UR TESTING + $passedplacelauncher = '1'; // IF THIS IS 0 THEN IT MEANS PLACELAUNCHER HASN'T PASSED MAKE SURE THIS IS ONLY IN UR TESTING $hahatroll = $con->prepare('UPDATE tokens SET passedplacelauncher = :passedplacelauncher WHERE token=:token'); $hahatroll->bindParam(':passedplacelauncher', $passedplacelauncher); $hahatroll->bindParam(':token', $token); @@ -104,7 +99,6 @@ function generateRandomString($length = 25) { die("How did we get here?"); } else if ($okbrahh == 0) { $accesstoken = generateRandomString(500); - echo $accesstoken; $okaccesstoken = $con->prepare('INSERT INTO accesstokens (ip, accesstoken, placeid, jobid) VALUES (:ip, :accesstoken, :placeid, :jobid)'); $okaccesstoken->bindParam(':ip', $AvailableGameservers[1]); $okaccesstoken->bindParam(':accesstoken', $accesstoken); @@ -116,7 +110,7 @@ function generateRandomString($length = 25) { $script = 'print("Starting a new gameserver with JobID: " .. "' . $jobid . '" .. " and PlaceID: " .. "' . $placeid . '") local placeId = ' . (int)$placeid . ' - local url = "'. $https . $soapcfg['url'] . '" + local url = "'. $site['url'] . '" local accesstoken = "' . $accesstoken . '" ------------------- UTILITY FUNCTIONS -------------------------- @@ -214,6 +208,7 @@ function generateRandomString($length = 25) { $job = new Roblox\Grid\Rcc\Job($jobid, 99999999999); // pls only set to this amount WHEN ur hosting a gameserver when ur rendering do like 10 minutes $funny = new Roblox\Grid\Rcc\ScriptExecution("Script".rand(1,getrandmax()), $script); $result = $RCCServiceSoap->OpenJob($job, $funny); + jobOpened($jobid, 99999999999); $sendthatjob = $con->prepare('INSERT INTO jobs (jobid, placeid, port, ip) VALUES (:jobid, :placeid, :port, :ip)'); $sendthatjob->bindParam(':jobid', $jobid); $sendthatjob->bindParam(':placeid', $placeid); @@ -223,8 +218,8 @@ function generateRandomString($length = 25) { $response = [ "jobId" => $jobid, "status" => $status, - "joinScriptUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/game/join?token=". $token ."&jobid=". $jobid, - "authenticationUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/Login/Negotiate.ashx", + "joinScriptUrl" => $site['url'] ."/game/join?token=". $token ."&jobid=". $jobid, + "authenticationUrl" => $site['url'] ."/Login/Negotiate.ashx", "authenticationTicket" => $token, "message" => $allstatus[$status] ];