summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-03 23:24:22 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-03 23:24:22 +0100
commit6de8c09fe0044f310397ef94457277f7426470e0 (patch)
tree7f680134da1e53cd67fe68c26bc568490ce107cb /src/ClientHandle.cpp
parentMerge remote-tracking branch 'origin/master' into playerimprovements (diff)
downloadcuberite-6de8c09fe0044f310397ef94457277f7426470e0.tar
cuberite-6de8c09fe0044f310397ef94457277f7426470e0.tar.gz
cuberite-6de8c09fe0044f310397ef94457277f7426470e0.tar.bz2
cuberite-6de8c09fe0044f310397ef94457277f7426470e0.tar.lz
cuberite-6de8c09fe0044f310397ef94457277f7426470e0.tar.xz
cuberite-6de8c09fe0044f310397ef94457277f7426470e0.tar.zst
cuberite-6de8c09fe0044f310397ef94457277f7426470e0.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index b0eb27089..3e9e03815 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -230,7 +230,7 @@ void cClientHandle::Authenticate(void)
if (!cRoot::Get()->GetPluginManager()->CallHookPlayerJoined(*m_Player))
{
AString JoinMessage;
- AppendPrintf(JoinMessage, "%s[JOIN] %s%s has joined the game", cChatColor::Yellow.c_str(), cChatColor::White.c_str(), m_Username.c_str());
+ AppendPrintf(JoinMessage, "%s[JOIN] %s%s has joined the game", cChatColor::Yellow.c_str(), cChatColor::White.c_str(), GetUsername().c_str());
cRoot::Get()->BroadcastChat(JoinMessage);
LOGINFO("Player %s has joined the game.", m_Username.c_str());
}
@@ -2461,13 +2461,7 @@ void cClientHandle::SocketClosed(void)
if (m_Username != "") // Ignore client pings
{
- 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());
- }
+ cRoot::Get()->GetPluginManager()->CallHookDisconnect(m_Player, "Player disconnected");
}
Destroy();