   Testing to see if a game server is "alive".
  I am currently hosting a Half-Life game server. I have a website for the server and I would like to have a part of the website show if the server is live or not (it should prove useful if/when we add more servers). I tried using a Java applet to do it by pinging the server, but, please correct me if I'm wrong, it doesn't seem low-level enouguh to test the specific port that I wish to test. Also, I don't think I'd know what to do with the access to the port to test if the server is up anyways.I assumed Java would be good because applets could embed. I have some knowlege of PHP and C++, but I doubt either of those would work well. Is there a specific language or library for dealing with these things?Anyways, if anyone has an idea on how to approach this problem then I would be grateful to hear your suggestions and/or knowlege.(I apologize for my incredible ignorance in the matters of networking, but I do really want to learn.)   
 I'll tell you that there is a special port on Half-Life that allows 3rd parties to interface with servers. I don't know what it is, but I do know that the initial incarnations of PunkBuster back in the CS beta days took advantage of it to work with the server because they hadn't come to integrate punkbuster into the Half-Life engine yet at that time. I am not sure if that carried over into Half-Life 2 though. The next step is doing what server browsers do, and asking the server for a game into snapshot.. If it replies with players, mapname, etc then it's alive. That is done on the normal game port. Programs like GameSpy have been using that concept since the days of Quake1 and QuakeWorld.. I'm not sure where you would read up on that, google may help. If I had no clue what to do, I'd use a packet sniffer and just figure it out myself I guess. hardcore is as hardcore does. :/   ;  I guess I'll Google packet sniffer then, because I didn't know very well what to Google before. Thank you.   ;Quote:Original post by pbjgameI am currently hosting a Half-Life game server. I have a website for the server and I would like to have a part of the website show if the server is live or not (it should prove useful if/when we add more servers). I tried using a Java applet to do it by pinging the server, but, please correct me if I'm wrong, it doesn't seem low-level enouguh to test the specific port that I wish to test.Java is just fine. Java applets run on user's machine, and by default inside a very strict sandbox. It's possible to configure an applet to request higher privileges. But such ad-hoc queries are not desirable, use a central service that checks status of servers, and have your applications talk to that, rather than servers directly.Quote:I'd use a packet sniffer and just figure it out myself I guess. hardcore is as hardcore does. Perhaps someone has done it already, and A2A_PING might work.   ;Quote:Original post by pbjgameI assumed Java would be good because applets could embed. I have some knowlege of PHP and C++, but I doubt either of those would work well. Is there a specific language or library for dealing with these things?I don't think you want to do this in Java. If you do it Java, in a applet embedded in the browser, that means that every person who views your "status" page would be requesting the status from your game server. If your game is popular, you could have hundreds of requests per second to that server.If, on the other hand, you did the "is the server alive?" request from your webserver (in PHP, say) then you can just do it once every five minutes or whatever and cache the result for each browser request. That way your game server isn't get swamped with "are you alive?" requests every second.   