S>C 0x44 SID_WARCRAFTGENERAL
0x44
SID_WARCRAFTGENERAL
In Research
(does not include protocol header)
(UINT8) Subcommand ID
Subcommand 0x00 WID_GAMESEARCH:
(UINT32) Cookie
(UINT32) Status
0x00000000: Search Started
0x00000004: Banned CD-Key
Subcommand 0x02 WID_MAPLIST:
(UINT32) Cookie
(UINT8) Number of responses
For each response:
(UINT32) ID
(UINT32) Checksum
(UINT16) Decompressed length
(UINT16) Compressed length
(VOID) Compressed data
(UINT8) Remaining Packets
Subcommand 0x03 WID_CANCELSEARCH:
(UINT32) Cookie from WID_GAMESEARCH
Subcommand 0x04 WID_USERRECORD:
(UINT32) Cookie
(UINT32) Icon ID
(UINT8) Number of ladder records to read; this will be between 0 and 3.
For each ladder record:
(UINT32) Ladder type ID
(UINT16) Number of wins
(UINT16) Number of losses
(UINT8) Level
(UINT8) Unknown*
(UINT16) Experience
(UINT32) Rank (will be 0 if unranked)
(UINT8) Number of race records to read; this will be 5 for WAR3 and 6 for W3XP.
For each race record:
(UINT16) Wins
(UINT16) Losses
(UINT8) Number of team records to read.
For each team record:
(UINT32) Team type ID
(UINT16) Number of wins
(UINT16) Number of losses
(UINT8) Level
(UINT8) Unknown*
(UINT16) Experience
(UINT32) Rank (will be 0 if unranked)
(FILETIME) Time of last game played
(UINT8) Number of partners
(STRING)[] Names of partners
Subcommand 0x07 WID_TOURNAMENT:
(UINT32) Cookie
(UINT8) Status
0x00: No Tournament
0x01: Starting Soon
0x02: Ending Soon
0x03: Started
0x04: Last Call
(FILETIME) Last Status Update Time
(UINT16) Unknown
(UINT16) Unknown
(UINT8) Wins
(UINT8) Losses
(UINT8) Draws
(UINT8) Unknown
(UINT8) Unknown
(UINT8) Unknown
(UINT8) Unknown
Subcommand 0x08 WID_CLANRECORD:
(UINT32) Cookie
(UINT8) Number of ladder records to read; this will be between 0 and 4.
For each ladder record:
(UINT32) Ladder type ID
(UINT32) Number of wins
(UINT32) Number of losses
(UINT8) Level
(UINT8) Unknown*
(UINT32) Experience
(UINT32) Rank (will be 0 if unranked)
(UINT8) Number of race records to read; this will be 5 for WAR3 and 6 for W3XP.
For each race record:
(UINT32) Wins
(UINT32) Losses
Subcommand 0x09 WID_ICONLIST:
(UINT32) Cookie
(UINT32) Selected Icon
(UINT8) Tiers
(UINT8) Count
For each Icon:
(UINT32) Icon ID
(UINT32) Unit ID**
(UINT8) Race
(UINT16) Wins required
(UINT8) Enabled
Remarks
This message is still being researched!
This message is used for multiple purposes on Warcraft III. Known and validated purposes are listed here.
The following UINT32 identifiers are similar to Product IDs and clan tags, 4-byte strings reversed by endian.
Icon ID
s are the identifiers used in icons-WAR3.bni (an MPQ file) and found reversed in user statstrings (for example 'W3O1' is Orc Peon).Ladder type ID
(WID_USERRECORD):'SOLO'
,'TEAM'
, or'FFA '
(where the last character is a space, 0x20).Team type ID
(WID_USERRECORD):'2VS2'
,'3VS3'
, or'4VS4'
.Ladder type ID
(WID_CLANRECORD):'CLNS'
(solo),'CNL2'
(2v2),'CLN3'
(3v3),'CLN4'
(4v4).
* The field was formerly labeled as "Hours until XP decay", but as no evidence to support this claim has ever been verified (and through personal testing has been found to be altogether false), it has been renamed as unknown for the time being. More information on this value would be appreciated.
** This is the name of the unit for which this icon should be displayed for. The names can be found in the war3.mpq/Units/UnitData.slk.
Comments
I'd like to submit a couple updates to this based on the PvPGN source.
(http://svn.berlios.de/svnroot/repos/pvpgn/trunk/pvpgn/src/bnetd/handle_anongame.cpp)
(http://svn.berlios.de/svnroot/repos/pvpgn/trunk/pvpgn/src/common/anongame_protocol.h)
Subcommand 0x09:
- the second DWORD is the ID of the currently selected icon
- the second DWORD of each icon is the W3 unit ID - these IDs are listed in war3.mpq\Units\UnitData.slk
- last BYTE of each icon is 0 if disabled in user icon selection, 1 if enabled
There's also several other subcommands related to setting up PG and AT games. The packet structures can be found in the PvPGN source files that I listed above.
They apply to both. This is how the official client interprets the 0x09 response fields, regardless of the server implementation (BNet or PvPGN). I've tested these out with my own server.
Updated. Thanks for your addition, RichardNixon.
these IDs are listed in war3.mpq\Units\UnitData.slk
Or War3x.mpq respectively.
What should this mean?
0x00 (WID_GAMESEARCH):
0x00000004: Banned CD-Key
What compression algorithm is used here?
Edit: nevermind.
For WID_GAMESEARCH, a status of 0x00000006 means you have reached the maximum games (~200 or so is the limit) and you have to wait a period of time before playing again.
Subcommand 0x02 WID_MAPLIST: (probably should be labled QUERY, since its not only the map list information.)
(UINT32) Cookie
(UINT8) Number of responses
For each response:
(UINT32) ID
(UINT32) (CRC-32/BZIP2)->(uncompressed data)
(UINT16) Decompressed length
(UINT16) Compressed length
(VOID) Compressed data
(UINT8) Remaining Packets
compressed data:
types:
(uint32_t)'\0URL'
(char*) realm_url
(char*) profile_url
(char*) turnament_url
(char*) clan_url
(uint32_t)'\0MAP'
(uint8_t) total
each:
(char*) map_path
(uint32_t)'TYPE'
(uint8_t) total
each:
(uint8_t) index
(uint8_t) total_2
each:
(uint8_t[5]) prefix_need_more_info
(uint8_t) total_maps
(uint8_t[total_maps]) maps_by_index_order
notes:
maps_by_index_order: this is the return from '\0MAP', 0=first map in that list.
first occurrence of: total_maps< 12
from every dump i have seen there is a spot in the second struct where the ending void*
bytes has 3 extra bytes attached to the structure. not counted and is a continuation of
the final byte of the counted struct {need_more_info[total_bytes]+1,
need_more_info[total_bytes]+2, need_more_info[total_bytes]+3}
(uint32_t)'DESC'
(uint8_t) total
each:
(uint8_t) index_enum_pg_at_ty
(uint8_t) index_in_the_pg_at_ty_list
(char*) short_description
(char*) long_description
(uint32_t)'LADR'
(uint8_t) total
each:
(uint32_t) type
(char*) category
(char*) url
namespace Standards::CRC32 {
constexpr uint32_t CRC32_BZIP2_POLYNOMIAL = 0x04C11DB7; //CRC-32/BZIP2
uint32_t CRC32BZIP2Table[256];
static bool CRC32BZIP2Initialized = false;
// Initialize CRC table for CRC-32/BZIP2
void constexpr InitCRC32_BZIP2() {
if (CRC32BZIP2Initialized)
return;
CRC32BZIP2Initialized = true;
for (size_t i = 0; i < 256; i++) {
uint32_t crc = i << 24; // Non-reflected version starts with MSB
for (size_t j = 0; j < 8; j++) {
if (crc & 0x80000000) {
crc = (crc << 1) ^ CRC32_BZIP2_POLYNOMIAL;
}
else {
crc <<= 1;
}
}
CRC32BZIP2Table[i] = crc;
}
}
uint32_t BZIP2(uint8_t* data, size_t size) {
InitCRC32_BZIP2();
uint32_t crc = 0xFFFFFFFF;
while (size--) {
crc &= 0xFFFFFFFF;
crc = ((crc << 8)) ^ CRC32BZIP2Table[((crc >> 24) ^ *data++) & 0xFF];
}
return ~(crc);
}
}