webcontextmanager redirect dep

This commit is contained in:
Astrologies 2021-12-12 04:18:28 -05:00
parent c040db0c1f
commit 8620e52a7c
4 changed files with 20 additions and 9 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
use Alphaland\Web\WebContextManager;
$fmt = $_GET['fmt']; $fmt = $_GET['fmt'];
$wd = $_GET['wd']; $wd = $_GET['wd'];
$ht = $_GET['ht']; $ht = $_GET['ht'];
@ -47,11 +49,11 @@ if ($check->rowCount() > 0) //asset exists on Alphaland
//assuming its none of these asset types, redirect to ROBLOX //assuming its none of these asset types, redirect to ROBLOX
if ($check->AssetTypeId == 4) //handle mesh asset, return default image for now (TODO: RENDER THESE) if ($check->AssetTypeId == 4) //handle mesh asset, return default image for now (TODO: RENDER THESE)
{ {
redirect("https://tcdn.alphaland.cc/" . $defaultidhash); WebContextManager::Redirect("https://tcdn.alphaland.cc/" . $defaultidhash);
} }
elseif ($check->AssetTypeId == 40) //handle MeshPart asset, return default image for now (TODO: RENDER THESE) elseif ($check->AssetTypeId == 40) //handle MeshPart asset, return default image for now (TODO: RENDER THESE)
{ {
redirect("https://tcdn.alphaland.cc/" . $defaultidhash); WebContextManager::Redirect("https://tcdn.alphaland.cc/" . $defaultidhash);
} }
elseif ($check->AssetTypeId == 10) //handle model asset, return default image for now (TODO: RENDER THESE) elseif ($check->AssetTypeId == 10) //handle model asset, return default image for now (TODO: RENDER THESE)
{ {
@ -59,17 +61,17 @@ if ($check->rowCount() > 0) //asset exists on Alphaland
{ {
$thumbhash = $check->ThumbHash; $thumbhash = $check->ThumbHash;
redirect("https://trcdn.alphaland.cc/" . $thumbhash); WebContextManager::Redirect("https://trcdn.alphaland.cc/" . $thumbhash);
} }
redirect("https://tcdn.alphaland.cc/" . $defaultidhash); WebContextManager::Redirect("https://tcdn.alphaland.cc/" . $defaultidhash);
} }
elseif ($check->AssetTypeId == 39) //handle SolidModel asset, return default image for now (TODO: RENDER THESE) elseif ($check->AssetTypeId == 39) //handle SolidModel asset, return default image for now (TODO: RENDER THESE)
{ {
redirect("https://tcdn.alphaland.cc/" . $defaultidhash); WebContextManager::Redirect("https://tcdn.alphaland.cc/" . $defaultidhash);
} }
} }
} }
else else
{ {
redirect(getRobloxAssetThumbnail($aid, $wd, $ht, $fmt)); //WebContextManager::Redirect(getRobloxAssetThumbnail($aid, $wd, $ht, $fmt));
} }

View File

@ -1,8 +1,10 @@
<?php <?php
use Alphaland\Web\WebContextManager;
$requesttype = $_GET['request']; $requesttype = $_GET['request'];
$placeid = $_GET['placeId']; $placeid = $_GET['placeId'];
$userid = $_GET['userid']; $userid = $_GET['userid'];
$isTeleport = $_GET['isTeleport']; $isTeleport = $_GET['isTeleport'];
redirect("https://www.alphaland.cc/Game/PlaceLauncher.ashx?request=" . $requesttype . "&placeId=" . $placeid . "&isTeleport=" . $isTeleport); WebContextManager::Redirect("https://www.alphaland.cc/Game/PlaceLauncher.ashx?request=" . $requesttype . "&placeId=" . $placeid . "&isTeleport=" . $isTeleport);

View File

@ -3,6 +3,8 @@
//turns out this is XML format //turns out this is XML format
use Alphaland\Web\WebContextManager;
header("Cache-Control: no-cache"); header("Cache-Control: no-cache");
header("Pragma: no-cache"); header("Pragma: no-cache");
header("Expires: -1"); header("Expires: -1");
@ -7760,6 +7762,6 @@ elseif ($sid)
else else
{ {
//idk just for compatibiliy if for some reason the game needs to use this //idk just for compatibiliy if for some reason the game needs to use this
redirect('https://assetgame.roblox.com/Game/Tools/InsertAsset.ashx?sid='. $sid); WebContextManager::Redirect('https://assetgame.roblox.com/Game/Tools/InsertAsset.ashx?sid='. $sid);
} }
} }

View File

@ -1,5 +1,10 @@
<?php <?php
RCCHeaderEnvironment(); use Alphaland\Web\WebContextManager;
if (!WebContextManager::VerifyAccessKeyHeader())
{
die(http_response_code(401));
}
header("Cache-Control: no-cache, no-store"); header("Cache-Control: no-cache, no-store");
header("Pragma: no-cache"); header("Pragma: no-cache");