How do you get the won id of the current player which is joining the game?

----- 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 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.

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 ?

Simon

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Paul Kirby
Sent: 22 February 2002 23:41
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 10:06 PM
Subject: RE: [hlcoders] Server Protocol for Half-Life


> Hi,
>
> So the version is 45. That's good to know, at least I know myself and the
> Server are talking the same language!
>
> But how come the detail response packet structure doesn't resemble the
> documentation?
>
> To be specific, one of the bytes to indicate if the server has a password
or
> is running a mod is missing from the response!

It's ok on mine.
See in this hex dump:

00000000 FFFF FFFF 6D36 322E 3439 2E32 3532 2E31     ....m62.49.252.1
00000010 3333 3A32 3730 3135 004D 6F73 6169 6320     33:27015.Mosaic
00000020 554B 0061 735F 6F69 6C72 6967 0063 7374     UK.as_oilrig.cst
00000030 7269 6B65 0043 6F75 6E74 6572 5374 7269     rike.CounterStri
00000040 6B65 0006 0C2D 6477 0001 7777 772E 636F     ke...-dw..www.co
00000050 756E 7465 722D 7374 7269 6B65 2E6E 6574     unter-strike.net
00000060 0000 0001 0000 0000 9EF7 0A00 01                      .............

which shows the following:
 (int32)      -1  =  "����"
 (byte)  ASCII 'm' ( S2A_INFO_DETAILED )
 (string)  net address of server  =  "62.49.252.133:27015"
 (string)  name of the host / server  = "Mosaic UK"
 (string)  name of the map  =  "as_oilrig"
 (string)  game directory (i.e. valve/)  =  "cstrike"
 (string)  Game description (e.g. "half-life multiplay")   =
"CounterStrike"
 (byte)  active client count  = hex 06 = 06 players
 (byte)  maximum clients allowed = hex 0C = 12 Max Players allowed
 (byte)  protocol version (currently 37) = hex 2D = 45
 (byte)  type of server == 'l' for listen or 'd' for dedicated  =  "d" =
Dedicated
 (byte)  os of server == 'w' for win32 or 'l' for linux  =  "w"  =  Windows
 (byte)  password on server == 1 or yes, 0, for no  = hex 00  = no password
 (byte)  is server running a mod? == 1 for yes, 0 for no  =  hex 01 yes mod
 (string)  URL for mod's "info" website  =  "www.counter-strike.net"
 (string)  URL for mod's download ftp server  =  hex 00 00 because no ftp
server stated and and a string is terminated by a hex 00 i.e. null.
 (int32)  mod version #  =  hex 01 00 00 00  = 1
 (int32)  mod download size ( in bytes, approx. )  =  hex  00 9E F7 0A
which when flipped around = 0A F7 9E 00 = 184,000,000 bytes = 184MB
 (byte)  is the mod a server side only mod?  1 == yes, 0 == no     =    hex
00 so no server side mod
 (byte)  does this server require you to have a custom client side .dll (
client.dll )?  1 == yes, 0 == no.   =   hex 01 so yes to custom client side
dll.

Easy view:

 (int32)   "����"
 (byte)  'm'
 (string)   "62.49.252.133:27015"
 (string)   "Mosaic UK"
 (string)   "as_oilrig"
 (string)  "cstrike"
 (string)  "CounterStrike"
 (byte)  06 players
 (byte)  12 Max Players allowed
 (byte)  45
 (byte)  'd' = Dedicated
 (byte)  'w'  =  Windows
 (byte)  hex 00  = no password
 (byte)  hex 01 yes mod
 (string)  "www.counter-strike.net"
 (string)  hex 00 00
 (int32)  hex 01 00 00 00  = 1
 (int32)  hex  00 9E F7 0A = 184,000,000 bytes = 184MB
 (byte)  hex 00 so no server side mod
 (byte)  hex 01 so yes to custom client side dll.

Hope that helps you.

> Is this possible?
> Has the mod byte been dropped as we know it is running a mod if the
> extension packet information exists?
>
> If the response doesn't match the documentation, it makes it very
difficult
> to code to the spec.

Seems ok to me :)
I never had any problem.

> Thanks,
>
> 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





_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to