quote:Originally posted by DePhille
i'm using the winsock contro lto connect to lobby.soldat.pl:13073 .
As far as I know, the data Soldat.exe requests is sent via another port (UDP, not TCP?), so in order to request the stuff the same way Soldat.exe does, run a packet sniffer or something like that.
Since Michal didn't publish the protocol for it, better stick to the HTML parsing:
quote:I think getting the server list this way is much faster and better than getting servers out of the HTML page. Like that i can show no. of bots and such things.(think so).
You CAN filter the amount of bots from the web page front end (check the legend at the bottom of the page. players: number playing/max players (+number of bots)).
The command to request it via the HTTP protocol is (it's minimal/not perfect, but it works):
[code]sockwrite -n $sockname GET / HTTP/1.1
sockwrite -n $sockname Host: http://lobby.soldat.pl/ $+ $str($crlf,2)[/code]
This is mIRC script.. so you will have to write it in whatever language you're programming.
First connect to the server on port 13073, when connected, send the above data, where "sockwrite -n $sockname" is mIRC's command to send data to the server with a CRLF (carriage return/line feed) appended (important).
basically, you just send
[code]
GET / HTTP/1.1
Host: http://lobby.soldat.pl/[/code]
where the first line has one CRLF at the and and the second either 2 or 3, probably doesn't matter.
Now you receive some confirmation stuff, the server OS, etc. and then the HTML. To make sure that the server automatically closes the connection afterwards (should already happen, but who knows), add this line after the GET command:
Connection: close
that's basically all I know about HTTP commands, so if you need any other information, google has a lot of links to RFCs :)