From f69d44538ab8fead7b8672bf9aff10e16dba3a90 Mon Sep 17 00:00:00 2001 From: nolanwhy <69528856+nolanwhy@users.noreply.github.com> Date: Tue, 28 Mar 2023 09:01:05 +0200 Subject: [PATCH] again update --- core/classes.php | 30 ++++++++++++++++++++++++++++++ core/config.php | 34 ---------------------------------- 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/core/classes.php b/core/classes.php index 10a7132..f372ad0 100644 --- a/core/classes.php +++ b/core/classes.php @@ -12,6 +12,36 @@ require dirname(__DIR__).'/Assemblies/Roblox/Grid/Rcc/Status.php'; $RCCServiceSoap = new Roblox\Grid\Rcc\RCCServiceSoap($soapcfg["ip"],$soapcfg["port"]); // end soap +/** + * Name: Script Signer + * Description: This function returns the "rbxsig" signature and the script. + * Parameters: [ + * "script" => "The script to sign", + * "privatekey" => "Private key used to sign" + * ] +*/ +function scriptsign($script, $privatekey) { + $signature; + $script = "\n".$script; + openssl_sign($script, $signature, $privatekey, OPENSSL_ALGO_SHA1); + return "--rbxsig" . sprintf("%%%s%%%s", base64_encode($signature), $script); +} + +/** +* Name: Array Signer +* Description: This function returns the "rbxsig" signature and the array. +* Parameters: [ +* "array" => "The array to sign", +* "privatekey" => "Private key used to sign" +* ] +*/ +function arraysign($array, $privatekey) { + $signature; + $jsonarray = "\n".json_encode($array); + openssl_sign("\r\n" . $jsonarray, $signature, $privatekey, OPENSSL_ALGO_SHA1); + return "--rbxsig" . sprintf("%%%s%%%s", base64_encode($signature), $jsonarray); +} + function discordmsg($msg, $webhook) { if($webhook != "") { $ch = curl_init( $webhook ); diff --git a/core/config.php b/core/config.php index f2a9de6..0acd577 100644 --- a/core/config.php +++ b/core/config.php @@ -59,40 +59,6 @@ $site = [ "url" => "https://".$_SERVER["HTTP_HOST"] ]; -/** - * Name: Script Signer - * Description: This function returns the "rbxsig" signature and the script. - * Parameters: [ - * "script" => "The script to sign", - * "privatekey" => "Private key used to sign" - * ] -*/ -function scriptsign($script) { - global $gameSettings; - $privatekey = $gameSettings["privatekey"]; - $signature; - $script = "\n".$script; - openssl_sign($script, $signature, $privatekey, OPENSSL_ALGO_SHA1); - return "--rbxsig" . sprintf("%%%s%%%s", base64_encode($signature), $script); -} - -/** - * Name: Array Signer - * Description: This function returns the "rbxsig" signature and the array. - * Parameters: [ - * "array" => "The array to sign", - * "privatekey" => "Private key used to sign" - * ] -*/ -function arraysign($array) { - global $gameSettings; - $privatekey = $gameSettings["privatekey"]; - $signature; - $jsonarray = "\n".json_encode($array); - openssl_sign("\r\n" . $jsonarray, $signature, $privatekey, OPENSSL_ALGO_SHA1); - return "--rbxsig" . sprintf("%%%s%%%s", base64_encode($signature), $jsonarray); -} - //pagenam $pagename = ucwords(str_replace("_", " ", str_replace(".php", "", str_replace("/", " ", $_SERVER['DOCUMENT_URI'] ?? $_SERVER['PHP_SELF']))));