BNETDocs
S>C 0xAF D2GS_NEGOTIATECOMPRESSION
Message Id:0xAF
Message Name:D2GS_NEGOTIATECOMPRESSION
Direction:Server to Client
Used By:Diablo II, Diablo II Lord of Destruction
Format:

(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:
Comments
dzik

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