[cod] PHP Scripts for server infos!

Johannes Heinsoo johu002 at gmail.com
Tue Dec 4 11:51:36 EST 2007


Key elements from mu class made for communication with servers.

$connection = fsockopen("udp://".$'ip, $port, $errno, $errstr, $timeout);
if ($errstr) {blah();}
fwrite($connection, "ÿÿÿÿ". chr (0x02). "getstatus". chr (0x00));
fread($connection, 4);
do {
   $ef .= fread($this->connection, 1);
   $status = socket_get_status($connection);
}
while($status["unread_bytes"] != 0);
fclose($connection);
echo $ef;

I buffer querry info in MySQL. Output is used here 
http://cod.silo.pri.ee/serverid.php

Kind regards,
Johannes Heinsoo
callofduty.ee ( Not ready yet )


André Valentin wrote:
> Hello,
>  
> I am having problems getting gameserver informations trough my usual 
> PHP script i used for cod2 etc.
> Any links or suggestions for how to retrive these infos? (hostname, 
> players etc etc.)
>  
> Kind regards
> André Valentin
> SpeedGaming.dk




More information about the Cod mailing list