summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-26 17:37:19 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-26 17:37:19 +0200
commitd83d6456e8aedf84dcda89eb29d20d8ba834748e (patch)
tree0f1b4b04adc925c425df1728e6efc8a4ccbfbfc8 /src/Protocol/Protocol18x.cpp
parentAdded type checking to map loading. (diff)
downloadcuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.tar
cuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.tar.gz
cuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.tar.bz2
cuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.tar.lz
cuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.tar.xz
cuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.tar.zst
cuberite-d83d6456e8aedf84dcda89eb29d20d8ba834748e.zip
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 896947d03..2ee50bb4a 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -802,7 +802,7 @@ void cProtocol180::SendPlayerListAddPlayer(const cPlayer & a_Player)
Pkt.WriteVarInt(0);
Pkt.WriteVarInt(1);
Pkt.WriteUUID(a_Player.GetUUID());
- Pkt.WriteString(a_Player.GetName());
+ Pkt.WriteString(a_Player.GetPlayerListName());
const Json::Value & Properties = a_Player.GetClientHandle()->GetProperties();
Pkt.WriteVarInt(Properties.size());
@@ -824,17 +824,7 @@ void cProtocol180::SendPlayerListAddPlayer(const cPlayer & a_Player)
Pkt.WriteVarInt((UInt32)a_Player.GetGameMode());
Pkt.WriteVarInt((UInt32)a_Player.GetClientHandle()->GetPing());
-
- AString CustomName = a_Player.GetPlayerListName();
- if (CustomName != a_Player.GetName())
- {
- Pkt.WriteBool(true);
- Pkt.WriteString(Printf("{\"text\":\"%s\"}", CustomName.c_str()));
- }
- else
- {
- Pkt.WriteBool(false);
- }
+ Pkt.WriteBool(false);
}
@@ -885,7 +875,7 @@ void cProtocol180::SendPlayerListUpdatePing(const cPlayer & a_Player)
-void cProtocol180::SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_OldListName)
+void cProtocol180::SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_CustomName)
{
ASSERT(m_State == 3); // In game mode?
@@ -894,15 +884,14 @@ void cProtocol180::SendPlayerListUpdateDisplayName(const cPlayer & a_Player, con
Pkt.WriteVarInt(1);
Pkt.WriteUUID(a_Player.GetUUID());
- AString CustomName = a_Player.GetPlayerListName();
- if (CustomName == a_Player.GetName())
+ if (a_CustomName.empty())
{
Pkt.WriteBool(false);
}
else
{
Pkt.WriteBool(true);
- Pkt.WriteString(Printf("{\"text\":\"%s\"}", CustomName.c_str()));
+ Pkt.WriteString(Printf("{\"text\":\"%s\"}", a_CustomName.c_str()));
}
}