diff options
author | bibo38 <bibo38@users.noreply.github.com> | 2016-10-12 14:38:45 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-10-12 14:38:45 +0200 |
commit | cb640ffea4a51a10db2e379ada8dc0487378ba09 (patch) | |
tree | 780ff243f439c9663b2f88e5df2805cc503f4f1d /src/Protocol/Protocol19x.cpp | |
parent | Fixed cProjectileEntity double destroy bug (#3397) (diff) | |
download | cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.gz cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.bz2 cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.lz cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.xz cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.tar.zst cuberite-cb640ffea4a51a10db2e379ada8dc0487378ba09.zip |
Diffstat (limited to 'src/Protocol/Protocol19x.cpp')
-rw-r--r-- | src/Protocol/Protocol19x.cpp | 27 |
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); |