Skip to content

Commit 42ccdfe

Browse files
committed
Expand phantom user error information.
The message is still only displayed once but now info about the old and new users will be printed for diaganostic purposes.
1 parent 01dfbe1 commit 42ccdfe

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

trunk/modEvents.bas

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,14 +1102,17 @@ Public Sub Event_UserInChannel(ByVal Username As String, ByVal Flags As Long, By
11021102
UserObj.Queue.Add UserEvent
11031103
Else
11041104
' This is likely a phantom user situation. Remove the old user and replace with this new one.
1105-
Call Event_UserLeaves(Username, Flags, True)
1106-
Set UserObj = New clsUserObj
1107-
UserObj.UserlistWeight = g_Channel.JoinCount
1108-
11091105
If Not g_Channel.HasPhantomUsers Then
1110-
Call frmChat.AddChat(g_Color.ErrorMessageText, "Warning! One or more phantom users have been detected in this channel. The server may be experiencing technical difficulties.")
1106+
Call frmChat.AddChat(g_Color.ErrorMessageText, StringFormat("Warning! Received a presence event for user '{0}', who was already in the channel. Diagnostic info:", UserObj.Name))
1107+
Call frmChat.AddChat(g_Color.ErrorMessageText, StringFormat(" -> Phantom - ping: {0}, flags: {1}, stats: {2}", UserObj.Ping, UserObj.Flags, UserObj.Statstring))
1108+
Call frmChat.AddChat(g_Color.ErrorMessageText, StringFormat(" -> Current - ping: {0}, flags: {1}, stats: {2}", Ping, Flags, Statstring))
1109+
11111110
g_Channel.HasPhantomUsers = True
11121111
End If
1112+
1113+
Call Event_UserLeaves(Username, Flags, True)
1114+
Set UserObj = New clsUserObj
1115+
UserObj.UserlistWeight = g_Channel.JoinCount
11131116
End If
11141117
End If
11151118
End If
@@ -1306,12 +1309,17 @@ Public Sub Event_UserJoins(ByVal Username As String, ByVal Flags As Long, ByVal
13061309
Else
13071310
' If this user is already in the channel, that instance is probably a phantom. Remove them silently.
13081311
If (UserIndex > 0) Then
1309-
Call Event_UserLeaves(Username, Flags, True)
1312+
Set UserObj = g_Channel.Users(UserIndex)
13101313

13111314
If Not g_Channel.HasPhantomUsers Then
1312-
Call frmChat.AddChat(g_Color.ErrorMessageText, "Warning! One or more phantom users have been detected in this channel. The server may be experiencing technical difficulties.")
1315+
Call frmChat.AddChat(g_Color.ErrorMessageText, StringFormat("Warning! Received a join event for user '{0}', who was already in the channel. Diagnostic info:", UserObj.Name))
1316+
Call frmChat.AddChat(g_Color.ErrorMessageText, StringFormat(" -> Phantom - ping: {0}, flags: {1}, stats: {2}", UserObj.Ping, UserObj.Flags, UserObj.Statstring))
1317+
Call frmChat.AddChat(g_Color.ErrorMessageText, StringFormat(" -> Current - ping: {0}, flags: {1}, stats: {2}", Ping, Flags, Statstring))
1318+
13131319
g_Channel.HasPhantomUsers = True
13141320
End If
1321+
1322+
Call Event_UserLeaves(Username, Flags, True)
13151323
End If
13161324

13171325
g_Channel.JoinCount = g_Channel.JoinCount + 1

0 commit comments

Comments
 (0)