コード例 #1
0
ファイル: gameSpy.php プロジェクト: Ch0wW/xiii-weblist
 function _sendCommand($address, $port, $command, $timeout = 500000)
 {
     $data = parent::_sendCommand($address, $port, $command, $timeout);
     if (!$data) {
         return FALSE;
     }
     return $this->_sortByQueryId($data);
 }
コード例 #2
0
ファイル: gsQuery.php プロジェクト: Ch0wW/xiii-weblist
 /**
  * @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));
 }
コード例 #3
0
ファイル: index.php プロジェクト: Ch0wW/xiii-weblist
$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>";