pobe
This commit is contained in:
parent
a134124a0e
commit
6ecb5441c9
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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()
|
|||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm">
|
||||
<a style="font-size: 1.6rem;color:red;" href="https://www.youtube.com/channel/UC5o1iJC9wonCWPvTvtORklg"><i class="fab fa-youtube"></i></a>
|
||||
<a style="font-size: 1.6rem;color:#1DA1F2;" href="https://twitter.com/_Finobe"><i class="fab fa-twitter"></i></a>
|
||||
<a style="font-size: 1.6rem;color:#5865f2;" href="https://discord.gg/qmV6P6XRhz"><i class="fab fa-discord"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2911,7 +2948,7 @@ function adminPanelStats() {
|
|||
<div>Server Date (EST): '.date("m/d/Y", time()).'</div>
|
||||
<div>Server Time (EST): '.shell_exec('TIME /T').'</div>
|
||||
<div>Server OS Version: Microsoft Windows Server 2012 R2 Standard</div>
|
||||
<div>NGINX Version: '.$_SERVER['SERVER_SOFTWARE'].'</div>
|
||||
<div>Server Software: '.$_SERVER['SERVER_SOFTWARE'].'</div>
|
||||
<div>PHP Version: '.phpversion().'</div>
|
||||
<div>MySQL Version: '.shell_exec('mysql --version').'</div>
|
||||
<div>SOAP Faults: '.$faults.'</div>
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -74,6 +74,17 @@ function approveAsset(id)
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
function assetTypeToThumb(object) {
|
||||
var html = ``;
|
||||
if (object.assettypeid != 3) {
|
||||
html = `<img class="img-fluid" src="` + object.image + `" style="min-width:128px;max-width:128px;min-height:128px;max-height:128px;" />`;
|
||||
} else {
|
||||
html = `<audio controls="" style="min-width: 128px;max-width: 128px;" src="` + object.image + `"></audio>`;
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
function assetPage(num, keyword = "")
|
||||
{
|
||||
currentPage = num;
|
||||
|
|
@ -84,7 +95,7 @@ function assetPage(num, keyword = "")
|
|||
html +='<div class="card">';
|
||||
html +='<a href="/catalog/view?id={assetid}">';
|
||||
html +='<div class="card-body">';
|
||||
html +='<img class="img-fluid" src="{image}" style="min-width:128px;max-width:128px;min-height:128px;max-height:128px;">';
|
||||
html +='[assetTypeToThumb]';
|
||||
html +='<a style="color:grey;text-decoration:none;" class="no-overflow mb-1">{name}</a>';
|
||||
html +='<button onclick="approveAsset({assetid})" class="btn btn-sm btn-success w-100">Approve</button>';
|
||||
html +='<div class="w-100 mb-1"></div>';
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ $body = <<<EOT
|
|||
<div class="catalog-container">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="studio-upload-card text-center" style="cursor: pointer;" onclick="showNewModelDialog()">
|
||||
<div class="studio-upload-card text-center" style="cursor: pointer;width: 152px;height: 185px" onclick="showNewModelDialog()">
|
||||
<a>
|
||||
<div class="studio-upload-card-img">
|
||||
<img class="img-fluid" src="/finobe/cdn/imgs/addmodelicon.png">
|
||||
|
|
|
|||
|
|
@ -36,8 +36,8 @@ if(isset($_GET['id']))
|
|||
$itemrender = getAssetRender($id);
|
||||
//...
|
||||
|
||||
//only allow shirts, pants and t shirts to be modified by the end user
|
||||
if ($itemtypeint == 2 or $itemtypeint == 11 or $itemtypeint == 12 or $user->isOwner())
|
||||
//only allow shirts, pants, t shirts and audios to be modified by the end user
|
||||
if ($itemtypeint == 2 or $itemtypeint == 11 or $itemtypeint == 12 or $itemtypeint == 3 or $user->isOwner())
|
||||
{
|
||||
//handle onsale checkbox
|
||||
$onsalestatus = "";
|
||||
|
|
@ -83,7 +83,7 @@ if(isset($_GET['id']))
|
|||
$alert = "<div class='alert alert-danger' role='alert'>Item description too short, must be over 3 characters</div>";
|
||||
}
|
||||
*/
|
||||
elseif(strlen($_POST['item_price']) < 1)
|
||||
elseif(strlen($_POST['item_price']) < 1 && $itemtypeint != 3) // no audios
|
||||
{
|
||||
$alert = "<div class='alert alert-danger' role='alert'>Item price too short, must be at least 1 character</div>";
|
||||
}
|
||||
|
|
@ -95,11 +95,11 @@ if(isset($_GET['id']))
|
|||
{
|
||||
$alert = "<div class='alert alert-danger' role='alert'>Item description too long, must be under 1k characters</div>";
|
||||
}
|
||||
elseif(strlen($_POST['item_price']) > 8)
|
||||
elseif(strlen($_POST['item_price']) > 8 && $itemtypeint != 3) // no audios
|
||||
{
|
||||
$alert = "<div class='alert alert-danger' role='alert'>Item price too short, must be under 8 characters</div>";
|
||||
}
|
||||
elseif($_POST['item_price'] < $minimumprice)
|
||||
elseif($_POST['item_price'] < $minimumprice && $itemtypeint != 3) // no audios
|
||||
{
|
||||
$alert = "<div class='alert alert-danger' role='alert'>{$pricealert}</div>";
|
||||
}
|
||||
|
|
@ -124,12 +124,15 @@ if(isset($_GET['id']))
|
|||
$c->execute();
|
||||
// ...
|
||||
|
||||
//update item price
|
||||
$c = $pdo->prepare("UPDATE assets SET PriceInAlphabux = :n, Updated = UNIX_TIMESTAMP() WHERE id = :i");
|
||||
$c->bindParam(":n", $_POST['item_price'], PDO::PARAM_INT); //item price
|
||||
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
|
||||
$c->execute();
|
||||
// ...
|
||||
if($itemtypeint != 3) // Audios
|
||||
{
|
||||
//update item price
|
||||
$c = $pdo->prepare("UPDATE assets SET PriceInAlphabux = :n, Updated = UNIX_TIMESTAMP() WHERE id = :i");
|
||||
$c->bindParam(":n", $_POST['item_price'], PDO::PARAM_INT); //item price
|
||||
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
|
||||
$c->execute();
|
||||
// ...
|
||||
}
|
||||
|
||||
if (isset($_POST['onsale_checkbox']))
|
||||
{
|
||||
|
|
@ -164,7 +167,7 @@ if(isset($_GET['id']))
|
|||
}
|
||||
elseif (isset($_POST['RegenItem'])) //for admin regen stuff
|
||||
{
|
||||
if ($user->IsStaff())
|
||||
if ($user->IsStaff() && $itemtypeint != 3) // Staff and not audio
|
||||
{
|
||||
$script = "";
|
||||
$scripttype = "";
|
||||
|
|
@ -333,9 +336,25 @@ else
|
|||
|
||||
$moderatebutton = '';
|
||||
$regenbutton = '';
|
||||
$itempricebutton = '';
|
||||
$itemimage = '';
|
||||
if($itemtypeint != 3) {
|
||||
$itempricebutton = '<div class="container input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><img style="width:1rem;" src="/finobe/cdn/imgs/alphabux-grey-1024.png"></span>
|
||||
</div>
|
||||
<input type="text" name="item_price" class="form-control" value="' . $itemprice . '">
|
||||
</div>';
|
||||
}
|
||||
|
||||
$itemimage = '<img class="img-fluid" style="width:20rem;" src="' . ($itemtypeint != 3 ? $itemrender : getImageFromAsset(1466)) . '">';
|
||||
|
||||
if ($user->IsStaff())
|
||||
{
|
||||
$regenbutton = '<button type="Submit" name="RegenItem" class="btn btn-danger w-100 mb-2">Regen '.$itemtype.'</button>';
|
||||
if($itemtypeint != 3) {
|
||||
$regenbutton = '<button type="Submit" name="RegenItem" class="btn btn-danger w-100 mb-2">Regen '.$itemtype.'</button>';
|
||||
}
|
||||
|
||||
$moderatebutton = '<button type="Submit" name="ModerateItem" class="btn btn-danger w-100 mb-2">Moderate '.$itemtype.'</button>';
|
||||
}
|
||||
|
||||
|
|
@ -355,7 +374,7 @@ $body = <<<EOT
|
|||
<input class="form-control" type="text" name="item_name" value="{$itemname}">
|
||||
</div>
|
||||
<div class="container text-center">
|
||||
<img class="img-fluid" style="width:20rem;" src="{$itemrender}">
|
||||
{$itemimage}
|
||||
</div>
|
||||
<div class="container text-center">
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
|
|
@ -367,12 +386,7 @@ $body = <<<EOT
|
|||
<label style="float:left;text-align:top;">{$itemtype} Description</label>
|
||||
<textarea style="min-height:10rem;max-height:10rem;" class="form-control" type="text" name="item_description">{$itemdescription}</textarea>
|
||||
</div>
|
||||
<div class="container input-group mb-3">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><img style="width:1rem;" src="/finobe/cdn/imgs/alphabux-grey-1024.png"></span>
|
||||
</div>
|
||||
<input type="text" name="item_price" class="form-control" value="{$itemprice}">
|
||||
</div>
|
||||
{$itempricebutton}
|
||||
<div class="container text-center">
|
||||
{$moderatebutton}
|
||||
{$regenbutton}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ if(isset($_GET['id']))
|
|||
$itemrender = getAssetRender($id);
|
||||
$ownerrender = getPlayerRender($i->CreatorId);
|
||||
$itemtypeint = $i->AssetTypeId;
|
||||
$approved = $i->IsApproved;
|
||||
|
||||
$description = '';
|
||||
//handle item descriptions
|
||||
|
|
@ -148,7 +149,11 @@ EOT;
|
|||
'.$configbutton_html.'
|
||||
</div>
|
||||
<div class="container text-center">
|
||||
<img class="img-fluid" style="width:22rem;'.($itemtypeint == 18 ? 'background-color: rgba(255, 255, 255, 0.15);' : '').'" src="'.$itemrender.'">
|
||||
'.
|
||||
($itemtypeint == 3 && $approved ?
|
||||
'<audio controls style="width:100%;margin:15px 0 15px 0;" src="'.$itemrender.'" />' :
|
||||
'<img class="img-fluid" style="width:22rem;'.($itemtypeint == 18 ? 'background-color: rgba(255, 255, 255, 0.15);' : '').'" src="'.$itemrender.'">')
|
||||
.'
|
||||
</div>
|
||||
<h5>Item Description</h5>
|
||||
<hr>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ $alert = '';
|
|||
$cosmuploadsuccess = $_GET['cosSuccess'];
|
||||
$placesuccess = $_GET['placeSuccess'];
|
||||
$pbssuccess = $_GET['pbsSuccess'];
|
||||
$audsuccess = $_GET['audSuccess'];
|
||||
|
||||
//dont want to be posting same data after refresh (ghetto until JS implementation)
|
||||
if ($cosmuploadsuccess)
|
||||
|
|
@ -27,6 +28,10 @@ if ($pbssuccess)
|
|||
{
|
||||
$alert = "<div class='alert alert-success' role='alert'>Created Personal Server</div>";
|
||||
}
|
||||
if ($audsuccess)
|
||||
{
|
||||
$alert = "<div class='alert alert-success' role='alert'>Created audio</div>";
|
||||
}
|
||||
|
||||
function uploadCosmetic()
|
||||
{
|
||||
|
|
@ -230,6 +235,111 @@ function uploadCosmetic()
|
|||
return true;
|
||||
}
|
||||
|
||||
function uploadSound()
|
||||
{
|
||||
//upload directories
|
||||
$uploadDirectory = $GLOBALS['assetCDNPath']; //directory where the assets are stored
|
||||
|
||||
//allowed image types
|
||||
$types = array('audio/mp3', 'audio/mpeg', 'audio/ogg');
|
||||
|
||||
//generate new hashes
|
||||
$audHash = genAssetHash(16);
|
||||
|
||||
//post variables
|
||||
$audio = $_FILES['audio_file']['tmp_name'];
|
||||
$name = $_POST['audio_name'];
|
||||
$description = $_POST['audio_desc'];
|
||||
|
||||
//variables used for checks
|
||||
$price = 0;
|
||||
$assettype = 3;
|
||||
$minimumprice = 10;
|
||||
$isapproved = false;
|
||||
$onsale = false;
|
||||
|
||||
//time for a lot of checks
|
||||
|
||||
//onsale
|
||||
if (isset($_POST['aud_onsale_checkbox']))
|
||||
{
|
||||
$onsale = true;
|
||||
}
|
||||
|
||||
//check if audio is posted
|
||||
if (!file_exists($audio) || !is_uploaded_file($audio))
|
||||
{
|
||||
return "Please provide an audio";
|
||||
}
|
||||
|
||||
//verify that its a valid .mp3 or .ogg via mimetype
|
||||
$type = finfo_file(finfo_open(FILEINFO_MIME_TYPE), $audio);
|
||||
if (!in_array($type, $types))
|
||||
{
|
||||
return "Invalid audio, must be mp3 or ogg";
|
||||
}
|
||||
|
||||
//name checks
|
||||
if (strlen($name) > 50)
|
||||
{
|
||||
return "Provided name is too long";
|
||||
}
|
||||
|
||||
if (strlen($name) < 3)
|
||||
{
|
||||
return "Provided name is too short";
|
||||
}
|
||||
|
||||
//description check
|
||||
if (strlen($description) > 1000)
|
||||
{
|
||||
return "Provided description too long";
|
||||
}
|
||||
|
||||
//remove currency
|
||||
if (!EconomyHelper::RemoveAlphabux($minimumprice, $GLOBALS['user']->id, "Creation of audio name ".$name))
|
||||
{
|
||||
return "You don't have enough currency";
|
||||
}
|
||||
|
||||
//POINT OF NO RETURN, ALL CHECKS PASSED
|
||||
|
||||
//setup the new asset in the DB, lock it!
|
||||
$GLOBALS['pdo']->exec("LOCK TABLES assets WRITE"); //lock since this stuff is sensitive
|
||||
|
||||
$b = $GLOBALS['pdo']->prepare("SELECT * FROM assets");
|
||||
$b->execute();
|
||||
|
||||
//grab auto increment values
|
||||
$autoincrement = $b->rowCount() + 1; //initial auto increment value
|
||||
$autoincrement2 = $autoincrement+1; //initial auto increment value + 1
|
||||
|
||||
//add XML (selected type) to assets
|
||||
$m = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,:atid,:aname,:adesc,UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),:oid,:aid2,:price,0,0,:onsale,1,0,0,:ia,0,0,0,0,0,8,0,0,:hash)");
|
||||
$m->bindParam(":aid", $autoincrement, PDO::PARAM_INT);
|
||||
$m->bindParam(":atid", $assettype, PDO::PARAM_INT);
|
||||
$m->bindParam(":aname", $name, PDO::PARAM_STR);
|
||||
$m->bindParam(":adesc", $description, PDO::PARAM_STR);
|
||||
$m->bindParam(":oid", $GLOBALS['user']->id, PDO::PARAM_STR);
|
||||
$m->bindParam(":aid2", $autoincrement, PDO::PARAM_INT);
|
||||
$m->bindParam(":ia", $isapproved, PDO::PARAM_INT);
|
||||
$m->bindParam(":price", $price, PDO::PARAM_INT);
|
||||
$m->bindParam(":onsale", $onsale, PDO::PARAM_INT);
|
||||
$m->bindParam(":hash", $audHash, PDO::PARAM_STR);
|
||||
$m->execute();
|
||||
|
||||
//unlock since we are done with sensitive asset stuff
|
||||
$GLOBALS['pdo']->exec("UNLOCK TABLES");
|
||||
|
||||
//give the creator the asset
|
||||
Asset::GiveAsset($autoincrement, $GLOBALS['user']->id, $GLOBALS['user']->id);
|
||||
|
||||
//upload audio to assets
|
||||
move_uploaded_file($audio, $uploadDirectory . $audHash);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function newPlace()
|
||||
{
|
||||
//upload parameters
|
||||
|
|
@ -375,6 +485,19 @@ if (isset($_POST['SubmitAsset']))
|
|||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['SubmitAudio']))
|
||||
{
|
||||
$upload = uploadSound();
|
||||
if ($upload !== true)
|
||||
{
|
||||
$alert = "<div class='alert alert-danger' role='alert'>" . $upload . "</div>";
|
||||
}
|
||||
else
|
||||
{
|
||||
WebContextManager::Redirect('/create?audSuccess=true');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['SubmitPlace']))
|
||||
{
|
||||
|
||||
|
|
@ -401,6 +524,7 @@ if (isset($_POST['SubmitPlace']))
|
|||
<div class="nav flex-column nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
|
||||
<a class="nav-link active red-a-nounder" id="v-pills-asset-tab" data-toggle="pill" href="#v-pills-asset" role="tab" aria-controls="v-pills-asset" aria-selected="true">Cosmetic</a>
|
||||
<a class="nav-link red-a-nounder" id="v-pills-place-tab" data-toggle="pill" href="#v-pills-place" role="tab" aria-controls="v-pills-place">Place</a>
|
||||
<a class="nav-link red-a-nounder" id="v-pills-audio-tab" data-toggle="pill" href="#v-pills-audio" role="tab" aria-controls="v-pills-audio" aria-selected="true">Audio</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -539,6 +663,29 @@ if (isset($_POST['SubmitPlace']))
|
|||
<button id="PBSSubmitButton" name="PBSNoSelection" class="btn btn-danger w-100 mt-2">Create</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="v-pills-audio" role="tabpanel" aria-labelledby="v-pills-audio-tab">
|
||||
<h5>Create Audio</h5>
|
||||
<h>Audios cost 10 Alphabux to create, only supports .mp3 and .ogg files</h>
|
||||
<div class="input-group mb-3">
|
||||
<div class="custom-file">
|
||||
<input type="file" name="audio_file" class="custom-file-input" id="inputAudioFile">
|
||||
<label class="custom-file-label" for="inputAudioFile">Audio</label>
|
||||
</div>
|
||||
</div>
|
||||
<hr />
|
||||
<input class="form-control mb-3" name="audio_name" type="text" placeholder="Audio Name">
|
||||
<textarea class="form-control" name="audio_desc" style="min-height:8rem;max-height:8rem;" placeholder="Audio Description"></textarea>
|
||||
<hr />
|
||||
<div class="container text-center marg-bot-15">
|
||||
<div class="container text-center marg-bot-15">
|
||||
<div class="custom-control custom-checkbox custom-control-inline">
|
||||
<input type="checkbox" name="aud_onsale_checkbox" class="custom-control-input" id="aud_onsale">
|
||||
<label class="custom-control-label" for="aud_onsale">On-Sale</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="submit" name="SubmitAudio" value="Create Audio" class="btn btn-lg btn-danger w-100">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 64 KiB After Width: | Height: | Size: 123 KiB |
|
|
@ -110,10 +110,10 @@ var getparam = new URLSearchParams(window.location.search).get("id");
|
|||
|
||||
function playGame(id) {
|
||||
$.get("https://www.idk16.xyz/Game/authticket", function(data) {
|
||||
$("#linfo").html("Starting Finobe...");
|
||||
$("#linfo").html("Starting Finobe ong frfr");
|
||||
$("#launching").modal("show");
|
||||
$("#closediv").hide();
|
||||
location.href = "finobe-player:1+launchmode:play+gameinfo:" + data + "+placelauncherurl:https://www.idk16.xyz/Game/PlaceLauncher?request=RequestGame&placeid=" + id;
|
||||
location.href = "fobe-player:1+launchmode:play+gameinfo:" + data + "+placelauncherurl:https://www.idk16.xyz/Game/PlaceLauncher?request=RequestGame&placeid=" + id;
|
||||
setTimeout(function() {
|
||||
$("#launching").modal("hide");
|
||||
}, 2500);
|
||||
|
|
|
|||
|
|
@ -112,6 +112,16 @@ if(!isLoggedIn())
|
|||
display: block!important;
|
||||
}
|
||||
|
||||
.home-footer {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
text-align: center;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
#ortxt {
|
||||
color: white!important;
|
||||
margin-top:10px;
|
||||
|
|
@ -135,6 +145,9 @@ if(!isLoggedIn())
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="home-footer"><a href="https://discord.gg/qmV6P6XRhz" target="_blank" class="btn" style="background-color:#5865f2;border-color:#5865f2;color:#fff">Join our Discord <svg class="svg-inline--fa fa-discord fa-w-14" data-fa-pseudo-element-pending-before="discord" aria-hidden="true" focusable="false" data-prefix="fab" data-icon="discord" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M297.216 243.2c0 15.616-11.52 28.416-26.112 28.416-14.336 0-26.112-12.8-26.112-28.416s11.52-28.416 26.112-28.416c14.592 0 26.112 12.8 26.112 28.416zm-119.552-28.416c-14.592 0-26.112 12.8-26.112 28.416s11.776 28.416 26.112 28.416c14.592 0 26.112-12.8 26.112-28.416.256-15.616-11.52-28.416-26.112-28.416zM448 52.736V512c-64.494-56.994-43.868-38.128-118.784-107.776l13.568 47.36H52.48C23.552 451.584 0 428.032 0 398.848V52.736C0 23.552 23.552 0 52.48 0h343.04C424.448 0 448 23.552 448 52.736zm-72.96 242.688c0-82.432-36.864-149.248-36.864-149.248-36.864-27.648-71.936-26.88-71.936-26.88l-3.584 4.096c43.52 13.312 63.744 32.512 63.744 32.512-60.811-33.329-132.244-33.335-191.232-7.424-9.472 4.352-15.104 7.424-15.104 7.424s21.248-20.224 67.328-33.536l-2.56-3.072s-35.072-.768-71.936 26.88c0 0-36.864 66.816-36.864 149.248 0 0 21.504 37.12 78.08 38.912 0 0 9.472-11.52 17.152-21.248-32.512-9.728-44.8-30.208-44.8-30.208 3.766 2.636 9.976 6.053 10.496 6.4 43.21 24.198 104.588 32.126 159.744 8.96 8.96-3.328 18.944-8.192 29.44-15.104 0 0-12.8 20.992-46.336 30.464 7.68 9.728 16.896 20.736 16.896 20.736 56.576-1.792 78.336-38.912 78.336-38.912z"></path></svg><!-- <i class="fab fa-discord"><svg data-fa-pseudo-element=":before" data-prefix="fab" data-icon="discord" class="svg-inline--fa fa-discord fa-w-14" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512" data-fa-i2svg=""><path fill="currentColor" d="M297.216 243.2c0 15.616-11.52 28.416-26.112 28.416-14.336 0-26.112-12.8-26.112-28.416s11.52-28.416 26.112-28.416c14.592 0 26.112 12.8 26.112 28.416zm-119.552-28.416c-14.592 0-26.112 12.8-26.112 28.416s11.776 28.416 26.112 28.416c14.592 0 26.112-12.8 26.112-28.416.256-15.616-11.52-28.416-26.112-28.416zM448 52.736V512c-64.494-56.994-43.868-38.128-118.784-107.776l13.568 47.36H52.48C23.552 451.584 0 428.032 0 398.848V52.736C0 23.552 23.552 0 52.48 0h343.04C424.448 0 448 23.552 448 52.736zm-72.96 242.688c0-82.432-36.864-149.248-36.864-149.248-36.864-27.648-71.936-26.88-71.936-26.88l-3.584 4.096c43.52 13.312 63.744 32.512 63.744 32.512-60.811-33.329-132.244-33.335-191.232-7.424-9.472 4.352-15.104 7.424-15.104 7.424s21.248-20.224 67.328-33.536l-2.56-3.072s-35.072-.768-71.936 26.88c0 0-36.864 66.816-36.864 149.248 0 0 21.504 37.12 78.08 38.912 0 0 9.472-11.52 17.152-21.248-32.512-9.728-44.8-30.208-44.8-30.208 3.766 2.636 9.976 6.053 10.496 6.4 43.21 24.198 104.588 32.126 159.744 8.96 8.96-3.328 18.944-8.192 29.44-15.104 0 0-12.8 20.992-46.336 30.464 7.68 9.728 16.896 20.736 16.896 20.736 56.576-1.792 78.336-38.912 78.336-38.912z"></path></svg></i> --></a>
|
||||
|
||||
</div>
|
||||
EOT;
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ $page = $_GET['page'];
|
|||
$limit = $_GET['limit'];
|
||||
|
||||
//initial checks
|
||||
if (!groupid || !$limit || !$page)
|
||||
if (!$groupid || !$limit || !$page)
|
||||
{
|
||||
http_response_code(400);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Finobe\Moderation\UserModerationManager;
|
||||
|
||||
header('Content-Type: application/json');
|
||||
header("Cache-Control: no-cache");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: -1");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s T") . " GMT");
|
||||
|
||||
$notFound = json_encode([
|
||||
'success' => 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(),
|
||||
]));
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Finobe\Moderation\UserModerationManager;
|
||||
|
||||
header('Content-Type: application/json');
|
||||
header("Cache-Control: no-cache");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: -1");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s T") . " GMT");
|
||||
|
||||
$notFound = json_encode([
|
||||
'success' => 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(),
|
||||
]));
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 '
|
||||
<List>
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
use Finobe\Web\WebContextManager;
|
||||
|
||||
header("Cache-Control: no-cache");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: -1");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s T") . " GMT");
|
||||
|
||||
if(!WebContextManager::VerifyAccessKeyHeader()) {
|
||||
http_response_code(404);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
{
|
||||
"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"
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
use Finobe\Web\WebContextManager;
|
||||
|
||||
header("Cache-Control: no-cache");
|
||||
header("Pragma: no-cache");
|
||||
header("Expires: -1");
|
||||
header("Last-Modified: " . gmdate("D, d M Y H:i:s T") . " GMT");
|
||||
|
||||
if(!WebContextManager::VerifyAccessKeyHeader()) {
|
||||
http_response_code(404);
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
{"DFIntContentProviderThreadPoolSize": "512", "DFFlagContentProviderHttpCaching": "True", "DFFlagImageFailedToLoadContext": "False"}
|
||||
|
|
@ -1,35 +1,39 @@
|
|||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])){
|
||||
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."]));
|
||||
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."]));
|
||||
?>
|
||||
|
|
@ -1,6 +1,13 @@
|
|||
<?php
|
||||
header("Content-Type: application/json");
|
||||
|
||||
use Finobe\Web\WebContextManager;
|
||||
|
||||
if (!WebContextManager::VerifyAccessKeyHeader())
|
||||
{
|
||||
die(http_response_code(401));
|
||||
}
|
||||
|
||||
function removeEverythingBefore($in, $before) {
|
||||
$pos = strpos($in, $before);
|
||||
return $pos !== FALSE
|
||||
|
|
@ -15,42 +22,39 @@ function removeEverythingAfter($in, $before) {
|
|||
: "";
|
||||
}
|
||||
|
||||
if(isset($_SERVER["HTTP_CF_CONNECTING_IP"])){
|
||||
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));
|
||||
}
|
||||
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."]));
|
||||
?>
|
||||
|
|
@ -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"]));
|
||||
?>
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
|
||||
echo $ws->FinobeVersion;
|
||||
echo $ws->AlphalandVersion;
|
||||
|
|
@ -1,3 +1,3 @@
|
|||
<?php
|
||||
|
||||
echo $ws->FinobeStudioVersion;
|
||||
echo $ws->AlphalandStudioVersion;
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue