• Welcome to Valhalla Legends Archive.
 

Warcraft III User Profile Parsing

Started by MyndFyre, June 20, 2004, 12:59 PM

Previous topic - Next topic

MyndFyre

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:


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.


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.  ;-)
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.


Blaze

Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No


tA-Kane

Quote from: Myndfyre on June 20, 2004, 12:59 PMIF the last DWORD is NOT 0x00000000 (no clan)
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?
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

MyndFyre

#5
Quote from: tA-Kane on June 21, 2004, 10:59 AM
Quote from: Myndfyre on June 20, 2004, 12:59 PMIF the last DWORD is NOT 0x00000000 (no clan)
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?

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

tA-Kane

#6
Quote from: Myndfyre on June 21, 2004, 12:15 PMHowever, I'm not sure that this is your problem.
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:
http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=6036;start=0
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

MyndFyre

Quote from: tA-Kane on June 21, 2004, 01:59 PM
Quote from: Myndfyre on June 21, 2004, 12:15 PMHowever, I'm not sure that this is your problem.
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:
http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=6036;start=0

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")?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Soul Taker

Quote from: Myndfyre on June 21, 2004, 02:35 PM
Quote from: tA-Kane on June 21, 2004, 01:59 PM
Quote from: Myndfyre on June 21, 2004, 12:15 PMHowever, I'm not sure that this is your problem.
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:
http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=6036;start=0

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")?
Sending 0x0a enters chat.  But yes, WAR3 does indeed look incorrect.

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

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

if I recall correct, your so far unsure BYTE[9] is:
FILETIME        time of last game
BYTE              size of the AT team

MyndFyre

Quote from: pandaemonium on June 23, 2004, 03:56 AM
if I recall correct, your so far unsure BYTE[9] is:
FILETIME        time of last game
BYTE              size of the AT team

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.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

tA-Kane

Quote from: Myndfyre on June 21, 2004, 02:35 PMOne, I don't ever SEND 0x0a.  It comes automatically.
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.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com