summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-06 00:24:16 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-06 00:24:16 +0100
commitaa8b46e94714f261bfe451897b7ef23934e764eb (patch)
treea0a0e7bb1ef59f79a147260a2c8c73752203bf80 /src/ClientHandle.cpp
parentAdded more chat functions (diff)
downloadcuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.tar
cuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.tar.gz
cuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.tar.bz2
cuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.tar.lz
cuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.tar.xz
cuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.tar.zst
cuberite-aa8b46e94714f261bfe451897b7ef23934e764eb.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 439f980ce..f7c6cb734 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -225,9 +225,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(), GetUsername().c_str());
- cRoot::Get()->BroadcastChat(JoinMessage);
+ cRoot::Get()->BroadcastChatJoin(Printf("%s has joined the game", GetUsername().c_str()));
LOGINFO("Player %s has joined the game.", m_Username.c_str());
}
@@ -568,7 +566,7 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
{
if (a_Length < 14)
{
- SendChat(Printf("%s[INFO]%s Failure setting command block command; bad request", cChatColor::Red.c_str(), cChatColor::White.c_str()));
+ SendChat(AppendChatEpithet("Failure setting command block command; bad request", mtFailure));
LOGD("Malformed MC|AdvCdm packet.");
return;
}
@@ -598,7 +596,7 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
default:
{
- SendChat(Printf("%s[INFO]%s Failure setting command block command; unhandled mode", cChatColor::Red.c_str(), cChatColor::White.c_str()));
+ SendChat(AppendChatEpithet("Failure setting command block command; unhandled mode", mtFailure));
LOGD("Unhandled MC|AdvCdm packet mode.");
return;
}
@@ -609,12 +607,12 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
if (World->AreCommandBlocksEnabled())
{
World->SetCommandBlockCommand(BlockX, BlockY, BlockZ, Command);
-
- SendChat(Printf("%s[INFO]%s Successfully set command block command", cChatColor::Green.c_str(), cChatColor::White.c_str()));
+
+ SendChat(AppendChatEpithet("Successfully set command block command", mtSuccess));
}
else
{
- SendChat(Printf("%s[INFO]%s Command blocks are not enabled on this server", cChatColor::Yellow.c_str(), cChatColor::White.c_str()));
+ SendChat(AppendChatEpithet("Command blocks are not enabled on this server", mtFailure));
}
}