Added icons to the channel-list. Overhauling 0x0F parser, then probably rewriting 0x51 sender.
EDIT -
0x0F finished. Much more sexy. Seeing as how I love being nice, here it is!
Public Const EID_SHOWUSER As Long = &H1
Public Const EID_JOIN As Long = &H2
Public Const EID_LEAVE As Long = &H3
Public Const EID_WHISPER As Long = &H4
Public Const EID_TALK As Long = &H5
Public Const EID_BROADCAST As Long = &H6
Public Const EID_CHANNEL As Long = &H7
Public Const EID_USERFLAGS As Long = &H9
Public Const EID_WHISPERSENT As Long = &HA
Public Const EID_CHANNELFULL As Long = &HD
Public Const EID_CHANNELDOESNOTEXIST As Long = &HE
Public Const EID_CHANNELISRESTRICTED As Long = &HF
Public Const EID_INFO As Long = &H12
Public Const EID_ERROR As Long = &H13
Public Const EID_EMOTE As Long = &H17
Public Sub Handle0x0F(sPacket As String)
'(DWORD) Event ID
'(DWORD) User's Flags
'(DWORD) Ping
'(DWORD) IP Address (Defunct)
'(DWORD) Account number (Defunct)
'(DWORD) Registration Authority (Defunct)
'(STRING) Username
'(STRING) Text
Dim EID As Long, Flags As Long, Ping as Long, Username As String, Text As String
With PDebuffer
.Buffer = sPacket
EID = .RemoveDWORD
Flags = .RemoveDWORD
Ping = .RemoveDWORD
.RemoveVoid 12 'Skip IP Address, Acct Num, and Registration Authority
Username = .RemoveNTString
Text = .RemoveNTString
End With
Select Case EID
Case EID_SHOWUSER
Call AddChat(frmMain.rtbChat, vbYellow, Username & " is in the channel using " & strReverse(Left(Text, 4)) & ".")
Call ChannelList.AddUser(Username, Flags, Ping, Text)
Case EID_JOIN
Call AddChat(frmMain.rtbChat, vbYellow, Username & " has joined the channel using " & strReverse(Left(Text, 4)) & ".")
Call ChannelList.AddUser(Username, Flags, Ping, Text)
Case EID_LEAVE
Call AddChat(frmMain.rtbChat, vbYellow, Username & " has left the channel.")
Call ChannelList.RemoveUser(Username)
Case EID_WHISPER
Call AddChat(frmMain.rtbChat, vbWhite, Username & " whispers: " & Text)
Case EID_BROADCAST
Call AddChat(frmMain.rtbChat, vbYellow, "Server Broadcast: ", vbWhite, Text)
Case EID_CHANNEL
Call AddChat(frmMain.rtbChat, vbGreen, "Joined channel " & Text)
ChannelList.ChannelName = Text
ChannelList.Clear
Case EID_USERFLAGS
'TODO
Case EID_WHISPERSENT
Call AddChat(frmMain.rtbChat, vbWhite, "You whisper to " & Username & ": " & Text)
Case EID_CHANNELFULL
Call AddChat(frmMain.rtbChat, vbRed, "That channel is full.")
Case EID_CHANNELDOESNOTEXIST
Call AddChat(frmMain.rtbChat, vbRed, "That channel doesn't exist.")
Case EID_CHANNELISRESTRICTED
Call AddChat(frmMain.rtbChat, vbRed, "That channel is restricted.")
Case EID_INFO
Call AddChat(frmMain.rtbChat, vbCyan, Text)
Case EID_ERROR
Call AddChat(frmMain.rtbChat, vbRed, Text)
End Select
End Sub