Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 02.12.2006, 18:54   #1
dirkr
Архивный участник
 
Join Date: Nov 2006
Posts: 204
Default server status on webpage

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 ^^
dirkr is offline  
Old 02.12.2006, 19:35   #2
Firedaemon
Архивный участник
 
Join Date: Oct 2005
Posts: 267
Default

Take a look at the php function fopen

Code:
http://www.php.net/fopen
It is very easy to impliment
Firedaemon is offline  
Old 02.12.2006, 23:06   #3
Gaikotsu
Архивный участник
 
Join Date: Apr 2006
Posts: 74
Default

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;
}
$ip - server ip
$port - server port, 7777 - gameserver, 2106 - auth

if server work - returned true, else - false
Gaikotsu is offline  
Old 03.12.2006, 11:29   #4
dirkr
Архивный участник
 
Join Date: Nov 2006
Posts: 204
Default

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 )
dirkr is offline  
Old 03.12.2006, 12:46   #5
Lockbete
Архивный участник
 
Join Date: Apr 2006
Posts: 28
Default

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.
Lockbete is offline  
Old 03.12.2006, 13:12   #6
dirkr
Архивный участник
 
Join Date: Nov 2006
Posts: 204
Default

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
dirkr is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 20:28.