From 2dd823da097e1b39e28343af69e415364eb8ed5c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 18 Dec 2013 22:06:36 +0000 Subject: Disconnection message no longer shown if ping --- src/ClientHandle.cpp | 13 ++++++++----- 1 file 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(); -- cgit v1.2.3