Okay, Kris was in fact right.  I had some free time just a bit ago and pulled together a class to manage my UDP socket on the same local port for multiple transmissions.  Voila!  It worked.  Interesting that the Steam Master considers a different response port to be a totally new query.  Maybe it's caching a temporary copy of the list for a certain response ip and port?
 
Thanks, all,  for bearing with my frustration and my learning curve. :)


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of EdGruberman
Sent: Monday, January 31, 2005 12:21 PM
To: [email protected]
Subject: RE: [hlds_apps] Master Query Batch Protocol

Okay, I think you are right Kris.  I think it is coding now too.  I finally got so frustrated, I loaded php up on my IIS server to give some sample code on your website a try.  I figured, if I could duplicate the problem with another language and someone else's code, I'd have a strong argument for protocol problems.  However, the php sample code worked! d0h!  I'm wrong again... not surprising. ;)
 
I think the difference is that I'm trying to be far too (in)efficient with my sockets.  The php code uses the same local port for each consecutive query.  I am opening and closing my socket/port for each consecutive query which causes the port to drift to the next random port available for each query.  I'm assuming the Steam Master is smart enough to detect this and maybe thinks it's a new query and automatically disregards the lastip parameter?
 
I'm going to play with my code some more and see what I can pull together to do the same thing and see what happens...


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of EdGruberman
Sent: Monday, January 31, 2005 11:18 AM
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