• Welcome to Valhalla Legends Archive.
 

0x35 handling problems...

Started by LackLuster), August 01, 2005, 12:23 PM

Previous topic - Next topic

LackLuster)

This is probably some newb problem nobody has had, but I am having it, so please don't flame too much -_-.

Anyhoo, I can't get the clan tag out of 0x35 (which is all I want from it, no other information), and I am stumped as to how I should go about this.

Any help is appreciated.

Spht

Welcome to the Botdev forums.

From BnetDocs:

QuoteMessage ID: 0x35
Message Name: SID_PROFILE
Direction: Server -> Client (Received)
Used By: Warcraft III, Warcraft III: TFT
Format:
(DWORD) Cookie
(BYTE) Success
(STRING) Profile\Description value
(STRING) Profile\Location value
(DWORD) Clan Tag

If the status code is 0, the request was successful; otherwise, the lookup failed and the message length will be five bytes long (not counting the four byte header).

Please note: This message's official name is not known, and has been invented.

Although you only want the clan tag, you will still need to check the Cookie so you can assign the appropriate name to the profile data.

If the success code is zero, then one way to get the clan tag is measure the length of the two strings, and add 4 bytes for the Cookie and 1 byte for the Success code to get the position of where the clan tag (4 bytes) starts.  Or you could just extract the last 4 bytes of the packet and call it the clan tag, but I wouldn't recommend using this method in any conventional environment.

LackLuster)

Hm() = Split(Mid(Data, 10), Chr(0))   
Description = Hm(0) 'Subscript out of range...

I don't know...

I kind of suck at this, I want my chat bot to be able to check what clan a user is in, so I can know whether or not to invite them to my clan (if indeed they want to join).

R.a.B.B.i.T

Assuming you're using DM's packetbuffer, and this is in VB:
Tag = GetDWORD(Right(Data, 4))

LackLuster)

Thanks... I am soooo newb, how do I convert that to text...? =/

Hdx

#5
Well it should return a Long, So jsut use Hex() to show the Hex of it..
But, You could jsut use Replace() to get rid fo Chr(0)'s and the reverse it.  But Dont use GetDword() if you do this method.
~-~(HDX)~-~

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

LackLuster)

How should I best go about getting the data without using GetDWORD?

Hdx

Replace(Reverse(Right(Data, 4)), Chr(0), VbNullString)
Compleet enuf for you?
~-~(HDX)~-~

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

MyndFyre

That's not the best way though.

Do what Spht suggested -- get the four bytes following the cookie, success code, and profile strings.  That is the 100% most accurate way of doing it.  Stop having him read from the Right.

And while you're at it, stop feeding him code that doesn't teach him what to do with what he's got.
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.