Server Status

Results 1 to 5 of 5
  1. #1
    Member Misonia is offline
    MemberRank
    Nov 2008 Join Date
    77Posts

    Server Status

    Like 2 months ago i asked a question but noone answered

    How to set up server status on my website?

    The one that would shop up how many players are online atm, how many accounts registered on the server, and the stat saying if server is online or offline

    Please answer

    Thx in advance


  2. #2

    Re: Server Status

    well theres a script that already has the "server stat" page, this requires PHP knowledge

    its already made, "exept the number of accs registered on the server part"

    thats pretty easy though, anyways below is the script by trash along time ago it still works great, it will display number of usesrs online, and server status. modify it to your mysql server if your running the site on the same server leave local host alone, if it doesnt work change local host to 127.0.0.1 because you most likely dont have localhost defined in the hosts file.

    to add the file, add it to your www location in ur server. change .txt to .php and save then your done.
    Attached Files Attached Files
    Last edited by softsoldier; 21-06-11 at 03:06 AM.

  3. #3
    Member Misonia is offline
    MemberRank
    Nov 2008 Join Date
    77Posts

    Re: Server Status

    Thx a lot!

    <3

  4. #4

    Re: Server Status

    np good luck

  5. #5
    [B]aSH nofxpunkerbrian is offline
    MemberRank
    Apr 2009 Join Date
    1,151Posts

    Re: Server Status

    PHP Code:
    <?
    $CountOnlineUsersQuery 
    MySQL_Query("SELECT uid from point where zoneid>-1");
    $CountUsers 0;
    WHILE (
    $UserRows MySQL_Fetch_Array($CountOnlineUsersQuery)) {
    $CountUsers++;
    }
    $CountAccounts 0;
    $CountAccountsQuery Mysql_Query("SELECT ID from users where ID>-1");
    WHILE (
    $AccountRows MySQL_Fetch_Array($CountAccountsQuery)) {
    $CountAccounts++;
    }
    $ServerIP "IP HERE";  // IP your PW Server 
    $ServerPort "PORT HERE";  // Port your PW Server
    $Sockres = @FSockOpen($ServerIP$ServerPort$errno$errstr1);
    if (!
    $Sockres) {
    $Count 0;
    $Status "<font color=red>Offline</font>";    

    else {
    @
    FClose($Sockres);
    $Status "<font color=green>Online</font>";
    }
    echo
    "
    <b>Server:</b> 
    $Status <br>
    <b>Users Online:</b> 
    $CountUsers <br>
    <b>Accounts:</b> 
    $CountAccounts <br>
    <br>
    <b>Rates:</b><br>
    <b>Exp:</b> x9999 <br>
    <b>SP:</b> x9999 <br>
    <b>Drop:</b> x9999 <br>
    <b>Gold:</b> x9999 <br>"
    ;
    ?>



Advertisement