• Welcome to Valhalla Legends Archive.
 

VB.Net Connecting to BNLS Problems

Started by BaDDBLooD, June 26, 2004, 02:03 PM

Previous topic - Next topic

BaDDBLooD

Http://www.clan-aod.net/badd/Test.zip

If you go to File > Connect

You should see the problem.. have NO Clue why this happens
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

MyndFyre

#1
After an arduous debugging session (you really should try it some time), I found the cause of your problem.

frmMain.vb:


   Private Sub sckBNLS_onConnect() Handles sckBNLS.onConnect

       AddChat(rtbChat, Color.Green, "BNLS: Connection Established!")

       Dim packet As New BaDDChaT.BNLSPacket(&HE)
       packet.InsertBYTE(&H0)
       sckBNLS.SendData(packet.Data)

   End Sub


Step down into Sub New of BNLSPacket(ByVal Byte)

PacketBuffer.vb:


       Public Sub New(ByVal PacketID As Byte)
           MyBase.New(PacketID, Medium.BNLS)
       End Sub


Looks right.  Go to the base:


       Protected Sub New(ByVal PacketID As Byte, ByVal ServerType As Medium)
           m_packetId = PacketID
           m_medium = ServerType
       End Sub


You forgot to call the parameterless constructor!  This can be corrected by updating your sub (here) to:


       Protected Sub New(ByVal PacketID As Byte, ByVal ServerType As Medium)
 ' LOOK HERE!
           Me.alBuffer = new ArrayList()
           m_packetId = PacketID
           m_medium = ServerType
       End Sub


With as much as I've helped you up to this point, you ought to put my name right around the top of your "thank you" list.  :-P

[edit] And update your buffer so that it's not using ArrayList!  Make a ByteArrayList or something!  That way you don't need to deal with boxing and unboxing the value types of Byte within the ArrayList (because internally it's stored as Object, which is a reference type....  You'll get about 5-8 wasted clock cycles every time you convert between Object and Byte). [/edit]
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.

BaDDBLooD

Don't Worry!

Your gonna be Commented Lots =)
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.