summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol19x.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/Protocol19x.cpp')
-rw-r--r--src/Protocol/Protocol19x.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/Protocol/Protocol19x.cpp b/src/Protocol/Protocol19x.cpp
index 6791da8cd..6e26b2012 100644
--- a/src/Protocol/Protocol19x.cpp
+++ b/src/Protocol/Protocol19x.cpp
@@ -255,6 +255,16 @@ void cProtocol190::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSetBlockV
+void cProtocol190::SendCameraSetTo(const cEntity & a_Entity)
+{
+ cPacketizer Pkt(*this, 0x36); // Camera Packet (Attach the camera of a player at another entity in spectator mode)
+ Pkt.WriteVarInt32(a_Entity.GetUniqueID());
+}
+
+
+
+
+
void cProtocol190::SendChat(const AString & a_Message, eChatType a_Type)
{
ASSERT(m_State == 3); // In game mode?
@@ -2058,7 +2068,7 @@ bool cProtocol190::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType)
case 0x18: HandlePacketCreativeInventoryAction(a_ByteBuffer); return true;
case 0x19: HandlePacketUpdateSign (a_ByteBuffer); return true;
case 0x1a: HandlePacketAnimation (a_ByteBuffer); return true;
- case 0x1b: break; // Spectate?
+ case 0x1b: HandlePacketSpectate (a_ByteBuffer); return true;
case 0x1c: HandlePacketBlockPlace (a_ByteBuffer); return true;
case 0x1d: HandlePacketUseItem (a_ByteBuffer); return true;
}
@@ -2551,6 +2561,21 @@ void cProtocol190::HandlePacketSlotSelect(cByteBuffer & a_ByteBuffer)
+void cProtocol190::HandlePacketSpectate(cByteBuffer & a_ByteBuffer)
+{
+ AString playerUUID;
+ if (!a_ByteBuffer.ReadUUID(playerUUID))
+ {
+ return;
+ }
+
+ m_Client->HandleSpectate(playerUUID);
+}
+
+
+
+
+
void cProtocol190::HandlePacketSteerVehicle(cByteBuffer & a_ByteBuffer)
{
HANDLE_READ(a_ByteBuffer, ReadBEFloat, float, Sideways);