• Welcome to Valhalla Legends Archive.
 

0x79 problems

Started by Arthas, March 10, 2004, 11:05 PM

Previous topic - Next topic

Arthas

Problem: my decline function works. But my accept function DOSNT.

Decline:
Public Sub Command1_Click()
With pBuffer
   .InsertDWORD c_Cookie
   .InsertNonNTString StrReverse(c_Tag)
   .InsertNTString c_Leader
   .InsertBYTE &H4
   If xMode = 1 Then
       .SendPacket frmMain.sckBnet, &H79
   ElseIf xMode = 2 Then
       .SendPacket frmMain.sckBnet, &H72
   End If
End With
addText "BNET: You have rejected Clan " & Text1.text & "'s invitation.", vbRed
Me.Hide
End Sub


Accept:
Public Sub Command2_Click()
With pBuffer
   .InsertDWORD c_Cookie
   .InsertNonNTString StrReverse(c_Tag)
   .InsertNTString c_Leader
   .InsertBYTE &H6
   If xMode = 1 Then
       .SendPacket frmMain.sckBnet, &H79
   ElseIf xMode = 2 Then
       .SendPacket frmMain.sckBnet, &H72
   End If
End With
addText "BNET: You accepted Clan " & Text1.text & "'s invitation. You are now a member of that clan.", vbGreen
Me.Hide
End Sub

MyndFyre

Quote from: Arthas on March 10, 2004, 11:05 PM
Problem: my decline function works. But my accept function DOSNT.

Decline:
Public Sub Command1_Click()
With pBuffer
   .InsertDWORD c_Cookie
   .InsertNonNTString StrReverse(c_Tag)
   .InsertNTString c_Leader
   .InsertBYTE &H4
   If xMode = 1 Then
       .SendPacket frmMain.sckBnet, &H79
   ElseIf xMode = 2 Then
       .SendPacket frmMain.sckBnet, &H72
   End If
End With
addText "BNET: You have rejected Clan " & Text1.text & "'s invitation.", vbRed
Me.Hide
End Sub


Accept:
Public Sub Command2_Click()
With pBuffer
   .InsertDWORD c_Cookie
   .InsertNonNTString StrReverse(c_Tag)
   .InsertNTString c_Leader
   .InsertBYTE &H6
   If xMode = 1 Then
       .SendPacket frmMain.sckBnet, &H79
   ElseIf xMode = 2 Then
       .SendPacket frmMain.sckBnet, &H72
   End If
End With
addText "BNET: You accepted Clan " & Text1.text & "'s invitation. You are now a member of that clan.", vbGreen
Me.Hide
End Sub



   If xMode = 1 Then
       .SendPacket frmMain.sckBnet, &H79
   ElseIf xMode = 2 Then
       .SendPacket frmMain.sckBnet, &H72
   End If


What's your xMode variable set to?

Also -- damn man, do you name your form variables?  Command1_Click() ?  How about cmdDecline or btnDecline?

Last thought -- is the InsertNonNTString function operating correctly?  I can't recall offhand, but I know with certainty that when a string isn't all four bytes (the DWORD length), the other bytes are zero -- what I can't recall is whether they are at the front or the end of the tag.  So, for example, my tag is AoA, it might end up being sent as:


00 41 6f 41                         . A o A


or it might be sent as


41 6f 41 00                         A o A .


I believe it is the former.  Check your packet buffer class.
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.