summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-11-10 22:55:42 +0100
committermadmaxoft <github@xoft.cz>2013-11-10 22:58:39 +0100
commit480ff3789bb2e6e99c95a1861672680a73c4c8fa (patch)
tree7856403237e24846e0f68fbcd7f36cc03ecc543b /source
parentProtoProxy: Added dblquotes. (diff)
downloadcuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.tar
cuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.tar.gz
cuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.tar.bz2
cuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.tar.lz
cuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.tar.xz
cuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.tar.zst
cuberite-480ff3789bb2e6e99c95a1861672680a73c4c8fa.zip
Diffstat (limited to '')
-rw-r--r--source/Protocol/Protocol17x.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/Protocol/Protocol17x.cpp b/source/Protocol/Protocol17x.cpp
index 5022d6dbc..78a55ccc0 100644
--- a/source/Protocol/Protocol17x.cpp
+++ b/source/Protocol/Protocol17x.cpp
@@ -215,7 +215,7 @@ void cProtocol172::SendDestroyEntity(const cEntity & a_Entity)
void cProtocol172::SendDisconnect(const AString & a_Reason)
{
cPacketizer Pkt(*this, 0x40);
- Pkt.WriteString(a_Reason);
+ Pkt.WriteString(EscapeString(a_Reason));
}
@@ -503,7 +503,7 @@ void cProtocol172::SendPlayerListItem(const cPlayer & a_Player, bool a_IsOnline)
cPacketizer Pkt(*this, 0x38); // Playerlist Item packet
Pkt.WriteString(a_Player.GetName());
Pkt.WriteBool(a_IsOnline);
- Pkt.WriteShort(a_Player.GetClientHandle()->GetPing());
+ Pkt.WriteShort(a_IsOnline ? a_Player.GetClientHandle()->GetPing() : 0);
}
@@ -564,7 +564,7 @@ void cProtocol172::SendPlayerSpawn(const cPlayer & a_Player)
{
// Called to spawn another player for the client
cPacketizer Pkt(*this, 0x0c); // Spawn Player packet
- Pkt.WriteInt(a_Player.GetUniqueID());
+ Pkt.WriteVarInt(a_Player.GetUniqueID());
Pkt.WriteString(Printf("%d", a_Player.GetUniqueID())); // TODO: Proper UUID
Pkt.WriteString(a_Player.GetName());
Pkt.WriteFPInt(a_Player.GetPosX());