S>C 0xAF D2GS_NEGOTIATECOMPRESSION

Transport Layer:Transmission Control Protocol (TCP)
Application Layer:Diablo II In-Game Messages (D2GS)
Message Id:0xAF
Message Name:D2GS_NEGOTIATECOMPRESSION
Direction:Server to Client
Used By:Diablo II, Diablo II Lord of Destruction
Message Format:
(does not include protocol header)
(UINT8) Compression Mode
(UINT8)[128] Custom Compression Data (see note)

Remarks

The compression mode is one of:
0x81 : custom compression mode, data follows (unused)
0x01 : compression enabled, use default compression
0x00 : no compression (unused)

In practice the server ALWAYS uses compression. The length of the message is calculated as follows:

if (compresionMode == 0x00)
{
  messageLength = 2;
}
else
{
  messageLength = compressionMode + 1;
}

Note:
The custom compression data only exists if using custom compression. This message is variable length.

| Edited: Anonymous

Comments

dzik

As per last changes d2gs protocol is now always uncompressed (compression mode = 0x00)

Glyph

Some specific servers are modified and have 0x01 compression mode. (that work with an unmodified client [as of 1.14d, untested on other versions])