Where to find the Server Status?

Results 1 to 3 of 3
  1. #1
    Novice anonym110 is offline
    MemberRank
    Aug 2011 Join Date
    3Posts

    Where to find the Server Status?

    Hello, I'm setting up a website for my server but I just dont know how to have the server status show. You know like
    GameServer: ONLINE
    LoginServer: ONLINE

    I would be thankful if somebody could tell me what to do to get it return online/offline.



    Thanks a lot,
    anonym110


    //I tried accessing the ip:port from the gameserver and it keeps loading when the server is on. If the server is off it just says no connection. So I think thats the solution, but how can I make the website check it?


  2. #2
    Proficient Member Flowan is offline
    MemberRank
    Sep 2006 Join Date
    197Posts

    Re: Where to find the Server Status?

    Create a php file and add this code:
    Code:
    <?php
    // change the ip address
    $sLoginServerIp = "69.64.37.156";
    $sGameServerIp = "69.64.37.156";
    
    function checkStatus($sAddress,$iPort){
    	if(!$sock = @fsockopen($sAddress, $iPort, $num, $error, 5)){
    		return 'Offline';
    	}else{
    		return 'Online';
    		fclose($sock);
    	}
    }
    
    echo 'Login: '.checkStatus($sLoginServerIp,2106);
    echo '<br />Game: '.checkStatus($sGameServerIp,7777);
    Only thing you have to change is the ip address.

  3. #3
    Novice anonym110 is offline
    MemberRank
    Aug 2011 Join Date
    3Posts

    Re: Where to find the Server Status?

    Thank you, works perfectly :)



Advertisement