Hi, Does anyone have a C++ example of retrieving the server information ?
Thanks, Simon PS: Paul, I looked at your PHP stuff and it is doing what I am aiming for (though in a Windows app). I have seen PHP/Perl examples on the Internet (source code and all), but I cannot remember where they were. If I could, I would analyse the code to figure out how they parse it and port it to a C++ COM component or class. I'll keep looking. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Paul Kirby Sent: 23 February 2002 00:37 To: [EMAIL PROTECTED] Subject: Re: [hlcoders] Server Protocol for Half-Life Hello Simon ----- Original Message ----- From: "Simon Rose" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 22, 2002 11:55 PM Subject: RE: [hlcoders] Server Protocol for Half-Life > Paul, > > Your response is cool. I knew I must be doing something wrong rather than > there being a fault with the Servers or the protocol. > > Into what variable type do you read the response? I did mine all in PHP for the web. Take a look. http://www.psychonet.co.uk/paul/HLSInfo/ Though I am in the middle of designing an admin type app or a status app for Half-Life. > I am using: > > TCHAR hl_resp[1024]; > > In what way are you extracting the various components? > > I was doing something rather noddy, but it seemed to be working for the most > part: > > BYTE a = hl_resp[0]; > BYTE b = hl_resp[1]; > BYTE c = hl_resp[2]; > BYTE d = hl_resp[3]; > > These bytes correspond to the opening 255 255 255 255 part of the code. I use "����" > Interestingly, from what I can understand of your hex dump, a . appears to > be the terminating character of the string fields. If this is the case, how > are you managing to work out that in the following snippet of your response: > > ...-dw.. which maps to: > > (string) . terminator for "CounterStrike" > (byte) . 06 players > (byte) . 12 Max Players allowed > (byte) - 45 > (byte) d 'd' = Dedicated > (byte) w 'w' = Windows > (byte) . hex 00 = no password > (byte) . hex 01 yes mod > As you can see, some important information is dots, some dots are string > terminators. I wonder if it is this distinction where I am tripping up. > > Any hints on how you are storing the response and parsing it please ? As I said above mine was done in php. > Simon Paul Kirby Webmaster of http://www.initcorp.co.uk _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders

