• Welcome to Valhalla Legends Archive.
 

MCP 0x17

Started by Tass, November 27, 2005, 04:58 PM

Previous topic - Next topic

Tass

When you request the character list and you do not check for expansion and your on classic, if you try to login with a exp char when ur only on classic key, where in the packet data does it tell you classic or expansion?

LivedKrad

Since I don't have Diablo 2 installed, I can't delve into this any further. However, until I or someone else (or perhaps you?) figure it out, BnetDocs's documentation of the request packet seems to have someone's listed data for each character type. I suppose you could just look for those hex constants until the former is revised?

Hdx

Just note, you cant packet log D2, Nither classic or expansion use 0x17 any more. Both use 0x19. And so should you.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

Tass

I have already packet logged it and I can't find out where or what to parse that's why I'm posting here..

here's what I'v come up with meh

7E 01 17 08 00 08 00 00 00 08 00 54 61 73 73 54 65 73 74 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 81 80 80 80 FF FF FF 00 54 65 73 74 54 65 73 74 45 78 70 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 A1 80 80 80 FF FF FF 00 54 61 73 73 54 65 78 74 48 43 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 85 80 80 80 FF FF FF 00 54 61 73 73 54 65 78 74 48 63 45 78 70 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 A5 80 80 80 FF FF FF 00 54 61 73 73 54 65 73 74 4C 61 64 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 C1 80 80 80 03 FF FF 00 54 61 73 73 54 65 73 74 45 78 70 4C 61 64 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 E1 80 80 80 03 FF FF 00 54 61 73 73 54 65 73 74 41 6C 6C 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 E5 80 80 80 03 FF FF 00 54 61 73 73 54 65 73 74 48 43 4C 41 44 00 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 C5 80 80 80 03 FF FF 00

Classic
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 81 80 80 80 FF FF FF

Expansion
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 A1 80 80 80 FF FF FF

Hardcore Classic
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 85 80 80 80 FF FF FF

Ladder Classic
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 C1 80 80 80 03 FF FF

Hardcore Expansion
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 A5 80 80 80 FF FF FF

Expansion Ladder
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 E1 80 80 80 03 FF FF

Hardcore Expansion Ladder
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 E5 80 80 80 03 FF FF

Hardcore Ladder Classic
Flags: 84 80 FF FF FF FF FF FF FF FF FF FF FF 05 FF FF FF FF FF FF FF FF FF FF FF 01 C5 80 80 80 03 FF FF

Ringo

hmm, i cant seem to find my research on d2 statstrings.
The statstring is exacly the same as the statstring found in BNCS chat event packets (0x0F).
I was making a realm server while back, but never got round to writieng down all the values (i think iago has done some of them already) but it might come in handy for this kinda thing:

Msg = Msg & Chr(&H84) 'unknown
Msg = Msg & Chr(&H80) 'unknown
       
Msg = Msg & Chr(&HFF) 'helm
Msg = Msg & Chr(&HFF) 'chest armor
Msg = Msg & Chr(&HFF) 'leg armor
Msg = Msg & Chr(&HFF) 'Chars right arm armor
Msg = Msg & Chr(&HFF) 'Chars left arm armor
Msg = Msg & Chr(5)    'Chars right hand wepon
Msg = Msg & Chr(&HFF) 'Chars left hand wepon
Msg = Msg & Chr(&H4F) 'Chars left hand shield
Msg = Msg & Chr(&HFF) 'Chars Right sholder pad
Msg = Msg & Chr(&HFF) 'Chars left sholder pad
Msg = Msg & Chr(&HFF) 'unknown
Msg = Msg & Chr(5)    'Char Type
Msg = Msg & Chr(&HFF) 'hair color
Msg = Msg & Chr(&HFF) 'chest color
Msg = Msg & Chr(&HFF) 'Leg Color
Msg = Msg & Chr(&HFF) 'Chars Right arm Color
Msg = Msg & Chr(&HFF) 'Chars Left arm color
Msg = Msg & Chr(&HFF) 'Chars right hand wepon color
Msg = Msg & Chr(&HFF) 'Chars left Hand Wepon color
Msg = Msg & Chr(&HFF) 'Chars left hand shield color
Msg = Msg & Chr(&HFF) 'Chars Right sholder pad color
Msg = Msg & Chr(&HFF) 'Chars left sholder pad Color
Msg = Msg & Chr(&HFF) 'unknown
Msg = Msg & Chr(1)    'Char level
Msg = Msg & Chr(&HE4) 'Char flags
Msg = Msg & Chr(&H80) 'Char flags
Msg = Msg & Chr(&HFF) 'unknown
Msg = Msg & Chr(&HFF) 'unknown
Msg = Msg & Chr(3)    'ladder
Msg = Msg & Chr(&HFF) 'unknown
Msg = Msg & Chr(&HFF) 'unknown

Most/all of the general infomation about the char can be found in the char flags bytes, but to extract the basic infomation from the statstring, you can do it somthing like this:

'SS = the d2 statstring
Dim CharType as integer
Dim CharLvL as Integer
Dim IsHC as Boolean
Dim IsDead as Boolean
Dim IsLadder  as Boolean
CharType = Asc(Mid(SS, 14, 1))
CharLvL = Asc(Mid(SS, 26, 1))
IsHC = Asc(Mid(SS, 27, 1)) And 4
IsDead  = Asc(Mid(SS, 27, 1)) And 8
IsLadder = Asc(Mid(SS, 31, 1)) < &HFF


If i can find the charflag values on my PC, i will post them.
Hope this helps

Tass

I know all this, thank you for posting. But how do you tell if the character is expansion or regular classic? If you try to login on a expansion character on a d2dv cdkey you get temp ipban from MCP :P

LivedKrad

Quote from: LivedKrad.fe on November 27, 2005, 07:27 PM
I suppose you could just look for those hex constants until the former is revised?

http://bnetdocs.valhallalegends.com/content.php?Section=m&Code=102

Also, Hdx is right in saying that the Blizzard-made Diablo 2 client loader cannot be packet logged (due to it being a service). However, simply using another graphics engine loader would suffice to be a useful method to packet log (e.g.: d2loader). I also agree with him when he says you should use the packets that the client uses. When you emulate some protocol, it is best to emulate it as closely as possible so as to keep the connection running happily and smoothly.

Tass

Well you don't even need to packet log d2 or even d2loader because simply you can just send 0x17 or 0x19 and get the flags.. so why do extra work that needed, What I'm saying is I can't figure out where the flags for class/expansion are..

LivedKrad

#8
This will be the third time I've told you. It would seem to me that a quick (but not as emulative) solution would be to check for the hex constants inside of the packet once you receive it. Posts upon posts and replies upon replies on BnetDocs and on the forums have revealed that the flags for each product & character mode are constant. Therefore, you can set up a switch control statement to check for each of these flag constants and act upon them. Since I'm assuming you prefer Visual Basic, I'll give this a try:


Select Case flagsrecv 'make this an Integer type

Case &H8101 'classic
  'act accordingly
Case &HA101 'expansion
  '...

End Select


Edit: BTW, you should know that I set up that switch based on the message dump that you provided. If you're wondering where exactly I got those constants, I simply looked in the location that the flags are supposed to be located based on BnetDocs's information. Your reply says that you can't figure out where the flags are? Why? BnetDocs tells you exactly where they are and so do the comments posted under the message information. You even supplied the correct location for where to find the flags information. Personally, I think this question is answered unless I've done something totally wrong and therefore won't provide anything more.

Ringo

#9
I cant find my research, i will fire up my realm server and get it abit later if you dont understand what LivedKrad was saying.
I think*Classic / LOD flag is 0x40 in d2 statstrings? (or is that realm ladder idk)


[EDIT]:

Dim IsLOD as boolean
IsLOD  = Asc(Mid(SS, 27, 1)) And 32

Its 0x20

Tass

I diden't understand what you were saying.. Now I do  :-\