summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
authorFranz Reiter <franzi.moos@googlemail.com>2014-09-23 15:54:07 +0200
committerFranz Reiter <franzi.moos@googlemail.com>2014-09-23 15:54:07 +0200
commit33f8091d5f550a91b1fbe24f07a397aa5a336093 (patch)
tree4fe1be83dd4212e010fed749cd444c4deecc64e6 /src/Protocol/Protocol125.cpp
parentQtBiomeVisualiser: Fixed confusion about Globals.h. (diff)
parentFixed SQLiteCpp downgrade (diff)
downloadcuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.gz
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.bz2
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.lz
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.xz
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.tar.zst
cuberite-33f8091d5f550a91b1fbe24f07a397aa5a336093.zip
Diffstat (limited to 'src/Protocol/Protocol125.cpp')
-rw-r--r--src/Protocol/Protocol125.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index 4378ef466..ba4cfa7ef 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -723,7 +723,7 @@ void cProtocol125::SendPlayerListAddPlayer(const cPlayer & a_Player)
{
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_PLAYER_LIST_ITEM);
- WriteString(a_Player.GetName());
+ WriteString(a_Player.GetPlayerListName());
WriteBool (true);
WriteShort (a_Player.GetClientHandle()->GetPing());
Flush();
@@ -737,7 +737,7 @@ void cProtocol125::SendPlayerListRemovePlayer(const cPlayer & a_Player)
{
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_PLAYER_LIST_ITEM);
- WriteString(a_Player.GetName());
+ WriteString(a_Player.GetPlayerListName());
WriteBool (false);
WriteShort (0);
Flush();
@@ -769,7 +769,7 @@ void cProtocol125::SendPlayerListUpdatePing(const cPlayer & a_Player)
void cProtocol125::SendPlayerListUpdateDisplayName(const cPlayer & a_Player, const AString & a_OldListName)
{
- if (a_OldListName == a_Player.GetName())
+ if (a_OldListName == a_Player.GetPlayerListName())
{
return;
}
@@ -843,7 +843,14 @@ void cProtocol125::SendPlayerSpawn(const cPlayer & a_Player)
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_PLAYER_SPAWN);
WriteInt (a_Player.GetUniqueID());
- WriteString(a_Player.GetName());
+ if (a_Player.HasCustomName())
+ {
+ WriteString(a_Player.GetCustomName());
+ }
+ else
+ {
+ WriteString(a_Player.GetName());
+ }
WriteInt ((int)(a_Player.GetPosX() * 32));
WriteInt ((int)(a_Player.GetPosY() * 32));
WriteInt ((int)(a_Player.GetPosZ() * 32));