Author Topic: Server Status checker  (Read 12361 times)

Offline jan0s1k

  • If it bleeds we can kill it...
    • Chosen Soldiers
Re: Server Status checker
« Reply #15 on: July 01, 2013, 12:45:25 pm »
It's still working  ::)


Re: Server Status checker
« Reply #16 on: July 01, 2013, 12:49:04 pm »
Strange, it doesn't let me connect to your site only with proxy. Maybe its blocked by isp :/

Offline Wipe

  • Rotator
  • Random is god
Re: Server Status checker
« Reply #17 on: July 01, 2013, 01:01:55 pm »
You can check this one, but it does not include graphic generation (yet).
Games are meant to be created, not played...

Re: Server Status checker
« Reply #18 on: July 01, 2013, 02:56:21 pm »
Quote
Parse error: syntax error, unexpected T_DNUMBER, expecting T_STRING or T_VARIABLE or '{' or '$' in /home2/dayzroma/public_html/FOnlineServer.php on line 45


Quote
$this->Test = $name;
$this->71.113.37.17 = $host;
$this->4000 = (int)$port;

Where did I go wrong?

Offline Wipe

  • Rotator
  • Random is god
Re: Server Status checker
« Reply #19 on: July 01, 2013, 03:38:35 pm »
Simplest way goes like this:

Code: (php) [Select]
include( 'FOnlineServer.php' );

$server = new FOnlineServer();
$server->Setup( "FOnline Server Name", "fonline.example.com", 4000 );
$server->Ping();

...php does its work...

Code: (php) [Select]
if( $server->Status == FOnlineServer::ONLINE )
{
   echo $server->Name . ' is online, players: ' . $server->Players . ', uptime: ' . $server->Uptime;
}
else
{
   echo $server->Name . ' is dead or dying';
}

You can easily assume that if $server->Players is less than 0, then server is offline; be also warned, that timeout for connecting and reading data is set to very minimal values (5s for both), so you may want to increase it. Here example with 15s for connection and 30s for receiving data.
Code: (php) [Select]
$server->Ping( 15, 30 );
Games are meant to be created, not played...

Offline wladimiiir

  • Rotator
  • Independent FOnline developer
Re: Server Status checker
« Reply #20 on: July 01, 2013, 03:50:16 pm »
I guess his problem is that host 71.113.37.17 is treated like a number not like a string in PHP. I am not very PHP familiar, but that seems to be what his error says.

Try using "71.113.37.17" instead of 71.113.37.17, if you are doing so.

Re: Server Status checker
« Reply #21 on: July 01, 2013, 03:58:54 pm »
I will try again later and let you know how it went.

Offline Cpt.Rookie

  • The final act is mine
    • riget.info
Re: Server Status checker
« Reply #22 on: July 01, 2013, 04:35:22 pm »
The other option (without need of having own checking scripts) is to use links (column "link to status as text") at http://riget.info/index.php?page=fonlineProjects, i.e.

http://riget.info/check/tlamk2/?t
http://riget.info/check/requiem/?t
http://riget.info/check/fode/?t
http://riget.info/check/gh/?t
Server-Boy - FOnline servers statistics
pcntl_wait($status); //protect against zombie children
postCount++;