SMS platby problém

Technická podpora k herním serverům Minecraft a Tekkit
Message
Autor
Vencavajco
Příspěvky: 51
Registrován: 19 srp 2012, 02:09
Reputation: 0

SMS platby problém

#1 Příspěvekod Vencavajco » 10 lis 2012, 12:37

Zdravím,

potřeboval bych poradit nevím si už rady :( všechno co mě napadlo sem zkusil a nic nejde. Od té doby co jsou nové tvary SMS tak mi nejdou správně, hráč pošle SMS ale VIP se mu samo nenahodí! A já nemám tolik času abych každý den sledoval Email jestli někdo poslal peníze. Fungovalo to tak, že hráč poslal SMS a hned do minuty se mu nahodilo VIP.
Mám to dělané přes scirpt


Prosím o pomoc

Děkuji

Spoiler: zobrazit
<?php
$obsahSouboru = '<?php
// AUTOREM JE m_pro_m, webmaster Minecraft serveru http://www.mineforlife.eu
// Tento script byl uvolnen pro hosting fakaheda.eu s jeho svolenim
$server = "93.91.250.109";
$port = 26076;
$heslo = "Tady kdysi bývalo heslo. Teď je zakryto";

/////////////////////////////////////////
//PREBRANI DAT Z HOSTINGU, NEUPRAVOVAT!//
/////////////////////////////////////////

$sms = $_GET["sms"];
$time = $_GET["time"];
$credit = $_GET["credit"];
$player = $_GET["customer_text"];

if(empty($sms) || empty($time) || empty($credit)) { die("Error"); }

/*
if($_SERVER["REMOTE_ADDR"] != "217.11.249.85")
{
die("Error");
}

*/
///////////////////////////////////////////////////////////////////////
//NASTAVENI PRIKAZU PRO PRISLUSNE CENOVE HLADINY, UPRAVTE DLE POTREBY//
///////////////////////////////////////////////////////////////////////

$commands = array();

/*
$commands[] = "say sms:".$sms;
$commands[] = "say time:".$time;
$commands[] = "say credit:".$credit;
$commands[] = "say player:".$player;
*/


if(preg_match("~27076~",$sms))
{
list($_,$druhaCastSMS) = explode("27076",$sms,2);
list($prikaz,$hrac) = explode(" ",trim($druhaCastSMS),2);

$prikaz = strtolower($prikaz);

//$commands[] = "say prikaz:".$prikaz."| hrac:".$hrac;

switch($credit) {

// SMS PLATBA 499 CZK / 20 EUR
case 335:
$commands[] = "pex user ".$player." group set Sponzor";
$commands[] = "say Hrac ".$player." si koupil Sponzora!";

// POD SEBE MUZETE VLOZIT LIBOVOLNY POCET RADKU S PRIKAZAMA
break;

// SMS PLATBA 249 CZK / 10 EUR
case 165:
$commands[] = ""; // DOPLNTE PRIKAZY DLE POTREBY
break;

// SMS PLATBA 199 CZK / 8 EUR
case 130:
$commands[] = "pex user ".$player." group set ExtraVIP";
$commands[] = "say Hrac ".$player." si aktivoval ExtraVIP!";
break;

// SMS PLATBA 149 CZK / 6 EUR
case 95:
$commands[] = ""; // DOPLNTE PRIKAZY DLE POTREBY
break;

// SMS vip 99 CZK / 4 EUR
case 49:
$commands[] = "pex user ".$player." group set VIP";
$commands[] = "say Hrac ".$player." si aktivoval VIP!";
break;

// SMS vip 79 CZK / 3.2 EUR
case 39:
$commands[] = ""; // DOPLNTE PRIKAZY DLE POTREBY
break;

// SMS vip 50 CZK / 2 EUR
case 23:
if($prikaz == "drevorubec")
$commands[] = ""; // DOPLNTE PRIKAZY DLE POTREBY
break;

// SMS vip 30 CZK / 1.2 EUR
case 13:
$commands[] = ""; // DOPLNTE PRIKAZY DLE POTREBY
break;

// SMS vip 20 CZK / 0.8 EUR
case 8:
$commands[] = ""; // DOPLNTE PRIKAZY DLE POTREBY
break;

// SMS vip 10 CZK / 0.4 EUR
case 3.5:
//prikazy
break;

// pokus
case 1:
$commands[] = "say pokusna sms";
break;

}
}
else
{
$commands[] = "say pokusna sms";
}


define("SERVERDATA_EXECCOMMAND",2);
define("SERVERDATA_AUTH",3);

class RCon {
var $Password;
var $Host;
var $Port = 27015;
var $_Sock = null;
var $_Id = 0;

function RCon ($Host,$Port,$Password) {
$this->Password = $Password;
$this->Host = $Host;
$this->Port = $Port;
$this->_Sock = @fsockopen($this->Host,$this->Port, $errno, $errstr, 30) or
die("Unable to open socket: $errstr ($errno)");
$this->_Set_Timeout($this->_Sock,2,500);
}

function Auth () {
$PackID = $this->_Write(SERVERDATA_AUTH,$this->Password);

// Real response (id: -1 = failure)
$ret = $this->_PacketRead();
//var_dump($ret);
if ($ret[0]["ID"] == -1) {
return false;
}
return true;
}

function _Set_Timeout(&$res,$s,$m=0) {
if (version_compare(phpversion(),"4.3.0","<")) {
return socket_set_timeout($res,$s,$m);
}
return stream_set_timeout($res,$s,$m);
}

function _Write($cmd, $s1="", $s2="") {
// Get and increment the packet id
$id = ++$this->_Id;

// Put our packet together
$data = pack("VV",$id,$cmd).$s1.chr(0).$s2.chr(0);

// Prefix the packet size
$data = pack("V",strlen($data)).$data;

// Send packet
fwrite($this->_Sock,$data,strlen($data));

// In case we want it later we"ll return the packet id
return $id;
}

function _PacketRead() {
//Declare the return array
$retarray = array();
//Fetch the packet size
while ($size = @fread($this->_Sock,4)) {
$size = unpack("V1Size",$size);
//Work around valve breaking the protocol
if ($size["Size"] > 4096) {
//pad with 8 nulls
$packet = "x00x00x00x00x00x00x00x00".fread($this->_Sock,4096);
} else {
//Read the packet back
$packet = fread($this->_Sock,$size["Size"]);
}
array_push($retarray,unpack("V1ID/V1Response/a*S1/a*S2",$packet));
}
return $retarray;
}

function Read() {
$Packets = $this->_PacketRead();
foreach($Packets as $pack) {
if (isset($ret[$pack["ID"]])) {
$ret[$pack["ID"]]["S1"] .= $pack["S1"];
$ret[$pack["ID"]]["S2"] .= $pack["S1"];
} else {
$ret[$pack["ID"]] = array(
"Response" => $pack["Response"],
"S1" => $pack["S1"],
"S2" => $pack["S2"],
);
}
}
return $ret;
}

function sendCommand($Command) {
//$Command = """.trim(str_replace(" ","" "", $Command)).""";
//$Command="stop";
$this->_Write(SERVERDATA_EXECCOMMAND,$Command,"");
}

function rconCommand($Command) {
$this->sendcommand($Command);

$ret = $this->Read();

//ATM: Source servers don"t return the request id, but if they fix this the code below should read as
// return $ret[$this->_Id]["S1"];
return $ret[$this->_Id]["S1"];
}
}


//////////////////////////////
//RCON CAST, NEUPRAVOVAT!!!!//
//////////////////////////////
$r = new rcon($server,$port,$heslo);
if($r->Auth())
{

// Spusti prikaz / sekvenci prikazu
foreach($commands as $command)
$r->rconCommand($command);
}
?>';
file_put_contents('statistika-psu.php',$obsahSouboru);
?>
;
}
?
Obrázek Pokud ti někdo pomohl, neváhej a dej mu + karmu

Uživatelský avatar
Welton123
Příspěvky: 2388
Registrován: 08 úno 2012, 17:54
Reputation: 0
Kontaktovat uživatele:

Re: SMS platby problém

#2 Příspěvekod Welton123 » 10 lis 2012, 13:07

HESLO !!!!!!!!!!

//EDIT: Zakryto. Doporučuji změnit. //nejento
CZ/SK TOP Databáze MineCraft Serverů ►KLIK◄
Chceš i Ty mít měnící se podpis? ►KLIK◄


Zpět na „Minecraft, Tekkit“

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 52 hostů