Register for your free account! | Forgot your password?

You last visited: Today at 06:28

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Server status

Discussion on Server status within the CO2 Programming forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
LordGragen.'s Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 606
Received Thanks: 68
Server status

I am learning php so i dont know much yet but this question might be easy for you guys.


Code:
if (!$socket = @fsockopen("25.206.182.32", 5816, $errno, $errstr, 30))
{
  echo "<font color='red'><strong>Offline!</strong></font>";
}
else 
{
  echo "<font color='green'><strong>Online!/strong></font>";
  

  fclose($socket);
}
is this rly bad way show the server status?

i tried with my localhost (127.0.0.1) (80) it was working fast

but when i tried with the hamachi ip and the port it was taking so long and then not even loading the whole website.

any suggestion how i should control the status?
LordGragen. is offline  
Old 01/09/2014, 00:25   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
TQ has it so the php website cycles through the servers every once and a while and changes a simple text file. Then, requests to see if the server is online or not goes through that file, instead of pinging each server repetitively for each person accessing the website. The file used to be located at the root of their website, "status.php". It was changed to "server.co.91.com" which now returns "Bad Gateway".

Quoting myself from the CO2 Underground (since it is my own released information), here's the structure of TQ's old file that the old clients use in their server checks:
Quote:
The Conquer Online client has a server status check in the login screen next to the selected server. You can change the check to show the status of your server by opening "common.ini" and changing ServerStatus. The php file being read is composed as text. There are no html or xml elements. Each line contains the server name and the server status. The server name is a string. The server status is represented as an unsigned integer (ranging from 0 to 3). 0 is "Down", 1 is "Overloaded", 2 is "Busy", and 3 is "Online".
Spirited is offline  
Thanks
1 User
Old 01/13/2014, 02:03   #3
 
elite*gold: 0
Join Date: May 2011
Posts: 648
Received Thanks: 413
Also, you could do it with jscript async, so it wont block the loading of your site. Plus a timeout of lets say 200ms should be sufficient for a ping packet..
Y u k i is offline  
Old 01/13/2014, 03:11   #4
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
You really shouldn't open a connection to the server from the website at anytime.

If anything have it either updating a textfile and if the file wasn't modified within a specific timespan eg. 15 seconds then the server is offline.

Or do the same princip but using a database ex. MySQL, MSSQL etc.

It will leave connection overloads out for the server.

Quote:
Originally Posted by Y u k i View Post
Also, you could do it with jscript async, so it wont block the loading of your site. Plus a timeout of lets say 200ms should be sufficient for a ping packet..
I know it probably wouldn't be a problem with a pserver, but let's say he has a traffic of 1000 people at on his website and it keeps pinging every 200 ms.

That would be 5000 connections done every second to the server and not even a legit logged in client.
Super Aids is offline  
Thanks
1 User
Old 01/13/2014, 07:42   #5


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Or just set up a client socket in the server itself and send an "I`m alive" packet to your PHP or Node.js or whatever server.
KraHen is offline  
Reply


Similar Threads Similar Threads
Reg Page Edited Server Status + Extra Status
08/26/2012 - SRO Coding Corner - 22 Replies
This is a new realease of the reg page created by Xsense Download XAMP apache friends - xampp for windows Reg Page Files (By Tazdingo And Xsense) : Multiupload.com - upload your files to multiple file hosting sites! 1. Install XAMP 2. Go to the PHP folder of the xampplite (C:\xampplite\php) and search PHP.ini 3. In the PHP.ini search ;extension=php_mssql.dl and delete ";"
[Server Status] Server Status Programs From A Couple Servers.
11/05/2008 - Conquer Online 2 - 9 Replies
Hey i dont know in what section to post it so i hope that the mods will move it to the good section but i made this server status program i will make later more server status programs for other servers. PhoenixCo: Server Checker Qonquer Qonquer Server Checker Screenshot: http://i286.photobucket.com/albums/ll115/aschwinh /sdfsdfsdf.jpg
Mirc Login server and game server status checker
07/15/2008 - Lineage 2 - 0 Replies
Hey community, I was wondering if there was some kind of script for mIRC that can check login server and game server status. Tyvm for your time.



All times are GMT +1. The time now is 06:28.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.