Server Online/Offline Indicator

matfor1

New Member
Messages
54
Reaction score
0
Points
0
Not certain this is the right forum, but I was wondering if someone could help.

I'm currently running vwar (not on x10 atm, I'm suspended) and I have links to my Dedicated Game Server.

The game is Deus Ex (old, based on Unreal 1 engine), and the link (tested: works) is deusex://ftf.servegame.com which is a domain I have linked to my dynamic IP using no-ip.

Basically what I need is something (maybe a php script.. I have no idea) which will test to see if the server is online or offline, and return either a text value or an image etc.

Much like this thread: http://forums.x10hosting.com/free-hosting/13706-x10hosting-services-up-down.html

If someone could either help me to write something like this, or point me in the right direction to get a script that will do it for me, I'd really appreciate it.

I'm attempting to build up all the stuff I need for my site, so I can upload it and it will all work perfectly in a few days time when I'm unsuspended.

Thanks very much for reading :)
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
PHP:
function SiteOnlineSocket($HOST,$PORT)
 {
  //returns true if online
  $Socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP);

  if(@socket_connect($Socket, gethostbyname($HOST), $PORT))
  {
   @socket_close($Socket);
    return true;
  } else {
    return false;
  }
 }
 
Last edited:

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Almost right, but almost any game server would run on UDP.
 

masshuu

Head of the Geese
Community Support
Enemy of the State
Messages
2,293
Reaction score
50
Points
48
hahaha. any... change SOL_TCP to SOL_UDP if you need to then.
My game server uses tcp, i would conisder using icp if it went 3d.

little details.
 
Top