summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorjfhumann <j.f.humann@gmail.com>2014-04-18 21:09:44 +0200
committerjfhumann <j.f.humann@gmail.com>2014-04-18 21:09:44 +0200
commit013da806ec20b62a742aded9a9d2b8131193f30d (patch)
treebfe1f833f93cd4a57619fa149f5f9075a28862e2 /src/ClientHandle.cpp
parentProtoProxy: Added 1.7.9 compatibility. (diff)
downloadcuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.gz
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.bz2
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.lz
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.xz
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.tar.zst
cuberite-013da806ec20b62a742aded9a9d2b8131193f30d.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 5876e55c7..c0df49827 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -412,14 +412,16 @@ void cClientHandle::HandlePing(void)
{
// Somebody tries to retrieve information about the server
AString Reply;
+ cServer * Server = cRoot::Get()->GetServer();
+
Printf(Reply, "%s%s%i%s%i",
- cRoot::Get()->GetServer()->GetDescription().c_str(),
+ Server->GetDescription().c_str(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetServer()->GetNumPlayers(),
+ Server->GetNumPlayers(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetServer()->GetMaxPlayers()
+ Server->GetMaxPlayers()
);
- Kick(Reply.c_str());
+ Kick(Reply);
}
@@ -1171,12 +1173,12 @@ void cClientHandle::HandleChat(const AString & a_Message)
cCompositeChat Msg;
AString Color = m_Player->GetColor();
if (Color.length() == 3)
- {
+ {
Color = AString("@") + Color[2];
}
else
- {
- Color.empty();
+ {
+ Color.clear();
}
Msg.AddTextPart(AString("<") + m_Player->GetName() + "> ", Color);
Msg.ParseText(a_Message);
@@ -1678,7 +1680,7 @@ void cClientHandle::Tick(float a_Dt)
// Send a ping packet:
cTimer t1;
- if ((m_LastPingTime + cClientHandle::PING_TIME_MS <= t1.GetNowTime()))
+ if (m_LastPingTime + cClientHandle::PING_TIME_MS <= t1.GetNowTime())
{
m_PingID++;
m_PingStartTime = t1.GetNowTime();