Valhalla Legends Forums Archive | Battle.net Bot Development | Warcraft III User Profile Parsing

AuthorMessageTime
Myndfyr
Here is the format for the Warcraft III-unique packet 0x44, which I've termed SID_WARCRAFTGENERAL, because it performs many Warcraft-III-specific functions, along with other things, such as finding arranged team matchups. I haven't completed parsing everything, but here's what I have so far -- at least that I'm releasing:

[code]
SID_WARCRAFTGENERAL
------------------------
BYTE Subcommand ID
DWORD Cookie
VOID Packet Data

SID_WARCRAFTGENERAL Subcommand PROFILE -- 0x04 (C->S)
----------------------------------------------------------------------------------
BYTE Subcommand ID (0x04)
DWORD Cookie
String User name
DWORD Product ID ('WAR3' or 'W3XP')

SID_WARCRAFTGENERAL Subcommand PROFILE -- 0x04 (S->C)
----------------------------------------------------------------------------------
BYTE Subcommand ID (0x04)
DWORD Cookie
DWORD Icon ID (for example, Orc Peon is 'opeo', reversed of course).
BYTE Number of LADDERDATA structures to expect. This will be between 0 and 3.
LADDERDATA[] Ladder Data for main random solo/team/FFA
BYTE Number of race stats to expect. This will always be 5 for WAR3, 6 for W3XP.
RACESTATS[] Race stats, in the order: Random, Human, Orc, Undead, Night Elf, and (Possibly) Tournament.
BYTE Number of ARRANGEDTEAM structures to expect.
ARRANGEDTEAM[] Arranged team stats.

LADDERDATA Structure:
------------------------
DWORD Type of ladder -- 'SOLO', 'TEAM', or 'FFA ' (that is a space, 0x20, NOT 0x00)
WORD Number of Wins
WORD Number of Losses
BYTE Level
BYTE Hours to XP decay, if applicable
WORD Experience
DWORD Rank

RACESTATS Structure:
----------------------
WORD Wins
WORD Losses

ARRANGEDTEAM Structure:
-------------------------
DWORD Type of team -- '2VS2', '3VS3', or '4VS4'
WORD Number of Wins
WORD Number of Losses
BYTE Level
BYTE Hours to XP decay, if applicable
WORD Experience
DWORD Rank
FILETIME Last Game played
BYTE Number of Partners
STRING[] Partners

SID_WARCRAFTGENERAL Subcommand CLANPROFILE -- 0x08 (C->S)
----------------------------------------------------------------------------------
BYTE Subcommand ID (0x08)
DWORD Cookie
DWORD Clan Tag
DWORD Product ID ('WAR3' or 'W3XP')

SID_WARCRAFTGENERAL Subcommand CLANPROFILE -- 0x08 (S->C)
----------------------------------------------------------------------------------
BYTE Subcommand ID (0x04)
DWORD Cookie
BYTE Number of CLANLADDERDATA structures to expect -- it's the same as LADDERDATA, except that the Hours to XP decay is not used.
LADDERDATA[] Clan ladder data.
BYTE Number of race stats to expect. 5 for WAR3, 6 of W3XP.
RACESTATS[] Race stats for the clan.
[/code]

So -- to request a profile, I believe the following packet order is used (I say I believe cuz I don't have my code immediately in front of me):

0x35 C->S
0x35 S->C
IF the last DWORD is NOT 0x00000000 (no clan)
0x82 C->S
0x82 S->C
0x44 Subpacket 8 C->S
0x44 Subpacket 4 C->S
0x44 Subpacket 8 S->C
0x44 Subpacket 4 S->C

Offhand, I think my code actually waits for 0x44 subpacket 8 to return (to improve synchronous operations) before sending subpacket 4.

Anyway, that's that. ;-)
June 20, 2004, 5:59 PM
UserLoser.
Neat.
June 20, 2004, 6:04 PM
KkBlazekK
Thanks...
June 20, 2004, 7:14 PM
PaiD
Very cool Thx
June 20, 2004, 8:27 PM
tA-Kane
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66330 date=1087754391]IF the last DWORD is NOT 0x00000000 (no clan)[/quote]Interesting... I beleive you may have found my IP ban problem that I have been having for months, which I couldn't figure out.

Any ideas what the "correct" order is if the last DWORD is zero?
June 21, 2004, 3:59 PM
Myndfyr
[quote author=tA-Kane link=board=17;threadid=7353;start=0#msg66501 date=1087833542]
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66330 date=1087754391]IF the last DWORD is NOT 0x00000000 (no clan)[/quote]Interesting... I beleive you may have found my IP ban problem that I have been having for months, which I couldn't figure out.

Any ideas what the "correct" order is if the last DWORD is zero?
[/quote]

Yup. Skip 0x82 and 0x44 subpacket 8, just sending 0x44 subpacket 4.

However, I'm not sure that this is your problem. My code wasn't broken at the upgrade to 1.15. None of these packets is required; I got the profile the old way (0x26 and 0x44 sub 4) just fine, except I didn't get the clan info.
June 21, 2004, 5:15 PM
tA-Kane
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66512 date=1087838149]However, I'm not sure that this is your problem.[/quote]Even if it's not, it's one thing that allows me to more closely emulate WarCraft 3 and rule this possibility out...

Edit:
Feel free to review my problem, if you'd like. The old (3 months) thread is here:
https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=6036;start=0
June 21, 2004, 6:59 PM
Myndfyr
[quote author=tA-Kane link=board=17;threadid=7353;start=0#msg66532 date=1087844394]
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66512 date=1087838149]However, I'm not sure that this is your problem.[/quote]Even if it's not, it's one thing that allows me to more closely emulate WarCraft 3 and rule this possibility out...

Edit:
Feel free to review my problem, if you'd like. The old (3 months) thread is here:
https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=6036;start=0
[/quote]

Hrm. I'm looking at these:

Send data (6 bytes).
<00000100< FF 0A 06 00 00 00 ......

Send data (8 bytes).
<00000106< FF 0B 08 00 57 41 52 33 ....WAR3

One, I don't ever SEND 0x0a. It comes automatically. I send 0x0c. I think (I could be wrong... I gotta look later).

Second, Why not send 'WAR3' (aka "3RAW")?
June 21, 2004, 7:35 PM
Soul Taker
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66544 date=1087846519]
[quote author=tA-Kane link=board=17;threadid=7353;start=0#msg66532 date=1087844394]
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66512 date=1087838149]However, I'm not sure that this is your problem.[/quote]Even if it's not, it's one thing that allows me to more closely emulate WarCraft 3 and rule this possibility out...

Edit:
Feel free to review my problem, if you'd like. The old (3 months) thread is here:
https://davnit.net/bnet/vL/phpbbs/index.php?board=17;action=display;threadid=6036;start=0
[/quote]

Hrm. I'm looking at these:

Send data (6 bytes).
<00000100< FF 0A 06 00 00 00 ......

Send data (8 bytes).
<00000106< FF 0B 08 00 57 41 52 33 ....WAR3

One, I don't ever SEND 0x0a. It comes automatically. I send 0x0c. I think (I could be wrong... I gotta look later).

Second, Why not send 'WAR3' (aka "3RAW")?
[/quote]
Sending 0x0a enters chat. But yes, WAR3 does indeed look incorrect.
June 21, 2004, 11:40 PM
pandaemonium
[quote]

LADDERDATA Structure:
------------------------
DWORD Type of ladder -- 'SOLO', 'TEAM', or 'FFA ' (that is a space, 0x20, NOT 0x00)
WORD Number of Wins
WORD Number of Losses
BYTE Level
BYTE Hours to XP decay, if applicable
WORD Experience
DWORD Rank

[/QUOTE]
are you sure about the XP decay time ? I think this value is for the XP-progess bar being displayed


[QUOTE]
ARRANGEDTEAM Structure:
-------------------------
DWORD Type of team -- '2VS2', '3VS3', or '4VS4'
WORD Number of Wins
WORD Number of Losses
BYTE Level
BYTE Hours to XP decay, if applicable
WORD Experience
DWORD Rank
BYTE[9] Unknown, but I'm relatively certain that somewhere within is a FILETIME that says when the last game was by this team.
STRING[] Partners
[/quote]

if I recall correct, your so far unsure BYTE[9] is:
FILETIME time of last game
BYTE size of the AT team
June 23, 2004, 8:56 AM
Myndfyr
[quote author=pandaemonium link=board=17;threadid=7353;start=0#msg66775 date=1087980991]
if I recall correct, your so far unsure BYTE[9] is:
FILETIME time of last game
BYTE size of the AT team
[/quote]

That's probably correct. I haven't tested it out. However, it would be pointless to give the size of the team, since it's already part of the structure ('2VS2', '3VS3', or '4VS4').

As far as the "Hours to XP decay," I noticed the Blizzard website has Days to XP decay in thge main profile. When I was checking back and forth across about 5 profiles that would have had XP decay, if you used Hours there, then it always fell within the number of hours in that many days within one day. It's more of a conjecture than a certain thing, and you may well be right about the progress bar. It's my best guess, though, and it's based on my observations.

EDIT: Yes, the structure ends with FILETIME, BYTE (before the string list). I'll update that in the above post.
June 23, 2004, 6:30 PM
tA-Kane
[quote author=Myndfyre link=board=17;threadid=7353;start=0#msg66544 date=1087846519]One, I don't ever SEND 0x0a. It comes automatically.[/quote]Packetlog WarCraft 3 and tell me the correct thing to do? I don't have a computer that can run WarCraft 3, so I can't do it myself... let alone the fact that I'd be running it as PMAC or XMAC, yet my bot uses IX86, and that's enough of a difference there.
June 24, 2004, 3:03 AM

Search