+ Reply to Thread
Results 1 to 5 of 5

Thread: Server Online/Offline Indicator

  1. #1
    matfor1 is offline x10Hosting Member matfor1 is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    54

    Server Online/Offline Indicator

    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-ho...s-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
    A Newbie @ x10?
    TRY THIS THREAD for everything you need to know about x10's free hosting account set up, config & procedures!

  2. #2
    NexterCM is offline x10Hosting Member NexterCM is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    26

    Re: Server Online/Offline Indicator

    I would suggest trying something along the lines:
    http://us2.php.net/manual/en/function.fsockopen.php

  3. #3
    masshuu's Avatar
    masshuu is offline Head of the Geese masshuu has a spectacular aura about
    Join Date
    Oct 2007
    Location
    Las Colinas, Tx
    Posts
    2,262

    Re: Server Online/Offline Indicator

    PHP Code:
    function SiteOnlineSocket($HOST,$PORT)
     {
      
    //returns true if online
      
    $Socket = @socket_create(AF_INETSOCK_STREAMSOL_TCP);

      if(@
    socket_connect($Socketgethostbyname($HOST), $PORT))
      {
       @
    socket_close($Socket);
        return 
    true;
      } else {
        return 
    false;
      }
     } 
    Last edited by masshuu; 11-08-2007 at 05:41 PM.

  4. #4
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Server Online/Offline Indicator

    Almost right, but almost any game server would run on UDP.

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  5. #5
    masshuu's Avatar
    masshuu is offline Head of the Geese masshuu has a spectacular aura about
    Join Date
    Oct 2007
    Location
    Las Colinas, Tx
    Posts
    2,262

    Re: Server Online/Offline Indicator

    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.

+ Reply to Thread

Similar Threads

  1. Server consolidation and move
    By Corey in forum News and Announcements
    Replies: 36
    Last Post: 09-04-2007, 02:37 AM
  2. Internal Server Error
    By thecarver in forum Free Hosting
    Replies: 3
    Last Post: 11-22-2006, 01:04 AM
  3. Is the server indicator correct?
    By jensen in forum Free Hosting
    Replies: 3
    Last Post: 07-11-2006, 06:55 AM
  4. PHP Server Status.
    By Nathan in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 07-12-2005, 08:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers