webcontextmanager httpgetping

This commit is contained in:
Astrologies 2021-12-01 19:39:36 -05:00
parent ba7c929dda
commit 598e7af4d5
4 changed files with 10 additions and 6 deletions

View File

@ -5,6 +5,9 @@ Alphaland 2021
*/ */
//vars //vars
use Alphaland\Web\WebContextManager;
$thumbalive = false; $thumbalive = false;
$gamealive = false; $gamealive = false;
@ -12,7 +15,7 @@ $gamealive = false;
function checkThumb($override) function checkThumb($override)
{ {
//thumbnailer check //thumbnailer check
if (httpGetPing($GLOBALS['thumbnailArbiter'], 5000)) //thumb arbiter online if (WebContextManager::HttpGetPing($GLOBALS['thumbnailArbiter'], 5000)) //thumb arbiter online
{ {
if (!$GLOBALS['thumbalive'] or $override) //to prevent flooding mysql calls if (!$GLOBALS['thumbalive'] or $override) //to prevent flooding mysql calls
{ {
@ -35,7 +38,7 @@ function checkThumb($override)
function checkGame($override) function checkGame($override)
{ {
//gameserver check //gameserver check
if (httpGetPing($GLOBALS['gamesArbiter'], 5000)) //gameserver arbiter online if (WebContextManager::HttpGetPing($GLOBALS['gamesArbiter'], 5000)) //gameserver arbiter online
{ {
if (!$GLOBALS['gamealive'] or $override) //to prevent flooding mysql calls if (!$GLOBALS['gamealive'] or $override) //to prevent flooding mysql calls
{ {

View File

@ -2,6 +2,7 @@
namespace Alphaland\Moderation { namespace Alphaland\Moderation {
use Alphaland\Web\WebContextManager;
use PDO; use PDO;
class UserModerationManager class UserModerationManager
@ -62,7 +63,7 @@ namespace Alphaland\Moderation {
$discordid->execute(); $discordid->execute();
if ($discordid->rowCount() > 0) { if ($discordid->rowCount() > 0) {
$discordid = $discordid->fetch(PDO::FETCH_OBJ)->discordid; $discordid = $discordid->fetch(PDO::FETCH_OBJ)->discordid;
httpGetPing("http://localhost:4098/?type=ban&id=".$discordid."&reason=".urlencode($reason), 5000); WebContextManager::HttpGetPing("http://localhost:4098/?type=ban&id=".$discordid."&reason=".urlencode($reason), 5000);
} }
} }
return true; return true;

View File

@ -3506,7 +3506,7 @@ function submitRobloxAssetWorker($requestedassetid, $assettypeid, $assetname, $a
//discord bot api //discord bot api
if ($onsale) { if ($onsale) {
httpGetPing("localhost:4098/?type=itemrelease&assetid=".$newassetid."&name=".urlencode($assetname)."&description=".urlencode($assetdescription)."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($newassetid)->ThumbHash, 8000); WebContextManager::HttpGetPing("localhost:4098/?type=itemrelease&assetid=".$newassetid."&name=".urlencode($assetname)."&description=".urlencode($assetdescription)."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($newassetid)->ThumbHash, 8000);
} }
return true; return true;

View File

@ -167,7 +167,7 @@ $alert = '';
$alert = "<div class='alert alert-success' role='alert'>Uploaded item</div>"; $alert = "<div class='alert alert-success' role='alert'>Uploaded item</div>";
if ($onsale) { if ($onsale) {
httpGetPing("localhost:4098/?type=itemrelease&assetid=".$autoincrement."&name=".urlencode($_POST['item'])."&description=".urlencode($_POST['itemdesc'])."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($autoincrement)->ThumbHash, 8000); WebContextManager::HttpGetPing("localhost:4098/?type=itemrelease&assetid=".$autoincrement."&name=".urlencode($_POST['item'])."&description=".urlencode($_POST['itemdesc'])."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($autoincrement)->ThumbHash, 8000);
} }
} }
// ... // ...
@ -281,7 +281,7 @@ $alert = '';
$alert = "<div class='alert alert-success' role='alert'>Uploaded face</div>"; $alert = "<div class='alert alert-success' role='alert'>Uploaded face</div>";
if ($onsale) { if ($onsale) {
httpGetPing("localhost:4098/?type=itemrelease&assetid=".$autoincrement."&name=".urlencode($_POST['item'])."&description=".urlencode($_POST['itemdesc'])."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($autoincrement)->ThumbHash, 8000); WebContextManager::HttpGetPing("localhost:4098/?type=itemrelease&assetid=".$autoincrement."&name=".urlencode($_POST['item'])."&description=".urlencode($_POST['itemdesc'])."&price=".$price."&image=".$GLOBALS['renderCDN']."/".getAssetInfo($autoincrement)->ThumbHash, 8000);
} }
} }
// ... // ...