diff --git a/core/classes.php b/core/classes.php index b7c86aa..a01eac8 100644 --- a/core/classes.php +++ b/core/classes.php @@ -1,6 +1,8 @@ prepare("UPDATE users SET lastPaid=:date WHERE id=:id"); $q->bindParam(':id',$_SESSION['user'],PDO::PARAM_INT); + $time = time(); $q->bindParam(':date',$time,PDO::PARAM_INT); $q->execute(); diff --git a/core/classes/RCCServiceSoap.php b/core/classes/RCCServiceSoap.php new file mode 100644 index 0000000..6b53949 --- /dev/null +++ b/core/classes/RCCServiceSoap.php @@ -0,0 +1,74 @@ +ip = $ip; + $this->port = $port; + $this->url = $url; + } + + function request($xml) { + $curl = curl_init('http://'.$this->ip.':'.$this->port.'/'); + curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: text/xml")); + curl_setopt($curl, CURLOPT_POST, true); + curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); + $result = curl_exec($curl); + $luashit = array("LUA_TSTRING", "LUA_TNUMBER", "LUA_TBOOLEAN", "LUA_TTABLE"); + $result = str_replace($luashit, "", $result); + $almost = strstr($result, ''); + $luashit = array('', "", "", "", "", "", "", "", "", "", "", ""); + $result = str_replace($luashit, "", $almost); + + return $result; + } + + function execScript($script, $jobId, $jobExpiration) { + /*$luashit = array("LUA_TSTRING", "LUA_TNUMBER", "LUA_TBOOLEAN", "LUA_TTABLE"); + $result = str_replace($luashit, "", $script); + $almost = strstr($result, ''); + $luashit = array('', "", "", "", "", "", "", "", "", "", "", ""); + $script = str_replace($luashit, "", $almost);*/ + + $xml = ' + + + + + '.$jobId.' + '.$jobExpiration.' + 1 + 321 + + + Script + + '.$script.' + + + + + '; + + return $this->request($xml); + } + + function isRccOn() { + $script = 'return "Hello World!"'; + if(empty($this->execScript($script, "isRccOnCheck".rand(1,getrandmax()), 10))) { + return false; + } else { + return true; + } + } +} \ No newline at end of file diff --git a/core/config.php b/core/config.php index c20ba4f..248f5bc 100644 --- a/core/config.php +++ b/core/config.php @@ -21,8 +21,8 @@ if($devmode) { // if ur gonna use the availablegameservers array please pick a random gameserver from the array or else we would put all stress on 1 gameserver $AvailableGameservers = [ - 1 => "ip goes here", - 2 => "ahh help!!" + "ip goes here", + "ahh help!!" ]; $gameSettings = [ @@ -31,6 +31,14 @@ MIICXQIBAAKBgQDhO7uhMz3jBLoSB/SHWhnE5tVxn7P6BlirPVrZEWVUxjyC5ybhZpyjL/r6KBlvhgyn -----END RSA PRIVATE KEY-----" ]; +$soapIp = $AvailableGameservers[array_rand($AvailableGameservers,1)]; + +$soapcfg = [ + "ip" => $soapIp, + "port" => 64989, + "url" => "sierraf.tk" +]; + $site = [ "url" => "https://".$_SERVER["HTTP_HOST"] ];