• Welcome to Valhalla Legends Archive.
 

Packet 0x7D Information

Started by Arthas, February 04, 2004, 09:19 PM

Previous topic - Next topic

Arthas

I have no problems peiceing the split packets together, but I am a newbie with the GetDword function. So now I use this(Dont laugh, I laughed too much at it):

           'Recieve Clan list
           If ClanRoomList.ListItems.Count > 0 Then ClanRoomList.ListItems.Clear
           Dim X As Integer, xS As Integer, vS As Integer, splClanList() As String, strClan As String
           splClanList = Split(Mid$(data, 6), Chr(0), -1)

           For X = 0 To UBound(splClanList)
               If Not Len(splClanList(X)) = 0 Then
                   If Not Mid(StrToHex(splClanList(X)), 1, 1) = "0" Or splClanList(X) = "" Then

                       If Mid(StrToHex(splClanList(X + 1)), 1, 2) = "04" Then
                           strUser = Mid(splClanList(X), 2, Len(splClanList(X)))
                       Else
                           strUser = splClanList(X)
                       End If

                       If Not Mid(StrToHex(splClanList(X + 1)), 1, 1) = "0" Then
                           If splClanList(X + 2) = "" Then
                               usrFlag = "0000"
                               With ClanRoomList
                                   .ListItems.Add .ListItems.Count + 1, , , , GetW3ClanIconCode(usrFlag, True)
                                   .ListItems(.ListItems.Count).ListSubItems.Add 1, , , GetW3ClanIconCode(usrFlag, False)
                                   .ListItems(.ListItems.Count).ListSubItems.Add 2, , strUser
                               End With
                           End If
                       End If
                   Else
                       usrFlag = StrToHex(splClanList(X))
                       If usrFlag = "01" Then usrFlag = "0101"
                       Select Case GetW3ClanIconCode(usrFlag, True)
                           Case "66"
                               nInd67 = nInd67 + 1
                               nInd68 = nInd68 + 1
                               nIndElse = nIndElse + 1
                               vS = nInd66
                           Case "67"
                               nInd68 = nInd68 + 1
                               nIndElse = nIndElse + 1
                               vS = nInd67
                           Case "68"
                               nIndElse = nIndElse + 1
                               vS = nInd68
                           Case Else
                               vS = nIndElse
                       End Select
                       ClanRoomList.ListItems.Add vS, , , , GetW3ClanIconCode(usrFlag, True)
                       ClanRoomList.ListItems(vS).ListSubItems.Add 1, , , GetW3ClanIconCode(usrFlag, False)
                       ClanRoomList.ListItems(vS).ListSubItems.Add 2, , strUser
                   End If
               End If
           Next X
           nInd66 = 1
           nInd67 = 1
           nInd68 = 1
           nIndElse = 1

nInd** is just list values to sort the peons//grunts//shamans//cheiftains from greatest rank to least rank.

The code for GetW3ClanIconCode:

Public Function GetW3ClanIconCode(ByVal Flag As String, Online As Boolean)
If Online Then
   Select Case Mid$(Flag, 1, 2)
       Case "04": GetW3ClanIconCode = 66
       Case "03": GetW3ClanIconCode = 67
       Case "02": GetW3ClanIconCode = 68
       Case "01": GetW3ClanIconCode = 69
       Case Else
           GetW3ClanIconCode = 69
   End Select
Else
   Select Case Mid$(Flag, 3, 2)
       Case "04": GetW3ClanIconCode = 70
       Case "03": GetW3ClanIconCode = 70
       Case "02": GetW3ClanIconCode = 70
       Case "01": GetW3ClanIconCode = 71
       Case Else
           GetW3ClanIconCode = 70
   End Select
End If
End Function


Feel free to laugh :P I'd appreciate information on a new way of parsing this list, same with the friends list. Thanks...

MyndFyre

I'm using Pocket Internet Explorer on my iPaq right now, so it's somewhat difficult to evaluate your code.  However, in my generally limited experience, you don't need to put packets together.  I've never lost anybody on the list.

That said, there is a limit Bnet will send in a single packet.  However, I just fire off an event when it receives the packet, and any clan members are added to the list.

Since my clan isn't full, that could be the case.  But I haven't yet had to deal with problems such as putting the clan list together.
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.

Zakath

You definitely need to be able to "piece packets together," as Arthas puts it. You can and will receive partial packets on occasion. If you're lucky, you can still get some sort of functionality out of it even if you're losing packets, but more likely something will break.

So he's justified in talking about putting pieces of packets together, because it is something that must be dealt with.
Quote from: iago on February 02, 2005, 03:07 PM
Yes, you can't have everybody...contributing to the main source repository.  That would be stupid and create chaos.

Opensource projects...would be dumb.

o.OV

Quote from: Myndfyre on February 06, 2004, 10:49 AM
I'm using Pocket Internet Explorer on my iPaq right now, so it's somewhat difficult to evaluate your code.  However, in my generally limited experience, you don't need to put packets together.  I've never lost anybody on the list.

That said, there is a limit Bnet will send in a single packet.  However, I just fire off an event when it receives the packet, and any clan members are added to the list.

Since my clan isn't full, that could be the case.  But I haven't yet had to deal with problems such as putting the clan list together.

If you need an example of Packets coming in two parts instead of a Whole.. you should packet log while a flood is in progress..

Or you could visit Brood War Ladder on Asia/West at busy hours.. lol..
If the facts don't fit the theory, change the facts. - Albert Einstein