Parašė WyPuk· 2009 Bal. 13 09:04:10
#58
<?php
openside_panel("Server Status");
error_reporting(0);
$IP = array(
"<b>Login: </b>" => "ip:9014",
"<b>Game: </b>" => "ip9:7777",
);while(list($ServerName,$Host)=each($IP)) {
list($IPAddress,$Port)=explode(":",$Host);
echo($ServerName);
$time = 0;
$time = round(microtime(), 3);
if($fp=fsockopen($IPAddress,$Port,$ERROR_NO,$ERROR_STR,(float)0.5)) {
$time2 = round(microtime(), 3);
$ping = ($time2 - $time)*100;
echo("<font color='green'> Online</font> (ping: ".$ping."ms)<br />");
fclose($fp);
}else {
echo ("<font color='red'> Offline</font>");
}
}
echo "</b>";
closeside_panel;
?>
Išbandyk.