![]() |
|
|
#1 |
|
Архивный участник
Join Date: Nov 2006
Posts: 204
|
i've been looking arround how to show it .. cant really find it if it stores it anywhere or something.
so any hints tips on on how to get auth and world status to display on a webpage? i dont request ready to plugin in code i'm willing to work at it..but atm i have no clue to be honest if code pref php ![]() thnx ^^ |
|
|
|
|
#2 |
|
Архивный участник
Join Date: Oct 2005
Posts: 267
|
Take a look at the php function fopen
Code:
http://www.php.net/fopen |
|
|
|
|
#3 |
|
Архивный участник
Join Date: Apr 2006
Posts: 74
|
Code:
function GetServerStatus($ip, $port)
{
error_reporting(0);
if ($fp = fsockopen($ip, $port, $ERROR_NO, $ERROR_STR, (float) 0.5))
{
fclose($fp);
return true;
}
else
return false;
}
$port - server port, 7777 - gameserver, 2106 - auth if server work - returned true, else - false |
|
|
|
|
#4 |
|
Архивный участник
Join Date: Nov 2006
Posts: 204
|
great thnx for even helping on the code ^^
thought it couldnt be that hard btw if you try to connect on the worldserver without going thru the authserver will it reject the socketrequest or just try and open the socket and return the correct value? just wondring ![]() edit : you sure the gameserver is 7777 ? cause i get false even tho its up.. if i print out the $ERROR_STR it gives me connection timed out. i've tried putting the timeout longer..same thing.. so i'm a bit lost here.. edit2 : k when i put the script on the box where the gameserver runs it works, but remote it doenst ( only shows auth up then ) is there a way to get the gameserver status from a remote location? cause if i run it on the server itself .;and the entire box goes down the webpage will error out ( the normal webpage is on a different server ) |
|
|
|
|
#5 |
|
Архивный участник
Join Date: Apr 2006
Posts: 28
|
ur firewall is probably blocking connections to 7777 from the outside so you have to allow the IP u have the script running on to connect to port 7777.
|
|
|
|
|
#6 |
|
Архивный участник
Join Date: Nov 2006
Posts: 204
|
firewall allows connections from any ip to port 7777 and still nothing..
hm k for some reason the webhost i used was not allowing me to connect to 7777 but it was allowing me to connect to 2106 ..weirdness thnx for the help guys appreciate it |
|
|
| Thread Tools | Search this Thread |
| Display Modes | |
|
|