Author | Message | Time |
---|---|---|
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 | June 26, 2004, 7:03 PM |
Myndfyr | After an arduous debugging session (you really should try it some time), I found the cause of your problem. frmMain.vb: [code] 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 [/code] Step down into Sub New of BNLSPacket(ByVal Byte) PacketBuffer.vb: [code] Public Sub New(ByVal PacketID As Byte) MyBase.New(PacketID, Medium.BNLS) End Sub [/code] Looks right. Go to the base: [code] Protected Sub New(ByVal PacketID As Byte, ByVal ServerType As Medium) m_packetId = PacketID m_medium = ServerType End Sub [/code] You forgot to call the parameterless constructor! This can be corrected by updating your sub (here) to: [code] 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 [/code] 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] | June 27, 2004, 7:53 AM |
BaDDBLooD | Don't Worry! Your gonna be Commented Lots =) | June 27, 2004, 3:47 PM |