Results 1 to 7 of 7

Thread: PHP send "status server"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #6
    Private First Class
    Join Date
    Dec 2012
    Posts
    127
    Thanks
    132
    Thanked 114 Times in 63 Posts
    @maxdamage99 You can always use API from services like game-monitor.

    I made an example in PHP:

    PHP Code:
    <?php

        ini_set
    "display_errors"false );

        
    //$host = "192.168.1.2";    // localhost
        //$port = 28960;
        
        
    $host "46.4.55.66";    // evil.High Jump CRACKED
        
    $port 28958;

        
    $serialized file_get_contents"http://module.game-monitor.com/$host:$port/data/server.php" );
        
    $json_data unserialize$serialized );
        
    $array = ( array )$json_data;
        
        if( 
    $array["error"] == )
        {
            
    $hostname $array["name"];
            
    $ip $array["ip"];
            
    $port $array["port"];
            
    $player $array["player"];
            
    $maxplayer $array["maxplayer"];
        
            
    $hostname "<pre>Hostname: $hostname</pre>";
            
    $ip "<pre>IP: $ip:$port</pre>";
            
    $players "<pre>Players: $player/$maxplayer</pre>";
        }
        else
        {
            
    $hostname "<pre>Server offline or wrong IP</pre>";
            
    $ip "<pre>IP: $host:$port</pre>";
        }

    ?>

    <html>
        <body>
            <?php echo $hostname?>
            <?php echo $ip?>
            <?php echo $players?>
        </body>
    </html>

  2. The Following User Says Thank You to Jeplaa For This Useful Post:

    kung foo man (15th May 2015)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •