This document covers the standard sizes and data types that this site references across other documents and packets.
Arrays of fields generally are only used when another field in the packet specifies how many entries there are or if the definition specifies a fixed size. The lack of a specified size in the definition indicates that the size is variable/non-fixed or unknown.
All numeric Battle.net types are little-endian. Battle.net uses the following types:
STRING- A null-terminated array of characters. The encoding varies from packet to packet, but generally will either be ISO 8859-1 or less commonly UTF-8.
STRINGLIST- A series of
STRINGvalues. This is like an array of
STRINGvalues in every way, except it is always variable/non-fixed size and terminated by an empty item at the end of the array (or otherwise double null-terminated).
UINT8- 8 bit (1 byte) unsigned integer, also known as
UINT16- 16 bit (2 byte) unsigned integer, also known as
UINT32- 32 bit (4 byte) unsigned integer, also known as
UINT64- 64 bit (8 byte) unsigned integer, also known as
BOOLEAN- An unsigned 8 bit or 32 bit (depending on packet) integer whose value is always 0 (FALSE) or 1 (TRUE).
VOID- Data marked as
VOIDhas no particular type or length. Where data is marked as
VOID, additional information is given on its use.
FILETIME- A Windows struct, used to store filetime information. It can be read as a
If the field is defined with square brackets, then this is an array of that type. For example,
UINT32 is an array of
UINT32 values. The number of array elements should be specified in the format, or if not, is specified by the value of another field, often preceeding the variable-length array of fields.
Some data which may at first appear to be strings are in fact
UINT32s; product & platform identification codes, for example. Since all data is little-endian, on little-endian systems this can be specified by the platform-dependant
'ABCD' code in C, for instance. On the wire, the value appears in reverse of what is written/should be interpreted due to the endian.
Examples of "UINT32-string" values seen throughout Battle.net's protocol:
|all clan packets||Clan Tag||
Sizes and information of other fields commonly seen on Battle.net.
|Item||Max. Length (bytes)||Notes|
|Username||15||Appended characters to enforce unique usernames (ex. #2) can increase the length of a username by 3 characters. In addition, Diablo II can have very long usernames, due to characters names/realms. The format is "Character@Realm*Username@Realm" and the length for these are @*@6. This results in a maximum possible username length, as received from Battle.net, of 48 characters. Official Blizzard clients assign a 64-character variable for usernames, so the use of a variable of at least that length is advisable for future compatibility. When creating an account, any username longer than 15 characters is truncated.|
|Channel name||31||Any channel name whose length exceeds this value is truncated.|
|CD-Key owner||15||Any key owner whose length exceeds this value is truncated.|
|Statstring||128||A series of mostly numeric values usually separated by a single space character.|
|Chat text||224||This is the maximum for game clients. Chat clients can receive up to 255 bytes of chat text. This includes the null terminator. Longer text is truncated.|