diff --git a/globals/Dependencies/Assets/Render.php b/globals/Dependencies/Assets/Render.php index 7053ccb..a287e97 100644 --- a/globals/Dependencies/Assets/Render.php +++ b/globals/Dependencies/Assets/Render.php @@ -26,13 +26,13 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['hatthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Hat ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Hat ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, "https://www.idk16.xyz/", "png", - "750", - "750" + "1500", + "1500" )) ); @@ -57,14 +57,14 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['tshirtthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render TShirt ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render TShirt ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, - "https://www.idk16.xyz/asset/?id=38", + "https://www.idk16.xyz/asset/?id=41", "https://www.idk16.xyz/", "png", - "750", - "750" + "1500", + "1500" )) ); @@ -89,14 +89,14 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['shirtthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Shirt ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Shirt ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, - "https://www.idk16.xyz/asset/?id=38", + "https://www.idk16.xyz/asset/?id=41", "https://www.idk16.xyz/", "png", - "750", - "750" + "1500", + "1500" )) ); @@ -121,14 +121,14 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['pantsthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Pants ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Pants ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, - "https://www.idk16.xyz/asset/?id=38", + "https://www.idk16.xyz/asset/?id=41", "https://www.idk16.xyz/", "png", - "750", - "750" + "1500", + "1500" )) ); @@ -153,13 +153,13 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['facethumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Face ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Face ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, "https://www.idk16.xyz/", "png", - "750", - "750" + "1500", + "1500" )) ); @@ -184,14 +184,14 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['headthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Head ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Head ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, - "https://www.idk16.xyz/asset/?id=38", + "https://www.idk16.xyz/asset/?id=41", "https://www.idk16.xyz/", "png", - "750", - "750" + "1500", + "1500" )) ); @@ -216,12 +216,12 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['gearthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Gear ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Gear ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, "png", - "750", - "750", + "1500", + "1500", "https://www.idk16.xyz/" )) ); @@ -247,15 +247,15 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['packagescript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Package ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Package ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=27112025;https://www.idk16.xyz/asset/?id=27112039;https://www.idk16.xyz/asset/?id=27112052", "https://www.idk16.xyz/", - "https://www.idk16.xyz/asset/?id=38", + "https://www.idk16.xyz/asset/?id=41", "https://www.idk16.xyz/", "png", - "768", - "432" + "1500", + "1500" )) ); @@ -280,13 +280,13 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['modelthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Model ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Model ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, "https://www.idk16.xyz/", "png", - "768", - "432" + "1500", + "1500" )) ); @@ -311,13 +311,13 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['meshthumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Mesh ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Mesh ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, "https://www.idk16.xyz/", "png", - "768", - "432" + "1500", + "1500" )) ); @@ -342,13 +342,13 @@ namespace Finobe\Assets { $thumbnailScript = file_get_contents($GLOBALS['placethumbnailscript']); $soap = new RccServiceHelper($GLOBALS['thumbnailArbiter']); $soap = $soap->BatchJobEx( - $soap->ConstructGenericJob(gen_uuid(), 25, 0, 3, "Render Place ".$assetid, $thumbnailScript, array( + $soap->ConstructGenericJob(gen_uuid(), 60, 0, 3, "Render Place ".$assetid, $thumbnailScript, array( $assetid, "https://www.idk16.xyz/asset/?id=".$assetid, "https://www.idk16.xyz/", "png", - "768", - "432" + "1536", + "864" )) ); @@ -368,45 +368,54 @@ namespace Finobe\Assets { if (ImageHelper::IsBase64PNGImage($render)) //PNG { $newhash = HashingUtiltity::VerifyMD5(md5($render)); - if (!file_get_contents($rendersPath . $newhash)) - { - if (file_put_contents($rendersPath . $newhash, $render)) - { - if ($placerender) { - if (getAssetInfo($assetid)->isPersonalServer == 1) { - $render = imagecreatefrompng($rendersPath . $newhash); - $overlay = imagecreatefrompng($GLOBALS['pbsOverlayPath']); - ImageHelper::CopyMergeImageAlpha($render, $overlay, 0, 0, 0, 0, imagesx($render), imagesy($render), 100); - if (!imagepng($render, $rendersPath . $newhash)) { - return false; - } - } + + if(file_get_contents($rendersPath . $newhash)) { + return false; + } + + if ($placerender) { + if(!ImageHelper::ResizeImageFromString(768 , 432 , $rendersPath . $newhash, $render)) { //scale down for a SLIGHT AA effect + return false; + } + + if (getAssetInfo($assetid)->isPersonalServer == 1) { + $render = imagecreatefrompng($rendersPath . $newhash); + $overlay = imagecreatefrompng($GLOBALS['pbsOverlayPath']); + ImageHelper::CopyMergeImageAlpha($render, $overlay, 0, 0, 0, 0, imagesx($render), imagesy($render), 100); + if (!imagepng($render, $rendersPath . $newhash)) { + return false; } - - //delete old hash - $prevhash = $GLOBALS['pdo']->prepare("SELECT * FROM assets WHERE id = :i"); - $prevhash->bindParam(":i", $assetid, PDO::PARAM_INT); - $prevhash->execute(); - $prevhash = $prevhash->fetch(PDO::FETCH_OBJ); - $oldhash = $prevhash->ThumbHash; - unlink($rendersPath . $oldhash); - - if ($placerender) { - //update place thumbhash n details - $c = $GLOBALS['pdo']->prepare("UPDATE assets SET isPlaceRendered = 1, IconImageAssetId = 0, ThumbHash = :n WHERE id = :i"); - $c->bindParam(":n", $newhash, PDO::PARAM_INT); //item price - $c->bindParam(":i", $assetid, PDO::PARAM_INT); //catalog id - $c->execute(); - } else { - //set new hash - $newthumbhash = $GLOBALS['pdo']->prepare("UPDATE assets SET ThumbHash = :h WHERE id = :i"); - $newthumbhash->bindParam(":h", $newhash, PDO::PARAM_STR); - $newthumbhash->bindParam(":i", $assetid, PDO::PARAM_INT); - $newthumbhash->execute(); - } - return true; - } + } + } + else + { + if(!ImageHelper::ResizeImageFromString(750 , 750 , $rendersPath . $newhash, $render)) { //scale down for a SLIGHT AA effect + return false; + } } + + //delete old hash + $prevhash = $GLOBALS['pdo']->prepare("SELECT * FROM assets WHERE id = :i"); + $prevhash->bindParam(":i", $assetid, PDO::PARAM_INT); + $prevhash->execute(); + $prevhash = $prevhash->fetch(PDO::FETCH_OBJ); + $oldhash = $prevhash->ThumbHash; + unlink($rendersPath . $oldhash); + + if ($placerender) { + //update place thumbhash n details + $c = $GLOBALS['pdo']->prepare("UPDATE assets SET isPlaceRendered = 1, IconImageAssetId = 0, ThumbHash = :n WHERE id = :i"); + $c->bindParam(":n", $newhash, PDO::PARAM_INT); //item price + $c->bindParam(":i", $assetid, PDO::PARAM_INT); //catalog id + $c->execute(); + } else { + //set new hash + $newthumbhash = $GLOBALS['pdo']->prepare("UPDATE assets SET ThumbHash = :h WHERE id = :i"); + $newthumbhash->bindParam(":h", $newhash, PDO::PARAM_STR); + $newthumbhash->bindParam(":i", $assetid, PDO::PARAM_INT); + $newthumbhash->execute(); + } + return true; } return false; } diff --git a/globals/Dependencies/Users/ReferralProgram.php b/globals/Dependencies/Users/ReferralProgram.php index fc77058..cf567de 100644 --- a/globals/Dependencies/Users/ReferralProgram.php +++ b/globals/Dependencies/Users/ReferralProgram.php @@ -15,11 +15,12 @@ namespace Finobe\Users { { public static function IsMember(int $userid) { - if (Group::IsInGroup($userid, 22)) //id 22 is the official referral program group - { - return true; - } - return false; + return true; + //if (Group::IsInGroup($userid, 22)) //id 22 is the official referral program group + //{ + // return true; + //} + //return false; } public static function IsUserGeneratedKey(string $key) diff --git a/globals/Dependencies/Web/WebContextManager.php b/globals/Dependencies/Web/WebContextManager.php index 01d0431..363e565 100644 --- a/globals/Dependencies/Web/WebContextManager.php +++ b/globals/Dependencies/Web/WebContextManager.php @@ -50,8 +50,12 @@ namespace Finobe\Web { } public static function VerifyAccessKeyHeader() - { + { $headers = WebContextManager::GetRequestHeaders(); + + if(!array_key_exists('Accesskey', $headers)) + return false; + $accesskey = $headers['Accesskey']; if (!empty($accesskey)) diff --git a/globals/config.php b/globals/config.php index 37f5aed..1f2639d 100644 --- a/globals/config.php +++ b/globals/config.php @@ -30,7 +30,7 @@ try PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, //bad for prod? //PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING, PDO::ATTR_EMULATE_PREPARES => false, - PDO::ATTR_PERSISTENT => true + //PDO::ATTR_PERSISTENT => true ); //host //db name //db user //db password //options $pdo = new PDO("mysql:host=localhost;dbname=finobe", "service-finobe", "135zZsjV3_K2j-VC", $pdoOptions); @@ -49,8 +49,8 @@ try $ROBLOXAssetThumbnailAPI = "https://thumbnails.roblox.com/v1/assets?assetIds="; //default character hashes - $defaultOutfitHash = "e335382cb0ef996df9053df58adcbe95"; //default render hash for characters - $defaultHeadshotHash = "fb5d52c08aa538483647373c5a20fd73"; //default headshot render for characters + $defaultOutfitHash = "95432e22e7ebc8868415fd186096917f"; //default render hash for characters + $defaultHeadshotHash = "80a426e19403b3fefaa7fcf5efde22c0"; //default headshot render for characters //cdn urls $renderCDN = "https://trcdn.idk16.xyz"; //endpoint for renders @@ -90,11 +90,11 @@ try $privateKeyPath = "C:/Alphaland/FinobeRawKey.txt"; //path to where the private key is stored //machine ip's - $gameMachine = "76.190.219.176"; //IP address of the machine that runs gameservers - $renderMachine = "192.168.0.24"; //IP address of the machine that renders thumbnails + $gameMachine = "76.189.132.114"; //IP address of the machine that runs gameservers + $renderMachine = "192.168.1.117"; //IP address of the machine that renders thumbnails //arbiter ip's - $gamesArbiter = "192.168.0.23:64989"; //IP address/port of the Arbiter running on the gameserver machine + $gamesArbiter = "192.168.1.118:64989"; //IP address/port of the Arbiter running on the gameserver machine $thumbnailArbiter = $renderMachine.":64989"; //IP address/port of the Arbiter running on the render machine //autoloader include diff --git a/globals/functions.php b/globals/functions.php index f23e85c..be46b56 100644 --- a/globals/functions.php +++ b/globals/functions.php @@ -717,7 +717,7 @@ function approveAsset($id) //currently supports t-shirts, shirts and pants function fetchPendingAssets($extraparams="") { - $pending = $GLOBALS['pdo']->prepare("SELECT * FROM assets WHERE IsApproved = 0 AND IsModerated = 0 AND (AssetTypeId = 1 AND Description = 'Place Thumbnail' OR AssetTypeId = 1 AND Description = 'Badge Image' OR AssetTypeId = 2 OR AssetTypeId = 11 OR AssetTypeId = 12 OR AssetTypeId = 22 OR AssetTypeId = 21) ".$extraparams.""); + $pending = $GLOBALS['pdo']->prepare("SELECT * FROM assets WHERE IsApproved = 0 AND IsModerated = 0 AND (AssetTypeId = 1 AND Description = 'Place Thumbnail' OR AssetTypeId = 1 AND Description = 'Badge Image' OR AssetTypeId = 2 OR AssetTypeId = 11 OR AssetTypeId = 12 OR AssetTypeId = 22 OR AssetTypeId = 21 OR AssetTypeId = 3) ".$extraparams.""); $pending->execute(); return $pending; } @@ -1613,6 +1613,18 @@ function getImageFromAsset($id) return constructThumbnailHashUrl($thumbhash); } +function getAssetFromAsset($id) +{ + $check = $GLOBALS['pdo']->prepare("SELECT * FROM assets WHERE id = :i"); + $check->bindParam(":i", $id, PDO::PARAM_INT); + $check->execute(); + $check = $check->fetch(PDO::FETCH_OBJ); + + $thumbhash = $check->Hash; + + return constructAssetHashUrl($thumbhash); +} + function getPlayerRender($uid, $headshot=false) { //check if the user has a stalled render @@ -1637,7 +1649,7 @@ function getPlayerRender($uid, $headshot=false) } } } - return getImageFromAsset(229); //229 is the pending render image + return getImageFromAsset(262); //229 is the pending render image (changed for FOBE) } function getAssetRender($id) @@ -1648,15 +1660,22 @@ function getAssetRender($id) { if ($assetinfo->IsModerated == true) { - return getImageFromAsset(193); //193 is moderated asset image + return getImageFromAsset(263); //193 is moderated asset image (changed for FOBE) } elseif ($assetinfo->IsApproved == false) { - return getImageFromAsset(194); //194 is pending asset image + return getImageFromAsset(262); //194 is pending asset image (changed for FOBE) } else { - if ($assetinfo->AssetTypeId == 1 || $assetinfo->AssetTypeId == 22) //images and group emblems + if ($assetinfo->AssetTypeId == 3) //audios + { + $assethash = $assetinfo->Hash; + if (file_exists($GLOBALS['assetCDNPath'].$assethash)) { + return constructAssetHashUrl($assethash); + } + } + elseif ($assetinfo->AssetTypeId == 1 || $assetinfo->AssetTypeId == 22) //images and group emblems { $assethash = $assetinfo->Hash; if (file_exists($GLOBALS['thumbnailCDNPath'].$assethash)) { @@ -1675,7 +1694,7 @@ function getAssetRender($id) } } } - return getImageFromAsset(126); //126 is default image asset id + return getImageFromAsset(264); //126 is default image asset id (changed for FOBE) } function setPlaceUsingCustomThumbnail($id) @@ -1754,11 +1773,11 @@ function handleGameThumb($id) if ($iconimageassetid->IsModerated == true) { - return getImageFromAsset(193); //193 is moderated asset image + return getImageFromAsset(263); //193 is moderated asset image (changed for FOBE) } elseif ($iconimageassetid->IsApproved == false) { - return getImageFromAsset(194); //194 is pending asset image + return getImageFromAsset(262); //194 is pending asset image (changed for FOBE) } else { @@ -1802,6 +1821,10 @@ function setBlurb($newblurb) function setDefaults($uid) //gives default shirt and pants, body colors and wears the shirt and pants { + $updateuser = $GLOBALS['pdo']->prepare('UPDATE users SET referralNextRenewal = (UNIX_TIMESTAMP() + 604800) WHERE id = :u'); + $updateuser->bindParam(":u", $uid, PDO::PARAM_INT); + $updateuser->execute(); + /*$check = $GLOBALS['pdo']->prepare("INSERT into owned_assets (uid, aid, stock, when_sold, givenby) VALUES(:u, 133, 0, UNIX_TIMESTAMP(), 1)"); //give asset 133 $check->bindParam(":u", $uid, PDO::PARAM_INT); $check->execute(); @@ -1826,7 +1849,20 @@ function setDefaults($uid) //gives default shirt and pants, body colors and wear $check6->bindParam(":u", $uid, PDO::PARAM_INT); $check6->execute(); - $check7 = $GLOBALS['pdo']->prepare("INSERT into body_colours (uid) VALUES(:u)"); //body colors (we just need a uid since the default is in the db) + $randomTorsoArray = [ + 21, // Bright red + 23, // Deep blue + 24, // Bright yellow + 26, // Black + 28, // Bright green + 141, // Earth green + 194, // Medium stone grey + 199, // Dark stone grey + 1002, // Mid grey + ]; + $randomTorso = $randomTorsoArray[array_rand($randomTorsoArray)]; + $check7 = $GLOBALS['pdo']->prepare("INSERT into body_colours (uid, t) VALUES(:u, :t)"); //body colors (we just need a uid since the default is in the db) + $check7->bindParam(":t", $randomTorso, PDO::PARAM_INT); $check7->bindParam(":u", $uid, PDO::PARAM_INT); $check7->execute(); @@ -1837,6 +1873,8 @@ function setDefaults($uid) //gives default shirt and pants, body colors and wear $check8->bindParam(":hdh", $defaultheadshothash, PDO::PARAM_STR); $check8->bindParam(":u", $uid, PDO::PARAM_INT); $check8->execute(); + + UsersRender::RenderPlayer($uid, true); } function itemSalesCount($id) @@ -2675,8 +2713,7 @@ function getFooter()
- - +
@@ -2911,7 +2948,7 @@ function adminPanelStats() {
Server Date (EST): '.date("m/d/Y", time()).'
Server Time (EST): '.shell_exec('TIME /T').'
Server OS Version: Microsoft Windows Server 2012 R2 Standard
-
NGINX Version: '.$_SERVER['SERVER_SOFTWARE'].'
+
Server Software: '.$_SERVER['SERVER_SOFTWARE'].'
PHP Version: '.phpversion().'
MySQL Version: '.shell_exec('mysql --version').'
SOAP Faults: '.$faults.'
diff --git a/html/Game/Join.php b/html/Game/Join.php index 014f153..3c759b0 100644 --- a/html/Game/Join.php +++ b/html/Game/Join.php @@ -86,7 +86,7 @@ if ($_SERVER['HTTP_USER_AGENT'] == $GLOBALS['clientUserAgent']) //user agent res $userid = $sInfo->uid; $username = getUsername($userid); $characterappearance = "https://api.idk16.xyz/users/avatar-accoutrements?userId=" . $userid; - $accountage = round((time()-userInfo($userid)->joindate)/86400); + $accountage = round((time()-userInfo($userid)->joindate)/86400) + 1; $joinparams = json_encode(array( "ClientPort" => 0, diff --git a/html/Game/PlaceLauncher.php b/html/Game/PlaceLauncher.php index 1e0c845..6fd656f 100644 --- a/html/Game/PlaceLauncher.php +++ b/html/Game/PlaceLauncher.php @@ -122,9 +122,27 @@ if ($requesttype == "RequestGame") //start new server or join existing one if (Game::UserAccess($gameID, $user->id)) { + $ispbs = false;//(bool)$gInfo->isPersonalServer; + //check for open servers - $servers = $pdo->prepare("SELECT * FROM open_servers WHERE gameID = :i AND (status = 0 OR status = 1) ORDER BY status DESC LIMIT 1"); + $query = "SELECT * FROM open_servers WHERE gameID = :i AND (status = 0 OR status = 1) ORDER BY status DESC LIMIT 1"; + if(!$ispbs) { + $query = "SELECT open_servers.* + FROM open_servers + LEFT OUTER JOIN game_presence + ON open_servers.jobid = game_presence.jobid + WHERE open_servers.gameID = :i + AND (open_servers.status = 0 or open_servers.status = 1) + AND (SELECT COUNT(*) FROM game_presence WHERE game_presence.jobid = open_servers.jobid AND (game_presence.lastPing + 50) > UNIX_TIMESTAMP()) < :mp + ORDER BY (SELECT COUNT(*) FROM game_presence WHERE game_presence.jobid = open_servers.jobid AND (game_presence.lastPing + 50) > UNIX_TIMESTAMP()) + LIMIT 1;"; + } + + $servers = $pdo->prepare($query); $servers->bindParam(":i", $gameID, PDO::PARAM_INT); + if(!$ispbs) { + $servers->bindParam(":mp", $gInfo->MaxPlayers, PDO::PARAM_INT); + } $servers->execute(); if($servers->rowCount() > 0) //server already available { @@ -156,8 +174,11 @@ if ($requesttype == "RequestGame") //start new server or join existing one } else //no available servers { - $sQ = $pdo->prepare("SELECT * FROM open_servers WHERE (status = 0 OR status = 1) AND gameID = :i"); + $sQ = $pdo->prepare($query); $sQ->bindParam(":i", $gameID, PDO::PARAM_INT); + if(!$ispbs) { + $servers->bindParam(":mp", $gInfo->MaxPlayers, PDO::PARAM_INT); + } $sQ->execute(); if($sQ->rowCount() == 0) //check one more time if a server spawned diff --git a/html/MCP/asset-management.php b/html/MCP/asset-management.php index 2c7abf4..9bcd54a 100644 --- a/html/MCP/asset-management.php +++ b/html/MCP/asset-management.php @@ -74,6 +74,17 @@ function approveAsset(id) } }); } + +function assetTypeToThumb(object) { + var html = ``; + if (object.assettypeid != 3) { + html = ``; + } else { + html = ``; + } + return html; +} + function assetPage(num, keyword = "") { currentPage = num; @@ -84,7 +95,7 @@ function assetPage(num, keyword = "") html +='
'; html +=''; html +='
'; - html +=''; + html +='[assetTypeToThumb]'; html +='{name}'; html +=''; html +='
'; diff --git a/html/MCP/pendingassets.php b/html/MCP/pendingassets.php index 9bd3c7c..0b069d3 100644 --- a/html/MCP/pendingassets.php +++ b/html/MCP/pendingassets.php @@ -66,7 +66,10 @@ foreach($assets as $asset) $desc = cleanOutputNoFilter($asset['Description']); //description of the game $creatorname = getUsername($creatorid); //creator of the game username $image = ""; - if ($assettypeid == 2|| $assettypeid == 11 || $assettypeid == 12) { //tshirts, shirts and pants + if ($assettypeid == 3) { //audio + $image = getAssetFromAsset($assetid); + } + elseif ($assettypeid == 2|| $assettypeid == 11 || $assettypeid == 12) { //tshirts, shirts and pants $image = getSPTCosmeticTexture($assetid); } else { $image = getImageFromAsset($assetid); //anything else probably diff --git a/html/Studio/IDE/UploadModel.php b/html/Studio/IDE/UploadModel.php index 3b05d0e..a45405b 100644 --- a/html/Studio/IDE/UploadModel.php +++ b/html/Studio/IDE/UploadModel.php @@ -30,7 +30,7 @@ $body = <<
+
+
Create Audio
+ Audios cost 10 Alphabux to create, only supports .mp3 and .ogg files +
+
+ + +
+
+
+ + +
+
+
+
+ + +
+
+
+ +
diff --git a/html/download.php b/html/download.php index 14cb52a..1141e8d 100644 --- a/html/download.php +++ b/html/download.php @@ -2,18 +2,18 @@ if (isset($_POST['SubmitClient'])) { - $loc = $GLOBALS['setupHtmlPath'].$ws->FinobeVersion."-FinobeLauncher.exe"; + $loc = $GLOBALS['setupHtmlPath'].$ws->AlphalandVersion."-FinobeLauncher.exe"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=FinobeLauncher.exe"); - echo file_get_contents($loc); + exit(file_get_contents($loc)); } if (isset($_POST['SubmitStudio'])) { - $loc = $GLOBALS['setupHtmlPath'].$ws->FinobeStudioVersion."-FinobeStudioLauncher.exe"; + $loc = $GLOBALS['setupHtmlPath'].$ws->AlphalandStudioVersion."-FinobeStudioLauncher.exe"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=FinobeStudioLauncher.exe"); - echo file_get_contents($loc); + exit(file_get_contents($loc)); } $body = << + EOT; } else diff --git a/html/thumb/avatar.php b/html/thumb/avatar.php index f1a6208..91ad74f 100644 --- a/html/thumb/avatar.php +++ b/html/thumb/avatar.php @@ -30,6 +30,13 @@ function show_image($image, $width, $height) if ($userID | $height | $width) { + if ($height > 1920 | $width > 1920) + { + http_response_code(400); + header('Content-Type: text/plain'); + exit('Invalid resolution.'); + } + //grab the user's thumbnail hash to call it up from the CDN $userhash = $pdo->prepare("SELECT * FROM users WHERE id = :i"); $userhash->bindParam(":i", $userID, PDO::PARAM_INT); diff --git a/html_admin/client-deployer-upload.php b/html_admin/client-deployer-upload.php index b5ff7d6..d9cebe5 100644 --- a/html_admin/client-deployer-upload.php +++ b/html_admin/client-deployer-upload.php @@ -50,9 +50,9 @@ if ($deploytype == "client") { $expectedfiles = 0; if ($deploytype == "client") { - $expectedfiles = 13; + $expectedfiles = 14; } else if ($deploytype == "studio") { - $expectedfiles = 16; + $expectedfiles = 17; } //expected files count @@ -79,6 +79,7 @@ foreach ($files as $key=>$val) { $filename == "content-terrain.zip" || $filename == "content-textures.zip" || $filename == "content-textures2.zip" || + $filename == "content-textures3.zip" || $filename == "Libraries.zip" || $filename == "redist.zip" || $filename == "shaders.zip") { @@ -103,6 +104,7 @@ foreach ($files as $key=>$val) { $filename == "content-terrain.zip" || $filename == "content-textures.zip" || $filename == "content-textures2.zip" || + $filename == "content-textures3.zip" || $filename == "Libraries.zip" || $filename == "redist.zip" || $filename == "shaders.zip") { @@ -143,6 +145,7 @@ if ($pass) { unlink($setup_html . $previousdeployversion . "-content-terrain.zip"); unlink($setup_html . $previousdeployversion . "-content-textures.zip"); unlink($setup_html . $previousdeployversion . "-content-textures2.zip"); + unlink($setup_html . $previousdeployversion . "-content-textures3.zip"); unlink($setup_html . $previousdeployversion . "-Libraries.zip"); unlink($setup_html . $previousdeployversion . "-redist.zip"); unlink($setup_html . $previousdeployversion . "-shaders.zip"); @@ -162,20 +165,22 @@ if ($pass) { $versiontextname = "-BootstrapperQTStudioVersion.txt"; } + file_put_contents($setup_html . $newgameversion . '-rbxManifest.txt',''); + $fp = fopen($setup_html . $newgameversion . $versiontextname,"wb"); fwrite($fp,$launcherfileversion); fclose($fp); //update in db if ($deploytype == "client") { - $updatewebsettings = $pdo->prepare("UPDATE websettings SET FinobeVersion = :av, security_version = :sv, md5_hash = :mh, GameFileVersion = :gv"); + $updatewebsettings = $pdo->prepare("UPDATE websettings SET AlphalandVersion = :av, security_version = :sv, md5_hash = :mh, GameFileVersion = :gv"); $updatewebsettings->bindParam(":av", $newgameversion, PDO::PARAM_STR); $updatewebsettings->bindParam(":sv", $gamesecurityversion, PDO::PARAM_STR); $updatewebsettings->bindParam(":mh", $gamemd5hash, PDO::PARAM_STR); $updatewebsettings->bindParam(":gv", $gamefileversion, PDO::PARAM_STR); $updatewebsettings->execute(); } else if ($deploytype == "studio") { - $updatewebsettings = $pdo->prepare("UPDATE websettings SET FinobeStudioVersion = :asv, StudioFileVersion = :sfv"); + $updatewebsettings = $pdo->prepare("UPDATE websettings SET AlphalandStudioVersion = :asv, StudioFileVersion = :sfv"); $updatewebsettings->bindParam(":asv", $newgameversion, PDO::PARAM_STR); $updatewebsettings->bindParam(":sfv", $gamefileversion, PDO::PARAM_STR); $updatewebsettings->execute(); diff --git a/html_api/catalog/items.php b/html_api/catalog/items.php index 9fe5f71..f4f29d7 100644 --- a/html_api/catalog/items.php +++ b/html_api/catalog/items.php @@ -79,7 +79,13 @@ foreach($catalog as $item) $assetcreatorid = $item['CreatorId']; $creatorname = getUsername($assetcreatorid); - $render = getAssetRender($assetid); + $render = ''; + + if($item['AssetTypeId'] != 3) { + $render = getAssetRender($assetid); + } else { + $render = getImageFromAsset(1466); //1466 is default audio + } $itemInfo = array( "id" => $assetid, diff --git a/html_api/group/joinrequests.php b/html_api/group/joinrequests.php index 2d3013b..0fb0a5f 100644 --- a/html_api/group/joinrequests.php +++ b/html_api/group/joinrequests.php @@ -17,7 +17,7 @@ $page = $_GET['page']; $limit = $_GET['limit']; //initial checks -if (!groupid || !$limit || !$page) +if (!$groupid || !$limit || !$page) { http_response_code(400); } diff --git a/html_api/users/get-by-username.php b/html_api/users/get-by-username.php new file mode 100644 index 0000000..0f50887 --- /dev/null +++ b/html_api/users/get-by-username.php @@ -0,0 +1,35 @@ + false, + 'errorMessage' => 'User not found' + ]); + +$name = $_GET['username']; + +$get = $pdo->prepare("SELECT * FROM users WHERE username = :u ORDER BY `id` DESC"); +$get->bindParam(":u", $name, PDO::PARAM_INT); +$get->execute(); +if($get->rowCount() == 0) + exit($notFound); + +$user = $get->fetch(PDO::FETCH_OBJ); + +if(UserModerationManager::IsBanned($user->id)) + exit($notFound); + +exit(json_encode([ + 'Id' => $user->id, + 'Username' => $user->username, + 'AvatarUri' => $GLOBALS['renderCDN'] . '/' . $user->ThumbHash, + 'AvatarFinal' => true, + 'IsOnline' => ($user->lastseen + 120) > time(), +])); \ No newline at end of file diff --git a/html_api/users/index.php b/html_api/users/index.php new file mode 100644 index 0000000..4e00388 --- /dev/null +++ b/html_api/users/index.php @@ -0,0 +1,35 @@ + false, + 'errorMessage' => 'User not found' + ]); + +$userid = (int)$_GET['id']; + +$get = $pdo->prepare("SELECT * FROM users WHERE id = :u ORDER BY `id` DESC"); +$get->bindParam(":u", $userid, PDO::PARAM_INT); +$get->execute(); +if($get->rowCount() == 0) + exit($notFound); + +$user = $get->fetch(PDO::FETCH_OBJ); + +if(UserModerationManager::IsBanned($user->id)) + exit($notFound); + +exit(json_encode([ + 'Id' => $user->id, + 'Username' => $user->username, + 'AvatarUri' => $GLOBALS['renderCDN'] . '/' . $user->ThumbHash, + 'AvatarFinal' => true, + 'IsOnline' => ($user->lastseen + 120) > time(), +])); \ No newline at end of file diff --git a/html_api/users/profile/inventory.php b/html_api/users/profile/inventory.php index 3d09d68..2bd6c51 100644 --- a/html_api/users/profile/inventory.php +++ b/html_api/users/profile/inventory.php @@ -77,8 +77,14 @@ foreach($items as $item) $name = cleanOutput($itemInfo->Name); $creatorid = $itemInfo->CreatorId; $creator = getUsername($creatorid); - $render = getAssetRender($itemAssetId); - + $render = ''; + + if($itemInfo->AssetTypeId != 3) { + $render = getAssetRender($assetid); + } else { + $render = getImageFromAsset(1466); //1466 is default audio + } + $items = array( "id" => $itemAssetId, "name" => $name, diff --git a/html_assetgame/Game/Tools/InsertAsset.ashx b/html_assetgame/Game/Tools/InsertAsset.ashx index c6d920f..56710c0 100644 --- a/html_assetgame/Game/Tools/InsertAsset.ashx +++ b/html_assetgame/Game/Tools/InsertAsset.ashx @@ -17,7 +17,7 @@ $userid = $_GET['userid']; $sid = $_GET['sid']; //idk this entire thing will probably just be used for pbs -if ($nsets == 20 && $type == "user" && $userid == 1) //should be for pbs +if ($nsets == 20 && $type == "user") //should be for pbs { echo ' diff --git a/html_clientsettings/Setting/QuietGet/ArbiterConfig.php b/html_clientsettings/Setting/QuietGet/ArbiterConfig.php index 0b7e684..286bec3 100644 --- a/html_clientsettings/Setting/QuietGet/ArbiterConfig.php +++ b/html_clientsettings/Setting/QuietGet/ArbiterConfig.php @@ -7,5 +7,5 @@ header("Expires: -1"); header("Last-Modified: " . gmdate("D, d M Y H:i:s T") . " GMT"); echo json_encode(array( - "ThreadPoolConfig" => "Threads2" + "ThreadPoolConfig" => "Threads16" ), JSON_UNESCAPED_SLASHES); \ No newline at end of file diff --git a/html_clientsettings/Setting/QuietGet/RCCGames.php b/html_clientsettings/Setting/QuietGet/RCCGames.php new file mode 100644 index 0000000..ba770ad --- /dev/null +++ b/html_clientsettings/Setting/QuietGet/RCCGames.php @@ -0,0 +1,22 @@ + +{ + "DFStringUS30605p1": "rrrr7rrrr6rrrr5rrrr4rrrr3rrrr2rrrr1rrrr0", + "DFStringUS30605p2": "____7____6____5____4___.3.x..2....1....0", + "DFStringUS30605p3": "....7....6....5....4....3....2....1._..0", + "DFStringUS30605p4": "____7____6____5____4xxxx3xxx_2__..1..x.0", + "DFStringUS30605p5": "....7....6....5....4....3....2....1....0", + "DFStringUS30605p6": "xx::7::::6::::5::::4::::3::::2::::1::::0" +} \ No newline at end of file diff --git a/html_clientsettings/Setting/QuietGet/RCCThumbnailers.php b/html_clientsettings/Setting/QuietGet/RCCThumbnailers.php new file mode 100644 index 0000000..9c387a2 --- /dev/null +++ b/html_clientsettings/Setting/QuietGet/RCCThumbnailers.php @@ -0,0 +1,15 @@ + +{"DFIntContentProviderThreadPoolSize": "512", "DFFlagContentProviderHttpCaching": "True", "DFFlagImageFailedToLoadContext": "False"} \ No newline at end of file diff --git a/html_gamepersistence/Persistence/getSortedValues.php b/html_gamepersistence/Persistence/getSortedValues.php index 97b741a..976e2d4 100644 --- a/html_gamepersistence/Persistence/getSortedValues.php +++ b/html_gamepersistence/Persistence/getSortedValues.php @@ -1,35 +1,39 @@ prepare($query); - $stmt->bindParam(':key', $key, PDO::PARAM_STR); - $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); - $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); - if($limitSet){ - $stmt->bindParam(':limit', $limit, PDO::PARAM_INT); - } - $stmt->execute(); - $entries = []; - $result = $stmt->fetchAll(PDO::FETCH_ASSOC); - foreach($result as &$data){ - array_push($entries,array("Target"=>$data["target"],"Value"=>$data["value"])); - } - $conn = null; - exit(json_encode(["data"=>array("Entries"=>$entries)], JSON_NUMERIC_CHECK)); - } - exit(json_encode(["error"=>"This driver can't. He just can't. Don't push him."])); +use Finobe\Web\WebContextManager; + +if (!WebContextManager::VerifyAccessKeyHeader()) +{ + die(http_response_code(401)); } -exit(json_encode(["error"=>"Failed to fetch client address."])); + +if(isset($_GET["key"])&&isset($_GET["placeId"])&&isset($_GET["scope"])){ + $query = "SELECT * FROM persistence WHERE type=\"sorted\" AND placeid=:pid AND `key`=:key AND scope=:scope"; + $key = (string)$_GET["key"];; + $pid = (int)$_GET["placeId"];; + $scope = (string)$_GET["scope"]; + $limit = 0; + $limitSet = isset($_GET["pageSize"]); + if($limitSet){ + $query = $query . " LIMIT :limit"; + $limit = (int)$_GET["pageSize"]; + } + $stmt = $pdo->prepare($query); + $stmt->bindParam(':key', $key, PDO::PARAM_STR); + $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); + $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); + if($limitSet){ + $stmt->bindParam(':limit', $limit, PDO::PARAM_INT); + } + $stmt->execute(); + $entries = []; + $result = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach($result as &$data){ + array_push($entries,array("Target"=>$data["target"],"Value"=>$data["value"])); + } + $conn = null; + exit(json_encode(["data"=>array("Entries"=>$entries)], JSON_NUMERIC_CHECK)); +} +exit(json_encode(["error"=>"This driver can't. He just can't. Don't push him."])); ?> \ No newline at end of file diff --git a/html_gamepersistence/Persistence/getV2.php b/html_gamepersistence/Persistence/getV2.php index 90da791..8afdf83 100644 --- a/html_gamepersistence/Persistence/getV2.php +++ b/html_gamepersistence/Persistence/getV2.php @@ -1,6 +1,13 @@ prepare("SELECT * FROM persistence WHERE placeId=:pid AND scope=:scope AND type=:type AND `key`=:key AND target=:target"); - $stmt->bindParam(':key', $key, PDO::PARAM_STR); - $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); - $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); - $stmt->bindParam(':type', $type, PDO::PARAM_STR); - $stmt->bindParam(':target', $target, PDO::PARAM_STR); - $stmt->execute(); - $result = $stmt->fetchAll(PDO::FETCH_ASSOC); - foreach($result as &$data){ - array_push($values,array("Value"=>$data["value"],"Scope"=>$data["scope"],"Key"=>$data["key"],"Target"=>$data["target"])); - } - $conn=null; - exit(json_encode(["data"=>$values], JSON_NUMERIC_CHECK)); - } +if(isset($_GET["placeId"])&&isset($_GET["scope"])&&isset($_GET["type"])){ + $values=[]; + $input = file_get_contents('php://input'); + $qkeys = explode("&",substr($input, 1)); + $tempTable = array(); + foreach($qkeys as &$val){ + $after = substr($val, 0, strpos($val, "=")); + $tempTable[$after]=removeEverythingBefore($val,"="); + } + $qkeys = $tempTable; + $tempTable = null; + + if(isset($qkeys['qkeys[0].key'])&&isset($qkeys['qkeys[0].target'])){ + $key = (string)urldecode($qkeys['qkeys[0].key']); + $pid = (int)$_GET["placeId"]; + $scope = (string)urldecode($_GET["scope"]); + $type = (string)urldecode($_GET["type"]); + $target = (string)urldecode($qkeys['qkeys[0].target']); + + $stmt = $pdo->prepare("SELECT * FROM persistence WHERE placeId=:pid AND scope=:scope AND type=:type AND `key`=:key AND target=:target"); + $stmt->bindParam(':key', $key, PDO::PARAM_STR); + $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); + $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); + $stmt->bindParam(':type', $type, PDO::PARAM_STR); + $stmt->bindParam(':target', $target, PDO::PARAM_STR); + $stmt->execute(); + $result = $stmt->fetchAll(PDO::FETCH_ASSOC); + foreach($result as &$data){ + array_push($values,array("Value"=>$data["value"],"Scope"=>$data["scope"],"Key"=>$data["key"],"Target"=>$data["target"])); + } + $conn=null; + exit(json_encode(["data"=>$values], JSON_NUMERIC_CHECK)); } - exit(json_encode(["error"=>"This driver can't. He just can't. Don't push him."])); } -exit(json_encode(["error"=>"Failed to fetch client address."])); +exit(json_encode(["error"=>"This driver can't. He just can't. Don't push him."])); ?> \ No newline at end of file diff --git a/html_gamepersistence/Persistence/set.php b/html_gamepersistence/Persistence/set.php index 114ebf7..2214c5f 100644 --- a/html_gamepersistence/Persistence/set.php +++ b/html_gamepersistence/Persistence/set.php @@ -8,48 +8,44 @@ if (!WebContextManager::VerifyAccessKeyHeader()) die(http_response_code(401)); } -if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])) +if(isset($_POST["value"])&&isset($_GET["key"])&&isset($_GET["placeId"])&&isset($_GET["scope"])&&isset($_GET["type"])&&isset($_GET["target"])) { - if(isset($_POST["value"])&&isset($_GET["key"])&&isset($_GET["placeId"])&&isset($_GET["scope"])&&isset($_GET["type"])&&isset($_GET["target"])) - { - $values=[]; - $key = (string)$_GET["key"]; - $pid = (int)$_GET["placeId"]; - $scope = (string)$_GET["scope"]; - $type = (string)$_GET["type"]; - $target = (string)$_GET["target"]; - - $query = "INSERT INTO persistence(`key`, placeId, type, scope, target, value) VALUES (:key,:pid,:type,:scope,:target,:val)"; - $queryChanged=false; - - $where = "WHERE placeId=:pid AND scope=:scope AND type=:type AND `key`=:key AND target=:target"; - - $stmt = $pdo->prepare("SELECT * FROM persistence $where"); - $stmt->bindParam(':key', $key, PDO::PARAM_STR); - $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); - $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); - $stmt->bindParam(':type', $type, PDO::PARAM_STR); - $stmt->bindParam(':target', $target, PDO::PARAM_STR); - $stmt->execute(); - if($stmt->rowCount()>0){ - $query = "UPDATE `persistence` SET `value`=:val $where"; - } - - $stmt = $pdo->prepare($query); - $stmt->bindParam(':key', $key, PDO::PARAM_STR); - $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); - $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); - $stmt->bindParam(':type', $type, PDO::PARAM_STR); - $stmt->bindParam(':target', $target, PDO::PARAM_STR); - $stmt->bindParam(':val', $_POST["value"], PDO::PARAM_STR); - $stmt->execute(); - $conn=null; - - $values = [array("Value"=>$_POST["value"],"Scope"=>$scope,"Key"=>$key,"Target"=>$target)]; - - exit(json_encode(["data"=>$values], JSON_NUMERIC_CHECK)); + $values=[]; + $key = (string)$_GET["key"]; + $pid = (int)$_GET["placeId"]; + $scope = (string)$_GET["scope"]; + $type = (string)$_GET["type"]; + $target = (string)$_GET["target"]; + + $query = "INSERT INTO persistence(`key`, placeId, type, scope, target, value) VALUES (:key,:pid,:type,:scope,:target,:val)"; + $queryChanged=false; + + $where = "WHERE placeId=:pid AND scope=:scope AND type=:type AND `key`=:key AND target=:target"; + + $stmt = $pdo->prepare("SELECT * FROM persistence $where"); + $stmt->bindParam(':key', $key, PDO::PARAM_STR); + $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); + $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); + $stmt->bindParam(':type', $type, PDO::PARAM_STR); + $stmt->bindParam(':target', $target, PDO::PARAM_STR); + $stmt->execute(); + if($stmt->rowCount()>0){ + $query = "UPDATE `persistence` SET `value`=:val $where"; } - exit(json_encode(["error"=>"An error occurred"])); + + $stmt = $pdo->prepare($query); + $stmt->bindParam(':key', $key, PDO::PARAM_STR); + $stmt->bindParam(':pid', $pid, PDO::PARAM_INT); + $stmt->bindParam(':scope', $scope, PDO::PARAM_STR); + $stmt->bindParam(':type', $type, PDO::PARAM_STR); + $stmt->bindParam(':target', $target, PDO::PARAM_STR); + $stmt->bindParam(':val', $_POST["value"], PDO::PARAM_STR); + $stmt->execute(); + $conn=null; + + $values = [array("Value"=>$_POST["value"],"Scope"=>$scope,"Key"=>$key,"Target"=>$target)]; + + exit(json_encode(["data"=>$values], JSON_NUMERIC_CHECK)); } -exit(json_encode(["error"=>"Failed to fetch client address."])); +exit(json_encode(["error"=>"An error occurred"])); ?> \ No newline at end of file diff --git a/html_setup/version.php b/html_setup/version.php index c04cf5c..8f9067f 100644 --- a/html_setup/version.php +++ b/html_setup/version.php @@ -1,3 +1,3 @@ FinobeVersion; \ No newline at end of file +echo $ws->AlphalandVersion; \ No newline at end of file diff --git a/html_setup/versionQTStudio.php b/html_setup/versionQTStudio.php index 5460065..3fe5b0f 100644 --- a/html_setup/versionQTStudio.php +++ b/html_setup/versionQTStudio.php @@ -1,3 +1,3 @@ FinobeStudioVersion; \ No newline at end of file +echo $ws->AlphalandStudioVersion; \ No newline at end of file diff --git a/luascripts/game/gameserver.lua b/luascripts/game/gameserver.lua index e22d7e5..e4ebe25 100644 --- a/luascripts/game/gameserver.lua +++ b/luascripts/game/gameserver.lua @@ -69,6 +69,8 @@ if baseurl~=nil then -- players service -- pcall(function() game:GetService("Players"):SetAbuseReportUrl(api .. "/moderation/AbuseReport/InGameChatHandler") end) --TODO: Implement pcall(function() game:GetService("Players"):SetChatFilterUrl(baseurl .. "/Game/ChatFilter.ashx") end) --not even used, just enables filter (lol) + pcall(function() game:GetService("Players"):SetLoadDataUrl(baseurl .. "/Persistence/GetBlobUrl.ashx?placeId=" .. placeId .. "&userId=%d") end) + pcall(function() game:GetService("Players"):SetSaveDataUrl(baseurl .. "/Persistence/SetBlob.ashx?placeId=" .. placeId .. "&userId=%d") end) -- scriptinformationprovider service -- pcall(function() game:GetService("ScriptInformationProvider"):SetAssetUrl(baseurl .. "/Asset/") end) diff --git a/luascripts/thumbnails/AvatarCloseupScript.lua b/luascripts/thumbnails/AvatarCloseupScript.lua index a470862..acdaf5e 100644 --- a/luascripts/thumbnails/AvatarCloseupScript.lua +++ b/luascripts/thumbnails/AvatarCloseupScript.lua @@ -44,6 +44,18 @@ end --local maxDimension = 0 local maxDimension = 2.3 +function FindFirstChildWhichIsA(Inst, Name) + local Found = nil + for _, Child in pairs(Inst:GetChildren()) do + if(Child:isA(Name)) then + Found = Child + break + end + end + + return Found +end + if player.Character then -- Remove gear for _, child in pairs(player.Character:GetChildren()) do @@ -52,7 +64,7 @@ if player.Character then elseif child:IsA("Accoutrement") then local handle = child:FindFirstChild("Handle") if handle then - local attachment = handle:FindFirstChildWhichIsA("Attachment") + local attachment = FindFirstChildWhichIsA(handle, "Attachment") --legacy hat does not have attachment in it and should be considered when zoom out camera if not OnlyCheckHeadAccessoryInHeadShot or not attachment or headAttachments[attachment.Name] then local size = handle.Size / 2 + handle.Position - player.Character.Head.Position