Query Counter-Strike:Source Server

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
TalonX
Forum Newbie
Posts: 3
Joined: Wed Dec 14, 2005 5:54 pm

Query Counter-Strike:Source Server

Post by TalonX »

I want to be able to connect to a Counter-Strike:Source (CSS) IP/port and retrieve player information, and server stats. I have found several classes online that say they do this, but none of them work. The servers always time out or there's a problem in the code.

For instance, one example you guys could try out is here: http://www.phpclasses.org/browse/package/1815.html
Maybe my host is rejecting the connection. I'd appreciate it if someone could help me out on this subject and any ideas or examples would be helpful.

Thank you,
Talon
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Best site for this is by far http://dev.kquery.com/

Be sure to check out the dev talk forums on there for more examples and etc.

Basically you need to send a query string to the server, and then handle the response packet. This gives you all the info you need, such as server IPs, ports, query strings, and info about handling the response for many different games.

The Source engine included.
TalonX
Forum Newbie
Posts: 3
Joined: Wed Dec 14, 2005 5:54 pm

Post by TalonX »

I've been to that site already, i'm a member there. I've been to 5 sites actually and all of the examples are based on steam's pre-patch CS:S. Since the patch things have changed. I understand how to query a server, i don't get how to query CS:S with the new patch installed.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

Whenever a new patch is release for most games, what usually happens is a few bytes in the query string change (both master server and individual server) but specifically speaking about CS: S, I'd recommend reading the comments from this article: http://dev.kquery.com/index.php?article=46

Seems like the original example was made for pre-patch and people have added their notes about solving the issues with master/server queries in the new method
Post Reply