SRCDS Steam group


Need PHP Script - Check if server is online
#1
Wink 
Hi there. Wink

I need a simple PHP script that checks if server is online.
Can you help me?

Thanks in advance,
microbyte
Reply
#2
Google returns many results for exactly this..

You could check out LGSL standalone over at http://greycube.com
Reply
#3
You could easily modify my query script that I posted in the tutorial section.
randomresources.org | xfire: toasty2
Reply
#4
HI.
[Toast] I cant modify your script. It gives me some errors in PHP5.
Muppet, is CS:Source covered by this LGSL?

I've already done many searches with no success, so I need your help.

Thanks,
microbyte
Reply
#5
LGSL is a nice way to look at any server status. It includes player lists, time connected, scores as well as server settings.

You can add multiple servers to the list and look over all of them at once.

Here is an example that has been wrapped into a page:

http://www.fastfrags.co.uk/index.php?page=lgsl/index.php
Reply
#6
Thanks, but I need something simple.
I already have a script to query the server, but now I need a simple one that check if server is online or not, because some servers are home-made and aren't always online.

PHP Code:
if($isonline){
   include(
"./query.php");
}else{
   echo 
"Server offline";


All i need is a simple class to check if server is online. the fsockopen() function doesn't work, because it tries to connect to a computer by a port. If computer is ON, that port is open, but no server is running, it will return ONLINE.

Thanks,
microbyte
Reply
#7
Let me see if I can cook something up, source queries aren't my thing though...
randomresources.org | xfire: toasty2
Reply
#8
Go here for additional info:
http://developer.valvesoftware.com/wiki/Server_Queries

As you can see if you get a reply from the server, it means it's online right so why not make a function that if the server replies then it's online Smile
Join the Source Dedicated Server Support Group on Steam Community!
Source Dedicated Server (SRCDS)
Free to join, Live support! (When available)

http://forums.srcds.com/viewtopic/5114
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)