Ok, Just a question...
Have you read the SDK or monitored the network packets fully?
 
This is what I found out :)
 
You first send the following to start the list off:
 
0000000000  31 03 30 2E 30 2E 30 2E 30 3A 30 00 5C 67 61 6D     1.0.0.0.0:0.\gam
0000000010  65 64 69 72 5C 63 73 74 72 69 6B 65 00                     edir\cstrike.
 
0x31 = "1" <-- I think this is the unique id of some sort ?
0x03 = Location "Europe, US - East, US - West" etc.
"0.0.0.0:0" = blank address to request first lot of the server list.
".\gamedir\cstrike" <-- mod path for cstrike or what ever game you want.
0x00 = NULL <-- You must end with a null char 0x00
 
You will then get the following type of packet:
 
00000000  FF FF FF FF 66 0A ...........
0xFFFFFFFF = HL_PACKET
0x66 = HL_SERVERLIST  (Type of Packet)
0x0A = Not sure, could be version ??
 
Then as you already know next long (4 bytes) = IP + int (2 bytes) for the port.
And the above line is looped to the end of the file...
 
You are at that point ...
 
you then need to send the following request:
 
0000000000 31 03 31 39 32 2E 31 36 38 2E 32 35 32 2E 31 30     1.192.168.252.10
0000000010 30 3A 32 37 30 31 35 00 5C 67 61 6D 65 64 69 72    0:27015.\gamedir
0000000020 5C 63 73 74 72 69 6B 65 00                                    \cstrike.      
0x31 as I said this could be a unique id of some sort?
03 Location "Europe, US - East, US - West" etc.
Now send the last IP and PORT from the last list like "192.168.252.100:27015"
".\gamedir\cstrike" <-- mod path for cstrike or what ever game you want.
0x00 <-- NULL
 
You should then get another packet with more servers :)
 
You keep looping the above until the last server in the list returns 0.0.0.0:0
 
Then you need to stop requesting more servers at this point.  If you dont stop at this point it will keep looping and looping over and over :( 
So stop at this point :P
 
The way the Server Browser does it is the following:
1: Request 1st list of servers.
2: Decode server list returned.
3: Get Server Information of returned servers (do not get info for server address "0.0.0.0:0").
4: Is last server returned = "0.0.0.0:0" if true then exit loop
5: Request next lot of servers (after last server returned before)
6: Goto Line 2
 
Hope this helps :)
 
Paul Kirby


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of EdGruberman
Sent: Mon 31 January 2005 18:18
To: [email protected]
Subject: RE: [hlds_apps] Master Query Batch Protocol

I'm not sure what you mean by fine?  1st problem - TFC doesn't have 231 active servers.  2nd problem - Even if I query for something like cstrike or dod, I still can't get anything other than the first list of 231 available.  Even if I change the region code to like 0 or 1, same problem.
 
I'm 99% positive this isn't a coding problem as I'm looking directly at packet dumps and discussing protocol.  (Believe me, I spent quite a few hours getting past my initial problems which WERE coding! :) )  These packets definitely do not look fine to me.
 
I've spent some time poking around your forums too, Kris, which are VERY useful, thank you!  But unfortunately I'm still staring at these packets and not understanding why my second request isn't coming back as expected(the remaining server ip/ports in the list), but rather an identical duplicate of the first response...


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kris Sum
Sent: Monday, January 31, 2005 10:26 AM
To: [email protected]
Subject: RE: [hlds_apps] Master Query Batch Protocol

Everything seems fine from those packet dumps.
 
http://www.kquery.com/forums/index.php?showtopic=489 is a thread on my coding forums about this - perhaps if you posted some code in the forums we can work out what is going wrong?
 
Cheers,
Kris.


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of EdGruberman
Sent: 31 January 2005 15:35
To: [email protected]
Subject: [hlds_apps] Master Query Batch Protocol

Hello all,

 

I’m having trouble figuring out what I’m doing wrong in trying to get more than the first response back from the master server (steam1.steampowered.com:27010).  Might anyone have more of a clue than I?


I first send out the initial request:

00000020                                31 FF 30 2E 30 2E           1.0.0.
00000030  30 2E 30 3A 30 00 5C 67 61 6D 65 64 69 72 5C 74 0.0:0.\gamedir\t
00000040  66 63 5C 00                                     fc\.           

And I get a nice healthy response with 231 server ip/port pairs in it:

00000020                                FF FF FF FF 66 0A           ....f.
00000030  18 FD F3 7B 69 87 18 D9 72 B2 69 87 18 CB 8A FE ...{i...r.i.....
00000040  07 87 18 C7 19 36 69 87 18 C6 A4 1B 69 87 18 BA .....6i.....i...
...<snipped for brevity>...
00000570  43 13 6F 4A 69 87 43 13 B5 9F 69 87 43 13 B5 A5 C.oJi.C...i.C...
00000580  69 88 43 2A BB 90 69 86 43 46 39 CC 69 87 43 65 i.C*..i.CF9.i.Ce
00000590  CD A0 69 97 43 A2 B1 26 EA 85                   ..i.C..&..
     
The last ip/port pair is 167.162.177.38:60037 (43 A2 B1 26 EA 85).  Ya, weird port, but I double checked my math to make sure.

 

So I take that last ip/port pair and request the next batch response:

00000020                                31 FF 36 37 2E 31           1.67.1

00000030  36 32 2E 31 37 37 2E 33 38 3A 36 30 30 33 37 00 62.177.38:60037.

00000040  5C 67 61 6D 65 64 69 72 5C 74 66 63 5C 00       \gamedir\tfc\. 

 
To which I get the same exact reponse I got initially:
00000020                                FF FF FF FF 66 0A           ....f.
00000030  18 FD F3 7B 69 87 18 D9 72 B2 69 87 18 CB 8A FE ...{i...r.i.....
00000040  07 87 18 C7 19 36 69 87 18 C6 A4 1B 69 87 18 BA .....6i.....i...
...<snipped for brevity again>...
00000570  43 13 6F 4A 69 87 43 13 B5 9F 69 87 43 13 B5 A5 C.oJi.C...i.C...
00000580  69 88 43 2A BB 90 69 86 43 46 39 CC 69 87 43 65 i.C*..i.CF9.i.Ce
00000590  CD A0 69 97 43 A2 B1 26 EA 85                   ..i.C..&..     
 
I copied and pasted straight from Network Monitor for each packet, I didn't just copy the 2nd and the 4th as the same.  That's really what I got.  Is there something I'm missing here?  Shouldn't I send the last ip/port I got as a string for the 3rd parameter to the master server in order to get the next sequence of ip/port pairs?
 
This work is entirely based off of Alfred's e-mail (due to the lack of any SDK documentation I can find):
----------
We have also changed the "batch request" protocol. The new protocol consists of sending:

WriteByte( A2M_GET_SERVERS_BATCH2 ); // character '1'
WriteByte( 2 );// write the region we want info on
WriteString( startIP ); // the first ip address we are interested in
WriteString(filterString); // a backslash delimited string for filtering of servers

The change has been adding the region field and changing the batch parameter to use the last IP you received rather than a counter.
----------
Am I not understanding something correctly?
 
Thanks in advance.
 
EdGruberman
www.rjump.com

Reply via email to