Im confused on packet &H66 Freinds Update packet.
I got down the flags and location but Product doesn't seem to be the freinds product, but mine, am i wrong? My friend is using SEXP and im using W3XP...
9 1 2 PX3W op nowhere
-------------------------------
9 = ninth place in friends place
1 = flags
2 = location
PX3W = my product i belive
op nowhere = channel freind joined
You should only recieve this when a mutual friend exits or enters Battle.net, and the product should be your friends product, not yours
Well i didn't find a Solution but I made it where if you click the tab where the freinds list is , it would re-send packet 65 and all is fine.
This is for packet &H65
Public Function GetFList(data As String)
Form1.LvMonitor.ListItems.Clear
Dim nothin() As String
Dim x As Integer
nothin = Split(Mid$(data, 6), Chr(0), -1)
For x = 0 To UBound(nothin)
If Not nothin(x) = "" Then
Select Case Mid(nothin(x), 3, 4) ' Mutual
Case GetProd(Mid(nothin(x), 3, 4))
Form1.LvMonitor.ListItems(Form1.LvMonitor.ListItems.count).SmallIcon = GetIcon(Mid(nothin(x), 3, 4))
Form1.LvMonitor.ListItems(Form1.LvMonitor.ListItems.count).ToolTipText = PFlags(Asc(Mid(nothin(x), 1, 1))) & PLcn(Asc(Mid(nothin(x), 2, 1))) & Mid(nothin(x), 7)
Case Else
Select Case Mid(nothin(x), 2, 4) ' not Mutual
Case GetProd(Mid(nothin(x), 2, 4))
Form1.LvMonitor.ListItems(Form1.LvMonitor.ListItems.count).SmallIcon = GetIcon(Mid(nothin(x), 2, 4))
Form1.LvMonitor.ListItems(Form1.LvMonitor.ListItems.count).ToolTipText = PFlags(Asc(Mid(nothin(x), 1, 1))) & PLcn(Asc(Mid(nothin(x), 2, 1))) & Mid(nothin(x), 6)
Case Else
Form1.LvMonitor.ListItems.Add , , nothin(x)
Form1.LvMonitor.ListItems(Form1.LvMonitor.ListItems.count).ToolTipText = "Offline"
End Select
End Select
End If
Next x
End Function
Here are the three subs plcn, pflags and geticon
Public Function PFlags(data As Integer) As String
Select Case data
Case 1: PFlags = "(Mutual) "
Case 2: PFlags = "In Private Channel "
Case 3: PFlags = "In Game: "
Case 4: PFlags = "(Away) "
Case 7: PFlags = "(Do Not Disturb Mode) "
End Select
end function
Public Function PLcn(data As Integer) As String
Select Case data
Case 1: PLcn = "? " ' i have no clue what this is
Case 2: PLcn = "Channel: "
Case 3: PLcn = "Game: "
End Select
End Function
Public Function GetIcon(Icon As String) As Integer
Select Case Icon
Case "NB2W": GetIcon = ICON_W2BN
Case "3RAW": GetIcon = ICON_WAR3
Case "THAC": GetIcon = ICON_CHAT
Case "PXES": GetIcon = ICON_SEXP
Case "PX3W": GetIcon = ICON_WAR3X
Case "PX2D": GetIcon = ICON_D2XP
Case "RATS": GetIcon = ICON_STAR
Case "RTSJ": GetIcon = ICON_JSTR
Case "RHSS": GetIcon = ICON_SSHR
Case "VD2D": GetIcon = ICON_D2DV
Case "RHSD": GetIcon = ICON_DSHR
End Select
End Function
Public Function GetProd(data As String) As String
Select Case data
Case "NB2W": GetProd = "NB2W"
Case "3RAW": GetProd = "3RAW"
Case "THAC": GetProd = "THAC"
Case "PXES": GetProd = "PXES"
Case "PX3W": GetProd = "PX3W"
Case "PX2D": GetProd = "PX2D"
Case "RATS": GetProd = "RATS"
Case "RTSJ": GetProd = "RTSJ"
Case "RHSS": GetProd = "RHSS"
Case "VD2D": GetProd = "VD2D"
Case "RHSD": GetProd = "RHSD"
Case Else: GetProd = ""
End Select
End Function
Go go Suggestions, errors, comments!
Edit: Forgot getprod function.
Quote from: ___/\___ on October 29, 2003, 11:41 PM
Go go Suggestions, errors, comments!
One concern with your just sending 0x65 when the tab is selected: what if the user finds a way to very rapidly select/deselect the tab, thereby sending 0x65 many times in quick succession? This could theoretically get them banned just for switching between windows too often. I'd suggest some sort of internal limit that it not send 0x65 unless the last one was sent more than X seconds ago.