rccservicehelper dep

This commit is contained in:
Astrologies 2021-12-10 01:35:09 -05:00
parent 4f8cfbb3e3
commit d930844c1b
3 changed files with 16 additions and 6 deletions

View File

@ -1,5 +1,6 @@
<?php <?php
use Alphaland\Grid\RccServiceHelper;
use Alphaland\Web\WebContextManager; use Alphaland\Web\WebContextManager;
if (!WebContextManager::VerifyAccessKeyHeader()) if (!WebContextManager::VerifyAccessKeyHeader())
@ -30,7 +31,8 @@ else
if ($players->rowCount() > 0) //atleast 1 player in job if ($players->rowCount() > 0) //atleast 1 player in job
{ {
soapRenewLease($GLOBALS['gamesArbiter'], $jobid, 90); //add 1.50 min to the job $jobRenew = new RccServiceHelper($GLOBALS['gamesArbiter']);
$jobRenew->RenewLease($jobid, 90);
} }
$newping = $pdo->prepare("UPDATE open_servers SET lastPing = UNIX_TIMESTAMP() WHERE gameID = :g AND jobid = :j"); $newping = $pdo->prepare("UPDATE open_servers SET lastPing = UNIX_TIMESTAMP() WHERE gameID = :g AND jobid = :j");

View File

@ -1,5 +1,6 @@
<?php <?php
use Alphaland\Grid\RccServiceHelper;
use Alphaland\Web\WebContextManager; use Alphaland\Web\WebContextManager;
WebContextManager::ForceHttpsCloudflare(); WebContextManager::ForceHttpsCloudflare();
@ -17,10 +18,13 @@ $script = $data->script;
$output = ""; $output = "";
if (!isJobMarkedClosed($jobid)) if (!isJobMarkedClosed($jobid))
{ {
$output = soapExecuteEx($GLOBALS['gamesArbiter'], $jobid, "Execution From ACP", $script); $jobExecuteEx = new RccServiceHelper($GLOBALS['gamesArbiter']);
$jobExecuteEx->ExecuteEx(
$jobExecuteEx->ConstructGenericScriptExecute($jobid, "Execution From ACP", $script)
);
} }
if (!$output->faultstring && $script) //logging if (!$jobExecuteEx->faultstring && $script) //logging
{ {
$log = $GLOBALS['pdo']->prepare("INSERT INTO admin_job_execute_logs(userid, jobid, script, whenExecuted) VALUES (:uid, :jid, :script, UNIX_TIMESTAMP())"); $log = $GLOBALS['pdo']->prepare("INSERT INTO admin_job_execute_logs(userid, jobid, script, whenExecuted) VALUES (:uid, :jid, :script, UNIX_TIMESTAMP())");
$log->bindParam(":uid", $user->id, PDO::PARAM_INT); $log->bindParam(":uid", $user->id, PDO::PARAM_INT);
@ -29,4 +33,4 @@ if (!$output->faultstring && $script) //logging
$log->execute(); $log->execute();
} }
echo json_encode(array("result" => $output->faultstring)); echo json_encode(array("result" => $jobExecuteEx->faultstring));

View File

@ -6,6 +6,9 @@ Alphaland 2021
*/ */
//headers //headers
use Alphaland\Grid\RccServiceHelper;
header("Access-Control-Allow-Origin: https://www.alphaland.cc"); header("Access-Control-Allow-Origin: https://www.alphaland.cc");
header("access-control-allow-credentials: true"); header("access-control-allow-credentials: true");
@ -27,8 +30,9 @@ else
{ {
if ($shutdownserver) if ($shutdownserver)
{ {
//soapclosejob doesnt have any return data, so we set message to true //doesnt have any return data, so we set message to true
soapCloseJob($GLOBALS['gamesArbiter'],$jobid); $jobClose = new RccServiceHelper($GLOBALS['gamesArbiter']);
$jobClose->CloseJob($jobid);
$message = true; $message = true;
} }