( search forums )
Querying a Soldat Server
Soldat Forums - Soldat Talk - Developers Corner
DeMo
February 21, 2004, 9:49 pm
Is there any info available about how we can query a server for information about the current map, number of players etc..?

DNA.styx
February 21, 2004, 11:37 pm
the only way I've done it was because I had access to the server itself, and I grabbed the server's gamestat.txt and parsed it.

DeMo
February 22, 2004, 3:57 am
Too bad. [:(]

I wanted to develop something like a Soldat server browser.
Where you could add your favourite servers and the program would query them for the information like ping, map, players, passworded or not etc... just like the internal server browser.

The purpose of this tool would be to check the situation of your favourite servers without having to open Soldat. Then you could simply double click a server in the list and it would launch Soldat.

If Michal released more information, I could even make it query the lobby server itself.

Captain RibMan
February 22, 2004, 3:59 am
isnt that what all seeing eye does

DeMo
February 22, 2004, 4:21 am
Yeah.. but ASE is paid and is made for a bunch of games.
I wanna do a simple thing, free, just for Soldat. [:)]

samthemon
February 28, 2004, 8:35 am
Well, my two bits worth...

Obviously the lobby holds all this info, map, ping etc. so try that way. i highly doubt the lobby protocol is very advanced. lol

b00stA
February 28, 2004, 11:02 am
samthemon, the lobby (the web frontend or the in-game lobby) doesn't know the ping. YOU ping the servers YOURSELF.

samthemon
February 28, 2004, 11:06 am
... duh. i accidentally said ping lol. and hmm, i wqas looking at the lobby packets. they look to be encrypted or something.

meij
March 15, 2004, 9:12 am
the server should have 2 UDP ports open, one is the 'server' port (for me its 23073) the other is the 'query' port (for me its 23196). send a packet with 's' (remove the 's) to the query port and you should get the reply your looking for. if your unable to find the 'query' port try opening command (9x) or cmd (nt/2k/xp) and type 'netstat -a' (again without the 's) and take a look at all your open UDP ports, gonna have to use trail and error here. remeber UDP != TCP.

as for ping, send (hex) 70696E6700 (ping ) to the 'query' port, i havnt tried this myself but it should reply with (hex) 50696E6700 (Ping ). i assume this was added as some hosts might not reply to normal ping requests for whatever reason.

*EDIT* Ok seems that pinging using the method above is the way to go about it. ASE uses that method.

if anyone has info on the lobby server replys i would be very greatfull if you could contact me with it. you can find me on #soldat @ EFnet.

DeMo
March 18, 2004, 3:36 am
Cool meij!!
Thank you VERY much for helping!

Sanjuro
March 22, 2004, 2:08 am
quote:... duh. i accidentally said ping lol. and hmm, i wqas looking at the lobby packets. they look to be encrypted or something.


All packets are encrypted >_>

meij
March 24, 2004, 12:44 pm
not ALL.. all ingame one are, some of the out of game ones arnt.. well at least the ping reply isnt..

bunkahumpa
April 30, 2004, 12:37 pm
quote:Originally posted by meij
the server should have 2 UDP ports open, one is the 'server' port (for me its 23073) the other is the 'query' port (for me its 23196). send a packet with 's' (remove the 's) to the query port and you should get the reply your looking for. if your unable to find the 'query' port try opening command (9x) or cmd (nt/2k/xp) and type 'netstat -a' (again without the 's) and take a look at all your open UDP ports, gonna have to use trail and error here. remeber UDP != TCP.


I tried querying a server IP on ports 23073, 23083, and 27007 -- none of which worked (they were in my netstat -a while I was in-game). I then tried querying EVERY UDP port that I had open, nothing. I'm sending a literal lower-case s when querying and I'm not getting any return, I've also tried sending the ASCII value of s, 115. Any ideas?

Edit: I also tried 23196 like you did, but still got nothing.
Edit#2: I tested it on a bunch of servers and I get it to work for the few that have port 23196 as their query port. It seems like most servers have different query ports, which kinda sucks when I'm trying to make a "universal" query system, e.g. you put the IP/port in and it gives you the details of the server. Can something be done to find out the query port by querying the regular game server port? I'm not sure what to do now.

r00kie
May 21, 2004, 12:33 am
Hmm iam working on a com lib to query a server its allmost finished i just got the impression that the query port = gameport + 123 ;D gonna check this now :)

systemfeind
May 24, 2004, 8:48 am
hmm michal told me that the servers port to query with the lobby server is 13073, maybe this can help you :)

DeMo
November 4, 2004, 4:04 am
Whoa.. a lot of time since I've been here!!
I started messing around with this query stuff again and I discovered a free .NET query library called GameStat. It works with Soldat and it says Soldat uses ASE (AllSeeingEye) query protocol, Soldat does not have its own query system. In GameStat's page there's information about the responses the ASE query protocol passes you. By studying this response I was able to create a simple query system for Soldat servers, and it is working.

However, the problem with the query Port still remains.
It seems that the server port + 123 rule is valid. I succesfully queried a server running on 23073 via port 23196. And then a server running on 23074 via port 23197.

BUT.. for some servers it won't work, nothing is replied.
I guess it has something to do with firewall/router stuff. Maybe the place where the server is hosted will only allow connections to the game port, what means that the query port remains blocked by their firewall.

One more thing, somebody mentioned that you should send "s" to get the response.
That's true... but I also get the response when I send any other string or even whole words like 'soldat' and etc.

The ingame browser shows a lot of details (like number of bots) that isn't returned when you query the server in the regular query port.

Edit: The GameStat lib can be found here:
[URL]