Exemple #1
0
 function _sendCommand($address, $port, $command, $timeout = 500000)
 {
     $data = parent::_sendCommand($address, $port, $command, $timeout);
     if (!$data) {
         return FALSE;
     }
     return $this->_sortByQueryId($data);
 }
Exemple #2
0
 /**
  * @brief Retrieves a serialized object via HTTP and deserializes it
  *
  * Useful if UDP traffic isn't allowed
  *
  * @param url the URL of the object
  * @return the deserialized object
  */
 function unserializeFromURL($url)
 {
     require_once 'includes/HttpClient.class.php';
     return gsQuery::unserialize(HttpClient::quickGet($url));
 }
Exemple #3
0
$info = new XIIIServerInfo();
$log = new LogFile();
?>
	<head>
		<title>XIII Web Masterlist</title>
		<META HTTP-EQUIV="Refresh" CONTENT="30">
		<link rel="icon" type="image/png" href="favicon.png" />
		<!--[if IE]><link rel="shortcut icon" type="image/png" href="favicon.png" /><![endif]-->
	</head>

<?php 
$count = 0;
$arrayquery = $info->GetServerArray();
// Make a test for each server.
foreach ($arrayquery as $row) {
    $gameserver = gsQuery::createInstance("gsqp", $row['SERVERIP'], $row['SERVERQUERY']);
    if ($gameserver && $gameserver->query_server(FALSE, FALSE)) {
        $hostname = $gameserver->htmlize($gameserver->hostname);
        $map = htmlentities($gameserver->mapname);
        $gamemode = htmlentities($gameserver->gametype);
        $gameclass = htmlentities($gameserver->gameclass);
        $mutator = htmlentities($gameserver->mutators);
        echo $row['SERVERIP'] . ":" . $row['SERVERPORT'] . ' - ' . $hostname . ' / ' . $info->Get_GameMode($gamemode, $gameclass, $mutator) . ' // ' . $info->Get_Map($map) . '(' . htmlentities($gameserver->numplayers) . '/' . htmlentities($gameserver->maxplayers) . ')<br />';
    } else {
        echo $row['SERVERIP'] . ":" . $row['SERVERPORT'] . '( No Beacon Received. Is the server down? )<br />';
    }
    $count++;
    $gameserver = NULL;
}
if ($count == 0) {
    echo "<strong>No server is currently running at the moment.</strong>";