summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ClientHandle.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index c9f4854c6..9550e3afe 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -2290,12 +2290,15 @@ void cClientHandle::SocketClosed(void)
LOGD("Player %s @ %s disconnected", m_Username.c_str(), m_IPString.c_str());
- if (!cRoot::Get()->GetPluginManager()->CallHookDisconnect(m_Player, "Player disconnected"))
+ if (m_Username != "") // Ignore client pings
{
- AString DisconnectMessage;
- Printf(DisconnectMessage, "%s[LEAVE] %s%s has left the game", cChatColor::Yellow.c_str(), cChatColor::White.c_str(), m_Username.c_str());
- cRoot::Get()->BroadcastChat(DisconnectMessage);
- LOGINFO("Player %s has left the game.", m_Username.c_str());
+ if (!cRoot::Get()->GetPluginManager()->CallHookDisconnect(m_Player, "Player disconnected"))
+ {
+ AString DisconnectMessage;
+ Printf(DisconnectMessage, "%s[LEAVE] %s%s has left the game", cChatColor::Yellow.c_str(), cChatColor::White.c_str(), m_Username.c_str());
+ cRoot::Get()->BroadcastChat(DisconnectMessage);
+ LOGINFO("Player %s has left the game.", m_Username.c_str());
+ }
}
Destroy();