error_reporting(E_ALL ^ E_WARNING);
    socket_recvfrom($sock, $input, 80000, 0, $from, $p);
    if (strlen($input)) {
        if ($flag == 0) {
            echo '<table>' . "\n";
            echo "<tr>\r\n\t\t\t\t\t\t\t\t<th>IP</th>\r\n\t\t\t\t\t\t\t\t<th>Hostel</th>\r\n\t\t\t\t\t\t\t\t<th>Server Name</th>\r\n\t\t\t\t\t\t\t\t<th>Map</th>\r\n\t\t\t\t\t\t\t\t<th>Players</th>\r\n\t\t\t\t\t\t\t\t<th>Password</th>\r\n\t\t\t\t\t\t\t\t<th></th>\r\n\t\t\t\t\t\t\t</tr>";
        }
        $flag = 1;
        $server->s_info['info'] = $input;
        $srv_rules = $server->getrules($csdir);
        $srv_rules['map'] = $csdir . $srv_rules['map_path'] . '/' . $srv_rules['mapname'] . '.jpg';
        if (!file_exists($srv_rules['map'])) {
            // set default map if no picture found
            $srv_rules['map'] = $csdir . $srv_rules['map_path'] . '/' . $srv_rules['map_default'];
        }
        $srv_rules['hostel'] = hostel::query_srv($srv_rules['gameip']);
        // get server hostel / location
        srv_info($srv_rules);
    }
}
if ($flag == 0) {
    echo "No Server Running";
}
//echo $i;
socket_close($sock);
?>
			</div>
			<div id="footer">
				<?php 
echo '<a href="http://10.9.20.205" target="_blank">Hosted by Tachyon</a><br/><font color="' . '#hwiuh' . '"> 10.9.20.205 </font>' . '<br/><a href="http://saketsaurabh.co.cc/" target="_blank">saketsaurabh.co.cc</a>';
?>
Exemplo n.º 2
0
  	<div>
        <div id="wrapper">
            <div id="header">
				<img src="images/logo.png"/>
            </div>
            <div id="navigation">
                <a href ="index.php">Scan Lan</a><a href ="ping.html">Ping a Server</a><a href ="rcon.php">Control a Server</a>
            </div>
            <div id="ping">
    <?php 
define('CSDIR', './');
$csdir = CSDIR;
$host = $_REQUEST['ip'];
include_once CSDIR . 'hostel.class.php';
include_once CSDIR . 'info.php';
$hostel = hostel::query_srv($host);
function info($csdir, $host, $hostel)
{
    $stats =& new info();
    $server = $stats->getstream($host, 27015, 27005);
    if ($server === true) {
        $srv_rules = $stats->getrules($csdir);
        $srv_rules['playerlist'] = $stats->getplayers();
        //$stats->getsettings();
        //$srv_rules['rules'] = $stats->getrules();
        // full path to the map picture
        $srv_rules['map'] = $csdir . $srv_rules['map_path'] . '/' . $srv_rules['mapname'] . '.jpg';
        if (!file_exists($srv_rules['map'])) {
            // set default map if no picture found
            $srv_rules['map'] = $csdir . $srv_rules['map_path'] . '/' . $srv_rules['map_default'];
        }