Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Arthas on December 28, 2003, 06:35 PM

Title: 0x6c
Post by: Arthas on December 28, 2003, 06:35 PM
.... What is it?
Title: Re:0x6c
Post by: Arta on December 28, 2003, 06:57 PM
Client? Protocol? Context?
Title: Re:0x6c
Post by: UserLoser. on December 28, 2003, 08:16 PM
Assuming you recieved it - Where did you recieve it?  What did you do before you recieved it?  What product, ect... (what Arta said)
Title: Re:0x6c
Post by: Arthas on December 28, 2003, 08:38 PM
Just wondering, I cant find it on bnet docs.

Sent 0x65, later received 0x6c upon login. Clinet = 3raw, protocol?... TCP.
Title: Re:0x6c
Post by: UserLoser. on December 28, 2003, 08:39 PM
That'd be game protocol, 1 = game, 2 = ftp, 3 = chat
Title: Re:0x6c
Post by: Arthas on December 28, 2003, 08:46 PM
battle.net bot development forum, right?....

Nevermind, I made a typo in my code so that when I received split-packets it only parsed the first part of the packet...... Now my bot freezes, yay~!

Here's the code, see if you can tell me what the heck is going wrong here...


       sckBnet.GetData strTemp, vbString
       strBuffer = v1 + strBuffer & strTemp
       While Len(strBuffer) > 4
           lngLen = v2 + Asc(Mid(strBuffer, 3, 1)) + Asc(Mid(strBuffer, 4, 1)) * 256
           If Len(strBuffer) < lngLen Then
               v1 = strBuffer
               v2 = lngLen
               Exit Sub
           End If
           If Not Mid(StrToHex(strBuffer), 1, 2) = "FF" Then
               v1 = strBuffer
               v2 = lngLen
               Exit Sub
           End If
           Parse (Left(strBuffer, lngLen))
           strBuffer = Mid(strBuffer, lngLen + 1)
       Wend
Title: Re:0x6c
Post by: Grok on December 28, 2003, 09:22 PM
Ten gazillion examples of using VB to parse binary network data, battle.net protocol, and we still see code like that.  Hmm.  I advise separating the buffer writing from the buffer reading.  As someone else has pointed out, your While Len(buffer)>4 is a problem.  Some packets are 4 bytes only, and you won't parse them timely.
Title: Re:0x6c
Post by: Arthas on December 28, 2003, 09:57 PM
Maybe I just need a better example...... lol

I changed my while len(buffer) > 4 to >= 4, better?

I need t know of a better method of joining two split packet together. Btw v1 and v2 are public variables for the form I am using this code in.  Any ideas...?