addServers($servers);
// You can optionally specify some settings
$gq->setOption('timeout', 2); //in seconds
// Send requests, and parse the data
$results = $gq->process();
echo "
\n";
//iterate through each server
foreach ($results as $key => $server)
{
//the server is online and running
if ($server['gq_online'])
{
//use var_dump for testing
//http://php.net/var_dump
// var_dump($server);
echo "
Players sur le serveur ToX ( " . $server
['gq_numplayers'] . " )
\n";
if ($server['gq_numplayers'] > 0) //if there are players
{
echo "
";
echo "
";
echo "
";
echo date("H:i:s") . "
";
echo "
";
echo "
";
echo " " . $server['gq_numplayers'] . " Joueur(s) ☠ | Temps de jeu des joueurs connectés |
\n";
foreach ($server['players'] as $player)
{
echo "\n";
echo " survivant ".$player['gq_name']." | \n";
echo "".secondsToString($player['gq_time'])." | \n";
echo "
\n";
}
echo "
";
echo "
";
// include('./query-servers-live.php');
}
} else {
echo "
";
echo "
SERVER " . $key . " is down.
";
echo "";
exit();
}
}
// exit();
}
echo "
";
//exit();
?>