• January 27, 2023, 10:47:17 pm

Author Topic: VB6 Bnet packet Recv 0x79 problem..  (Read 2100 times)

ben_fb

  • Addict
  • *****
  • Posts: 246
VB6 Bnet packet Recv 0x79 problem..
« on: August 16, 2010, 02:11:43 pm »
[RESOLVED]


Someone told me that a&o wasn't receiving 0x79 proper so I looked into it...

ClanArray() is a string
for the first two GetDWord(s) some reason it's returning numeric values rather than the string. The package is being received right as you can see in the code below, and the structure is as bnetdocs claims.


Code:
Code: [Select]
  With PBuffer
    aProfile(Index).ClanArray(0) = .GetDWORD 'cookie
    aProfile(Index).ClanArray(1) = .GetDWORD '.GetDWORD 'tag
    aProfile(Index).ClanArray(2) = .GetNTstring 'clan name
    aProfile(Index).ClanArray(3) = .GetNTstring 'clan leader/inviter
  End With
 
  AddChat 0, Index, &H8000&, GetSTRING(110), vbGreen, StrReverse$(KillNull(aProfile(Index).ClanArray(1))), &H8000&, GetSTRING(111)
  '~~~~~~~~~~~~~                     'Clan joining invitation recieved, tag                  '. Type /accept to join the clan.

Code: [Select]
Public Function GetDWORD(Optional Data As String) As Long
Dim lReturn As Long
   
    If LenB(Data) Then
      Call CopyMemory(lReturn, ByVal Left$(Data, 4), 4)
      GetDWORD = lReturn
    'read from supplied
    Else
      Call CopyMemory(lReturn, ByVal Left$(RecvBuffer, 4), 4)
      GetDWORD = lReturn
      RecvBuffer = Mid$(RecvBuffer, 5)
    'read from recv packet
    End If
   
End Function

Code: [Select]
[1] &H79 -in-> F
  à  ‘       D  i  o  V  J  E  R  E  L  I  S  N  O  O  B     S  h  i  n  e  [  v  D  ]   
 E0 18 11 00 44 69 6F 56 4A 45 52 45 4C 49 53 4E 4F 4F 42 00 53 68 69 6E 65 5B 76 44 5D 00

« Last Edit: August 16, 2010, 06:55:59 pm by ben_fb »

Mesiah

  • Addict
  • *****
  • Posts: 165
  • Programmer of StonerBot
Re: VB6 Bnet packet Recv 0x79 problem..
« Reply #1 on: August 16, 2010, 03:55:03 pm »
aprofile(index).clanarray(0) = cstr(.getdword)
aprofile(index).clanarray(1) = cstr(.getdword)



and as far as adding it to the display, i can only help if u post your getstring() function

ben_fb

  • Addict
  • *****
  • Posts: 246
Re: VB6 Bnet packet Recv 0x79 problem..
« Reply #2 on: August 16, 2010, 04:25:39 pm »
Still receiving it as...

 [04:26:44] Clan joining invitation received, tag 0202410541. Type /accept to join the clan.

pretty sure thats not the tag :) It doesn't make much sense because it was working in the past, and if I pull the data as a string it displays right. but bnetdocs says its dword..

Also the clanArray(2) and (3) are returning proper values, so its splitting the sections properly but returning the wrong values for (0) and (1). Could it be something is up with copymemory? But if that was the case other dword calls wouldn't work right..
« Last Edit: August 16, 2010, 05:00:05 pm by ben_fb »

Mesiah

  • Addict
  • *****
  • Posts: 165
  • Programmer of StonerBot
Re: VB6 Bnet packet Recv 0x79 problem..
« Reply #3 on: August 17, 2010, 11:21:35 am »
exactly, other dwords would malfunction too. i havnt packetlogged this packet but, if it works as a string, copy it as a string lol

 

newBalance by DzinerStudio