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

From Worms Knowledge Base

Jump to: navigation, search
 
(Wikified)
Line 1: Line 1:
<pre>
 
 
== General ==
 
== General ==
 
+
* Sizes and offsets are in bytes
Everything is LSB on the wire
+
* All offsets are from the start of the packet's data
Word size = 2
+
* Word size = 2 bytes
DWord size = 4
+
* DWord size = 4 bytes
 
+
* Everything is LSB on the wire
  
 
== Message header ==
 
== Message header ==
 
+
{| border="1"
Offset Size Value
+
!Offset
00 Byte 1 for frontend messages, 2 for ingame (compression?)
+
!Size
01 Byte (??)
+
!Value
02 Word Message size
+
|-
04 Word Command
+
|00
 +
|Byte
 +
|1 for frontend messages, 2 for ingame (compression?)
 +
|-
 +
|01
 +
|Byte
 +
|(??)
 +
|-
 +
|02
 +
|Word
 +
|Message size
 +
|-
 +
|04
 +
|Word
 +
|Command
 +
|}
 
Length: 6
 
Length: 6
 
  
 
== Join ==
 
== Join ==
 
 
Joining consists of several steps:
 
Joining consists of several steps:
  
- Step 1:
+
=== Step 1 ===
 
Command: 0x0004
 
Command: 0x0004
 
Direction: From client
 
Direction: From client
 
Size: 128
 
Size: 128
  
Nick at 06, null terminated.
+
* Nick at 06, null terminated.
 
Figure out what follows.
 
Figure out what follows.
  
 
+
=== Step 2 ===
- Step 2:
+
 
Command: 0x0008
 
Command: 0x0008
 
Direction: To client
 
Direction: To client
Line 38: Line 49:
 
Figure out error messages. (different commands?)
 
Figure out error messages. (different commands?)
  
 
+
=== Step 3 ===
- Step 3:
+
 
Command: 0x0005
 
Command: 0x0005
 
Direction: From client
 
Direction: From client
 
Size: 114
 
Size: 114
  
Nick at 06, null terminated.
+
* Nick at 06, null terminated.
 
Figure out what follows.
 
Figure out what follows.
  
 
+
=== Step 4 ===
- Step 4:
+
 
Server sends:
 
Server sends:
Player list, see below.
+
* Player list, see below.
Team list (when not empty), see below.
+
* Team list (when not empty), see below.
Map data, see below. (Map is not sent when we rejoin?)
+
* Map data, see below. (Map is not sent when we rejoin?)
(Figure out how the scheme is sent here when it's non-standard)
+
* A message with command 0x001f? What is it?
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 ==
 
== Player list ==
 
 
Command: 0x000b
 
Command: 0x000b
 
Direction: To client
 
Direction: To client
Line 75: Line 82:
 
Depending, that leaves 330, 328 or 324 trailing bytes.
 
Depending, that leaves 330, 328 or 324 trailing bytes.
 
Figure out what follows (or what is before the array).
 
Figure out what follows (or what is before the array).
 
  
 
== Team list ==
 
== Team list ==
 
 
Command: 0x000c
 
Command: 0x000c
 
Direction: To client
 
Direction: To client
  
 +
TODO
  
 
== Scheme data ==
 
== Scheme data ==
 
 
Command: 0x000d
 
Command: 0x000d
 
Direction: To client
 
Direction: To client
 
Size: 308
 
Size: 308
  
Two messages for a single change?
+
I saw two messages for a single scheme change?
 
Word at 06 is 0x0000 for the first, 0x0007 for the second.
 
Word at 06 is 0x0000 for the first, 0x0007 for the second.
Otherwise identical
+
Otherwise identical.
  
 
DWord at 08 is always 0xffffffff?
 
DWord at 08 is always 0xffffffff?
Line 100: Line 105:
 
79 bytes after, probably 76 extra for scheme version 2.
 
79 bytes after, probably 76 extra for scheme version 2.
 
Remaining 3 are 0x0046ec?
 
Remaining 3 are 0x0046ec?
 
  
 
== Ready signal ==
 
== Ready signal ==
 
 
Command: 0x000f
 
Command: 0x000f
 
Direction: Both ways
 
Direction: Both ways
Line 112: Line 115:
 
DWord at 08 is on/off?
 
DWord at 08 is on/off?
 
DWord at 0b is player number?
 
DWord at 0b is player number?
 
  
 
== Map data ==
 
== Map data ==
 
 
(Atleast for random generated:)
 
(Atleast for random generated:)
  
Line 123: Line 124:
  
 
Figure out contents. (can't see a resemblance with stored format)
 
Figure out contents. (can't see a resemblance with stored format)
</pre>
 

Revision as of 17:29, 16 September 2006

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.

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

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