diff --git a/README.md b/README.md
index 1c2aeea..99ac80a 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,7 @@ A Bootstrap based ROBLOX revival website.
- [x] Make Create assets/game page
- [x] Make Catalog page (functional)
- [x] Make Credits page
-- [ ] Make Placelauncher.ashx require a token for joining then proceed to start a game on a gameserver with soap
+- [x] Make Placelauncher.ashx require a token for joining then proceed to start a game on a gameserver with soap
- [ ] Make renders with a soap request to rcc
- [x] Make Admin panel and make it only accessible to admin users (show stuff like how many games are running cpu usage on the webserver how many users are online that kind of stuff)
- [ ] \(Optional) Add Recaptcha (https://developers.google.com/recaptcha/old/docs/php, ask mario to make a public key if u want to do this feature) (I dont see the point -qzip)
diff --git a/core/config.php b/core/config.php
index 6f90f77..1786896 100644
--- a/core/config.php
+++ b/core/config.php
@@ -40,11 +40,18 @@ MIICXQIBAAKBgQDhO7uhMz3jBLoSB/SHWhnE5tVxn7P6BlirPVrZEWVUxjyC5ybhZpyjL/r6KBlvhgyn
$soapIp = $AvailableGameservers[array_rand($AvailableGameservers,1)];
$soapcfg = [
- "ip" => $soapIp,
+ "ip" => $AvailableGameservers[1],
"port" => 64989,
- "url" => "sierraf.tk"
+ "url" => "sierraf.tk",
+ "usehttps" => 'false'
];
+if ($soapcfg["usehttps"] == 'true') {
+ $soapcfg["usehttps"] = 'https://';
+} else if ($soapcfg["usehttps"] == 'false') {
+ $soapcfg["usehttps"] = 'http://';
+}
+
$site = [
"url" => "https://".$_SERVER["HTTP_HOST"]
];
diff --git a/game/Join.php b/game/Join.php
index 807060d..0bf4a51 100644
--- a/game/Join.php
+++ b/game/Join.php
@@ -78,7 +78,7 @@ if ($anothermomentoftruth == 1 && $anotheranothermomentoftruth == 1) {
"SuperSafeChat" => false,
"CharacterAppearance" => "",
"ClientTicket" => $authticket,
- "GameId" => $placeid,
+ "GameId" => $jobid,
"PlaceId" => $placeid,
"MeasurementUrl" => "",
"WaitingForCharacterGuid" => "26eb3e21-aa80-475b-a777-b43c3ea5f7d2",
diff --git a/game/PlaceLauncher.php b/game/PlaceLauncher.php
index b924168..b8f5c90 100644
--- a/game/PlaceLauncher.php
+++ b/game/PlaceLauncher.php
@@ -43,23 +43,31 @@ if ($momentoftruth == 1) {
$checkifjobalreadyexists->execute();
$okcheck = $checkifjobalreadyexists->fetchColumn();
if ($okcheck == 1) {
- $getjobforalready = $con->prepare('SELECT jobid FROM jobs WHERE placeid=:placeid');
+ $passedplacelauncher = '1';
+ $hahatroll = $con->prepare('UPDATE tokens SET passedplacelauncher = :passedplacelauncher WHERE token=:token');
+ $hahatroll->bindParam(':passedplacelauncher', $passedplacelauncher);
+ $hahatroll->bindParam(':token', $token);
+ $hahatroll->execute();
+ $getjobforalready = $con->prepare('SELECT jobid FROM jobs WHERE placeid=:placeid AND isonline=:isonline');
$getjobforalready->bindParam(':placeid', $placeid);
+ $getjobforalready->bindParam(':isonline', $helppdo);
$getjobforalready->execute();
$china2 = $getjobforalready->fetch(PDO::FETCH_BOTH);
$jobid = $china2['jobid'];
$response = [
"jobId" => $jobid,
"status" => $status,
- "joinScriptUrl" => "http://". $soapcfg['url'] ."/game/join?token=". $token ."&jobid=". $jobid,
- "authenticationUrl" => "http://". $soapcfg['url'] ."/Login/Negotiate.ashx",
+ "joinScriptUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/game/join?token=". $token ."&jobid=". $jobid,
+ "authenticationUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/Login/Negotiate.ashx",
"authenticationTicket" => $token,
"message" => $allstatus[$status]
];
echo json_encode($response);
} else if ($okcheck == 0) {
- $hahatroll = $con->prepare('UPDATE tokens SET passedplacelauncher = 0 WHERE token=:token');
- $hahatroll->bindParam(':token', $token);
+ $passedplacelauncher = '1';
+ $hahatroll = $con->prepare('UPDATE tokens SET passedplacelauncher = :passedplacelauncher WHERE token=:token');
+ $hahatroll->bindParam(':passedplacelauncher', $passedplacelauncher);
+ $hahatroll->bindParam(':token', $token);
$hahatroll->execute();
function generateRandomJobId() {
$chars = '0123456789abcdefghijklmnopqrstuvwxyz';
@@ -78,12 +86,13 @@ if ($momentoftruth == 1) {
$jobid = generateRandomJobId();
$port = rand(5000,5999);
$checkport = $con->prepare('SELECT COUNT(*) FROM tokens WHERE token=:token AND passedplacelauncher=:passed');
- $chechport->bindParam(':token', $token);
+ $checkport->bindParam(':token', $token);
$checkport->bindParam(':passed', $okbruh);
$checkport->execute();
$okbrahh = $checkport->fetchColumn();
if ($okbrahh == 1) {
$port = rand(5000,5999); // great heavens if this ever happens report to me
+ die("How did we get here?");
} else if ($okbrahh == 0) {
$RCCServiceSoap = new Roblox\Grid\Rcc\RCCServiceSoap("127.0.0.1", 64989);
$script = '
@@ -205,8 +214,8 @@ game:GetService("RunService"):Run()
$response = [
"jobId" => $jobid,
"status" => $status,
- "joinScriptUrl" => "http://". $soapcfg['url'] ."/game/join?token=". $token ."&jobid=". $jobid,
- "authenticationUrl" => "http://". $soapcfg['url'] ."/Login/Negotiate.ashx",
+ "joinScriptUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/game/join?token=". $token ."&jobid=". $jobid,
+ "authenticationUrl" => $soapcfg["usehttps"] . $soapcfg['url'] ."/Login/Negotiate.ashx",
"authenticationTicket" => $token,
"message" => $allstatus[$status]
];
diff --git a/place.php b/place.php
index c23bd15..4ca4c32 100644
--- a/place.php
+++ b/place.php
@@ -122,7 +122,7 @@ function play() {
data:{"placeid":action},
success: function(response){
var token = response;
- window.location = "grublox-player://1+launchmode:play+gameinfo:" + token + "+placelauncherurl:http://sierraf.tk/game/PlaceLauncher.ashx";
+ window.location = "grublox-player://1+launchmode:play+gameinfo:" + token + "+placelauncherurl:http://sierraf.tk/game/PlaceLauncher.ashx?token=" + token;
}
});
}