diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-18 23:06:36 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-12-18 23:06:36 +0100 |
commit | 2dd823da097e1b39e28343af69e415364eb8ed5c (patch) | |
tree | 63186c2bbc3840e120550eaba32f7baa2a55d2a9 /src | |
parent | Prettified command error messages (diff) | |
download | cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.tar cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.tar.gz cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.tar.bz2 cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.tar.lz cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.tar.xz cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.tar.zst cuberite-2dd823da097e1b39e28343af69e415364eb8ed5c.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/ClientHandle.cpp | 13 |
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(); |