diff options
author | Mattes D <github@xoft.cz> | 2014-09-26 23:01:22 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-26 23:01:22 +0200 |
commit | 305778f22f00384a7e4228990971e50240040acf (patch) | |
tree | d485462b555c767a13dec9ad0c35d20597546490 /src/Protocol/Protocol18x.cpp | |
parent | Fixed UNUSED macro so that it doesn't require type knowledge. (diff) | |
parent | Merge branch 'master' into Fixes (diff) | |
download | cuberite-305778f22f00384a7e4228990971e50240040acf.tar cuberite-305778f22f00384a7e4228990971e50240040acf.tar.gz cuberite-305778f22f00384a7e4228990971e50240040acf.tar.bz2 cuberite-305778f22f00384a7e4228990971e50240040acf.tar.lz cuberite-305778f22f00384a7e4228990971e50240040acf.tar.xz cuberite-305778f22f00384a7e4228990971e50240040acf.tar.zst cuberite-305778f22f00384a7e4228990971e50240040acf.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index 9f7569ff2..a2dbb7a1f 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())); } } |