Function DataParsing(ByRef strData As String, ByRef Index As Short) As Object
On Error Resume Next
Dim Command_Renamed, Info As String
Dim i As Short
Command_Renamed = VB.Left(strData, InStr(strData, " ") - 1)
Info = VB.Right(strData, Len(strData) - InStr(strData, " "))
Dim User, UserText As String
Dim UserE As Boolean
Select Case Command_Renamed
Case "Message"
For i = 1 To wskServer().UBound
Call wskServer(i).SendData("Message " & Info)
System.Windows.Forms.Application.DoEvents()
Next i
Case "Join"
If CheckUsername(Info) = True Then
Call wskServer(Index).SendData("ErrUsername " & Info)
System.Windows.Forms.Application.DoEvents()
Return ""
Exit Function
End If
Num = Num + 1
lblCount.Text = CStr(Num)
Call lstUsers.Items.Add(Info)
strUsers(Index) = Info
System.Windows.Forms.Application.DoEvents()
For i = 0 To lstUsers.Items.Count
If Me.lstUsers.Items(i) <> "" Then
Call wskServer(Index).SendData("UserList " & lstUsers.Items(i))
System.Windows.Forms.Application.DoEvents()
System.Windows.Forms.Application.DoEvents()
End If
System.Windows.Forms.Application.DoEvents()
Next i
System.Windows.Forms.Application.DoEvents()
'Call wskServer(Index).SendData("Welcome " & txtName.Text)
'System.Windows.Forms.Application.DoEvents()
'Call wskServer(Index).SendData("Msgday " & txtMessage.Text)
' System.Windows.Forms.Application.DoEvents()
'UPGRADE_WARNING: Couldn't resolve default property of object wskServer().UBound. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For i = 1 To wskServer().UBound
If Not i = Index Then
Call wskServer(i).SendData("Joined " & Info)
System.Windows.Forms.Application.DoEvents()
End If
System.Windows.Forms.Application.DoEvents()
Next i
Case "Leave"
'UPGRADE_WARNING: Couldn't resolve default property of object wskServer().UBound. Click for more: 'ms-help://MS.VSCC.v90/dv_commoner/local/redirect.htm?keyword="6A50421D-15FE-4896-8A1B-2EC21E9037B2"'
For i = 1 To wskServer().UBound
If Not i = Index Then
Call wskServer(i).SendData("Left " & Info)
System.Windows.Forms.Application.DoEvents()
End If
System.Windows.Forms.Application.DoEvents()
Next i
For i = 0 To lstUsers.Items.Count
If Me.lstUsers.Items(i) = Info Then
Call lstUsers.Items.RemoveAt(i)
System.Windows.Forms.Application.DoEvents()
End If
System.Windows.Forms.Application.DoEvents()
Next i
System.Windows.Forms.Application.DoEvents()
If CheckUnKick(Info) = True Then
For i = 0 To lstUnKickable.Items.Count
If Me.lstUsers.Items(i) = Info Then
Call lstUnKickable.Items.RemoveAt(i)
System.Windows.Forms.Application.DoEvents()
End If
Next i
End If
strUsers(Index) = ""
Num = Num - 1
If Num < CDbl("0") Then Num = CInt("0")
lblCount.Text = CStr(Num)
wskServer(Index).Close()
End Select
End Function