Difference between revisions of "Network protocol (Worms Armageddon)"

From Worms Knowledge Base

Jump to: navigation, search
(Step 1)
(Step 1)
Line 46: Line 46:
  
 
* Nick at 06, null terminated, ends (last place the null could be) at 22.
 
* Nick at 06, null terminated, ends (last place the null could be) at 22.
* Gameid (ascii) at 23.
+
* Gameid (ascii) at 23, null string for IP games.
 
Figure out what follows.
 
Figure out what follows.
  

Revision as of 16:18, 12 January 2007

General

  • Sizes and offsets are in bytes
  • All offsets are from the start of the packet's data
  • Word size = 2 bytes
  • DWord size = 4 bytes
  • Everything is LSB on the wire

Message header

Offset Size Value
00 Byte 1 for frontend messages, 2 for ingame (compression?)
01 Byte (??)
02 Word Message size
04 Word Command

Length: 6

Join

Joining consists of several steps:

Step 1

Command: 0x0004
Direction: From client
Size: 128
  • Nick at 06, null terminated, ends (last place the null could be) at 22.
  • Gameid (ascii) at 23, null string for IP games.

Figure out what follows.

Step 2

Command: 0x0008
Direction: To client
Size: 6

Acknowledgement. Empty message. Figure out error messages. (different commands?)

Step 3

Command: 0x0005
Direction: From client
Size: 114
  • Nick at 06, null terminated.

Figure out what follows.

Step 4

Server sends:

  • Player list, see below.
  • Team list (when not empty), see below.
  • Map data, see below. (Map is not sent when we rejoin?)
  • A message with command 0x001f? What is it?

Figure out how the scheme is sent here when it's not the default Intermediate

Player list

Command: 0x000b
Direction: To client
Size: 1176

This looks like it's sending a raw array of player structures. Each player structure is 120 bytes in size.

Names are limited to 17 characters, and are padded with 0 bytes. (If a name is exactly 17 characters, there will NOT be a null-terminator) Figure out what the rest is.

Considering there can be 7 players, the total length should be 840 bytes. Array starts at 06, 08 or 0b?

Depending, that leaves 330, 328 or 324 trailing bytes. Figure out what follows (or what is before the array).

Team list

Command: 0x000c
Direction: To client
Size: ??

TODO

Scheme data

Command: 0x000d
Direction: To client
Size: 308

I saw two messages for a single scheme change? Word at 06 is 0x0000 for the first, 0x0007 for the second. Otherwise identical.

DWord at 08 is always 0xffffffff? Byte at 0xd always 0x00?

(Atleast for version 1 scheme:) Scheme starts at 0e. No SCHM header. No version number? 79 bytes after, probably 76 extra for scheme version 2. Remaining 3 are 0x0046ec?

Ready signal

Command: 0x000f
Direction: Both ways
Size: 16

Word at 06 always 0x736e?

DWord at 08 is on/off? DWord at 0b is player number?

Map data

(Atleast for random generated)

Command: 0x002b
Direction: To client
Size: 64

Figure out contents. (can't see a resemblance with stored format)

Personal tools