class IVMPQuery { var $socket = false; var $ip = false; var $port = false; function Query($ip,$port,&$errno,&$errstr,$timeout = 5,$gettimeout = 1) { $this->Close(); $this->ip = $ip; $this->port = $port; if($this->socket === false) return false; return true; } function Close() { if($this->socket !== false) { $this->socket = false; } } function GetPacketData($command) { $packet = 'IVMP'; $packet .= $command; return $packet; } function ServerData() { 'hostname' => $hostname, 'players' => $players, 'maxplayers' => $maxplayers, 'passworded' => (bool)$passworded ); } function ServerRules() { for($i = 0; $i < $count; $i++) { } return $arr; } function Players() { for($i = 0; $i < $count; $i++) { } return $arr; } // Default return is ms int. If $asfloat == true, will return as seconds and as a float function Ping($asfloat = false) { if(!$asfloat) { $time *= 1000; } if($reply == 'PONG') { return $time; } return false; } } $q = new IVMPQuery; if(!$q->Query('80.82.23.2',9999,$errno,$errstr,2)) { $status = "brak łączności"; } else { $status = "Info: $q->ServerData() <br />Zasady: $q->ServerRules() <br />Graczy: $q->Players() <br />Ping: $q->Ping()"; }
To wyświetla mi:
Info: ()
Zasady: ()
Graczy: ()
Ping: ()
Gdzieś popełniłem błąd przepisując kod?
$status ma być wykorzystywane w stylu (skryptu myBB).
Wszystko jest poprawnie niby, a napotykam to co w/w.
Adres: ivmpprojekt.cba.pl