Status Server for PSOBB Sites,Blogs,Forums.

legit nyck

Member
Code:
/*********************************************************************
*     SERVER STATUS FOR PSOBB GAME SERVER V1.2 - BY WHITHIL XBR      *
*     This code is intended to run in PHP from a windows machine     *
*     NOTE: The HTML in this PHP has some white text, because it     *
*           was created to be embedded in dark backgrounds. :D       *
**********************************************************************/

<?php
function GetServerStatus($site, $port) //nao mecha nisso
{ //nao mecha nisso
    $fp = @fsockopen($site, $port, $errno, $errstr, 0.01); //nao mecha nisso
    if (!$fp) { //nao mecha nisso
        echo '<font color="red">OFFLINE</font>'; // se nao conseguir conectar, marcar como OFFLINE
    } else //nao mecha nisso
        {
        echo '<font color="white">Nome do ship<br>', //troque "Nome do ship" pelo nome que voce quiser, obvio
            'Block 1: <font color="yellow"><b>';
        $a = @shell_exec('netstat -a -n | find "TCP    XX.XXX.XX.XXX:YYYY" | find /C "ESTAB"');
        echo $a; //SUBSTITUA "XX.XXX.XX.XXX:YYYY" PELO IP E PORTA DO BLOCO 1 (O IP DO VPS)
        echo '</font></b><br><font color="white">', 'Block 2: <font color="yellow"><b>';
        $b = @shell_exec('netstat -a -n | find "TCP    XX.XXX.XX.XXX:YYYY" | find /C "ESTAB"');
        echo $b; //SUBSTITUA "XX.XXX.XX.XXX:YYYY" PELO IP E PORTA DO BLOCO 2 (O IP DO VPS)
        echo '</font></b><br/><br/>Total players: ';
        $z = $a + $b; //soma o numero de jogadores dos dois ships
        echo $z; //mostra o resultado da soma
        echo '<font color="white"><br/><br/>', 'Current status: ';
        $c = @shell_exec('netstat -a -n | find ":3389" | find /C "ESTABLISHED"'); //ESSA LINHA VERIFICA SE TEM ALGUEM CONECTADO NO MSTSC
        if ($c > 0) {
            echo '<font color="Orange">Maintenance</font> '; //SE TEM ALGUEM CONECTADO NO MSTSC MOSTRAR MODO MANUTENCAO
        } else {
            echo '<font color="Green">Normal</font> '; //SE NAO, MOSTRAR COMO NORMAL
        }
    }
}
GetServerStatus('localhost', 5281); //loopback para localhost e porta do servidor (ship.ini MAIN PORT) para checagem de status como ONLINE ou Offline. Mude apenas a porta! (pode ser a porta do bloco 1 se tiver duvida)
?>

Use the translator case you need
Is this a free code made by Whithil XBR for the Legits and to nothers servers.
 

legit nyck

Member
Smokey said:
There's a much easier way of doing this and takes a lot less code to achieve.
then show us... long asked for help to get these codes and all you got was a broken code, thanks to the WHITHIL XBR now that code is accessible to all and it works perfectly, even so I'd like to see that their simplified version :cool:
 
Top