prepare('SELECT * FROM jobs WHERE placeId = :placeId'); $FindJob->execute(['placeId' => $placeId]); $FindGames = $pdo->prepare('SELECT * FROM assets WHERE AssetID = :placeId AND AssetType = 9'); $FindGames->execute(['placeId' => $placeId]); $gamerow = $FindGames->fetch(PDO::FETCH_ASSOC); $job = $FindJob->fetch(PDO::FETCH_ASSOC); function getRealIP() { if (!empty($_SERVER['HTTP_CF_CONNECTING_IP'])) { return $_SERVER['HTTP_CF_CONNECTING_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) { return trim(explode(',', $_SERVER['HTTP_X_FORWARDED_FOR'])[0]); } else { return $_SERVER['REMOTE_ADDR']; } } if (!$gamerow || !$job) { // print_r($pdo->errorInfo()); exit("no jubs"); } if (isset($_COOKIE["_ROBLOSECURITY"])) { $userinfo = getuserinfo($_COOKIE["_ROBLOSECURITY"]); } elseif (isset($_GET["UseTicket"]) && !isset($_COOKIE["_ROBLOSECURITY"])) { $clientIP = getRealIP(); $FindGuessedUser = $pdo->prepare('SELECT * FROM auth_sessions WHERE ip_address = :ip ORDER BY sessionID DESC LIMIT 1;'); $FindGuessedUser->execute(['ip' => $clientIP]); $row = $FindGuessedUser->fetch(PDO::FETCH_ASSOC); if ($row) { $userinfo = getuserinfo($row["ROBLOSECURITY"]); if (!is_array($userinfo)) { exit("no userinfo"); } } } $membership = "None"; if (isset($userinfo)) { if ($userinfo["activated"] === 0) { exit; } if ($userinfo["Membership"] == 1) { $membership = "BuildersClub"; } elseif ($userinfo["Membership"] == 2) { $membership = "TurboBuildersClub"; } elseif ($userinfo["Membership"] == 3) { $membership = "OutrageousBuildersClub"; } $charurl = "http://www.aftwld.com/asset/CharacterFetch.ashx?UserID=" . $userinfo["UserId"]; } else { //exit(); $charurl = "http://www.aftwld.com/asset/CharacterFetch.ashx?UserID=607"; } // Construct joinscript $uID = $userinfo["UserId"] ?? rand(-9999, -1); $uName = $userinfo['Username'] ?? "Guest " . rand(1, 9999); $joinscript = [ "ClientPort" => 0, "MachineAddress" => "176.100.36.174", "ServerPort" => $job['port'], "PingUrl" => "", "PingInterval" => 20, "UserName" => $uName, "SeleniumTestMode" => false, "UserId" => $uID, "SuperSafeChat" => false, "ClientTicket" => gameUtils::GenerateClientTicketv1($uID, $uName, $charurl, $job['jobid']), "GameId" => $job['jobid'], "PlaceId" => $placeId, "MeasurementUrl" => "", // No telemetry here :) "WaitingForCharacterGuid" => "26eb3e21-aa80-475b-a777-b43c3ea5f7d2", "BaseUrl" => "http://www.aftwld.com/", "ChatStyle" => "ClassicAndBubble", "VendorId" => "0", "ScreenShotInfo" => "", "VideoInfo" => "", "CreatorId" => $gamerow['CreatorID'], "CreatorTypeEnum" => "User", "MembershipType" => $membership, "AccountAge" => "3000000", "CookieStoreFirstTimePlayKey" => "rbx_evt_ftp", "CookieStoreFiveMinutePlayKey" => "rbx_evt_fmp", "CookieStoreEnabled" => true, "IsRobloxPlace" => true, "GenerateTeleportJoin" => false, "IsUnknownOrUnder13" => false, "SessionId" => "", "DataCenterId" => 0, "UniverseId" => $placeId, "BrowserTrackerId" => 0, "UsePortraitMode" => false, "FollowUserId" => 0, "CharacterAppearance" => $charurl, ]; $data = json_encode($joinscript, JSON_UNESCAPED_SLASHES | JSON_NUMERIC_CHECK); $pdo->prepare("UPDATE assets SET Visits = IFNULL(Visits, 0) + 1 WHERE AssetID = :id")->execute(["id" => $placeId]); $pdo->prepare("UPDATE users SET Tix = Tix + 1 WHERE UserId = :id")->execute(["id" => $gamerow["CreatorID"]]); exit(gameUtils::signv1($data));