summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol_1_8.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-08-25 14:43:18 +0200
committerAlexander Harkness <me@bearbin.net>2017-08-25 14:43:18 +0200
commitf4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7 (patch)
tree70139b1ad7ed221e4b75c3a9e247b337de68eb07 /src/Protocol/Protocol_1_8.cpp
parentcompile.sh update. Fixed -d and -n, intelligent thread choice (#3960) (diff)
downloadcuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.tar
cuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.tar.gz
cuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.tar.bz2
cuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.tar.lz
cuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.tar.xz
cuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.tar.zst
cuberite-f4f2fc7c3d76eb3dc5a91c5eefb36c10597d6cb7.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol_1_8.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 3e2f084c7..42e69fd43 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -22,6 +22,7 @@ Implements the 1.8 protocol classes:
#include "../StringCompression.h"
#include "../CompositeChat.h"
#include "../Statistics.h"
+#include "../UUID.h"
#include "../WorldStorage/FastNBT.h"
#include "../WorldStorage/EnchantmentSerializer.h"
@@ -118,7 +119,11 @@ cProtocol_1_8_0::cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_Ser
LOGD("Player at %s connected via BungeeCord", Params[1].c_str());
m_ServerAddress = Params[0];
m_Client->SetIPString(Params[1]);
- m_Client->SetUUID(cMojangAPI::MakeUUIDShort(Params[2]));
+
+ cUUID UUID;
+ UUID.FromString(Params[2]);
+ m_Client->SetUUID(UUID);
+
m_Client->SetProperties(Params[3]);
}
@@ -705,7 +710,7 @@ void cProtocol_1_8_0::SendLoginSuccess(void)
{
cPacketizer Pkt(*this, 0x02); // Login success packet
- Pkt.WriteString(cMojangAPI::MakeUUIDDashed(m_Client->GetUUID()));
+ Pkt.WriteString(m_Client->GetUUID().ToLongString());
Pkt.WriteString(m_Client->GetUsername());
}
}
@@ -1071,7 +1076,7 @@ void cProtocol_1_8_0::SendPlayerSpawn(const cPlayer & a_Player)
// Called to spawn another player for the client
cPacketizer Pkt(*this, 0x0c); // Spawn Player packet
Pkt.WriteVarInt32(a_Player.GetUniqueID());
- Pkt.WriteUUID(cMojangAPI::MakeUUIDShort(a_Player.GetUUID()));
+ Pkt.WriteUUID(a_Player.GetUUID());
Pkt.WriteFPInt(a_Player.GetPosX());
Pkt.WriteFPInt(a_Player.GetPosY() + 0.001); // The "+ 0.001" is there because otherwise the player falls through the block they were standing on.
Pkt.WriteFPInt(a_Player.GetPosZ());
@@ -2551,7 +2556,7 @@ void cProtocol_1_8_0::HandlePacketSlotSelect(cByteBuffer & a_ByteBuffer)
void cProtocol_1_8_0::HandlePacketSpectate(cByteBuffer &a_ByteBuffer)
{
- AString playerUUID;
+ cUUID playerUUID;
if (!a_ByteBuffer.ReadUUID(playerUUID))
{
return;
@@ -3183,7 +3188,7 @@ void cProtocol_1_8_0::WriteBlockEntity(cPacketizer & a_Pkt, const cBlockEntity &
// The new Block Entity format for a Mob Head. See: https://minecraft.gamepedia.com/Head#Block_entity
Writer.BeginCompound("Owner");
- Writer.AddString("Id", MobHeadEntity.GetOwnerUUID());
+ Writer.AddString("Id", MobHeadEntity.GetOwnerUUID().ToShortString());
Writer.AddString("Name", MobHeadEntity.GetOwnerName());
Writer.BeginCompound("Properties");
Writer.BeginList("textures", TAG_Compound);