Notational Convention (Sizes & Types)
|Item||Max. Length (bytes)||Additional Notes|
|Username||15||Appended characters to enforce unique usernames (ie, #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" The lengths for these are: @*@. 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 names||31||Any channel name who's length exceeds this value is truncated.|
|CD key owner||15 ||Any key owner who's length exceeds this value is truncated.|
|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.|
Data types: All numeric Battle.net types are little-endian. Battle.net uses the following types:
- STRING - Null-terminated array of characters.
- WIDESTRING - A null-terminated UTF-8 string. See also: RFC 2279, WideCharToMultiByte()/MultiByteToWideChar(). Please also note that Battle.net only Unicode-encodes strings for Starcraft and Brood War. Other clients are still using ASCII, although it's likely that this will change in the future.
- STRING - An array of strings (see above). This type is generally only used when another field in the packet specifies how many entries there are.
- STRINGLIST - A series of strings (see above) with an additional null-terminator at the end.
- QWORD - 64 bit (8 byte) unsigned integer.
- DWORD - 32 bit (4 byte) unsigned integer.
- DWORD - The lack of a specified size indicates that the size is variable or unknown.
- WORD - 16 bit (2 byte) unsigned integer.
- BYTE - 8 bit (1 byte) unsigned integer.
- BOOL - An unsigned little-endian integer (a byte) whose value is always 0 (FALSE) or 1 (TRUE). Can also be a DWORD, depending on the packet.
- VOID - Data marked as VOID has 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. Can be read as a QWORD or two DWORDs
Some data which may at first appear to be strings are in fact DWORDs; game & platform codes, for example.
= Online = Offline
= Online = Offline