diff options
Diffstat (limited to '')
-rw-r--r-- | source/Protocol/Protocol.h | 1 | ||||
-rw-r--r-- | source/Protocol/Protocol125.cpp | 13 | ||||
-rw-r--r-- | source/Protocol/Protocol125.h | 1 | ||||
-rw-r--r-- | source/Protocol/Protocol16x.cpp | 17 | ||||
-rw-r--r-- | source/Protocol/Protocol16x.h | 1 | ||||
-rw-r--r-- | source/Protocol/ProtocolRecognizer.cpp | 10 | ||||
-rw-r--r-- | source/Protocol/ProtocolRecognizer.h | 1 |
7 files changed, 44 insertions, 0 deletions
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h index ab1b632ff..1a154ea95 100644 --- a/source/Protocol/Protocol.h +++ b/source/Protocol/Protocol.h @@ -60,6 +60,7 @@ public: virtual void SendCollectPickup (const cPickup & a_Pickup, const cPlayer & a_Player) = 0; virtual void SendDestroyEntity (const cEntity & a_Entity) = 0; virtual void SendDisconnect (const AString & a_Reason) = 0; + virtual void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ) = 0; ///< Request the client to open up the sign editor for the sign (1.6+) virtual void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) = 0; virtual void SendEntityHeadLook (const cEntity & a_Entity) = 0; virtual void SendEntityLook (const cEntity & a_Entity) = 0; diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index 5ecb5b172..1f6dcdec9 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -278,6 +278,19 @@ void cProtocol125::SendDisconnect(const AString & a_Reason) + +void cProtocol125::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ) +{ + // This protocol version doesn't support this packet, sign editor is invoked by the client automatically + UNUSED(a_BlockX); + UNUSED(a_BlockY); + UNUSED(a_BlockZ); +} + + + + + void cProtocol125::SendEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) { cCSLock Lock(m_CSPacket); diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h index 2e4f80902..6d0fe2408 100644 --- a/source/Protocol/Protocol125.h +++ b/source/Protocol/Protocol125.h @@ -37,6 +37,7 @@ public: virtual void SendCollectPickup (const cPickup & a_Pickup, const cPlayer & a_Player) override; virtual void SendDestroyEntity (const cEntity & a_Entity) override; virtual void SendDisconnect (const AString & a_Reason) override; + virtual void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ) override; ///< Request the client to open up the sign editor for the sign (1.6+) virtual void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) override; virtual void SendEntityHeadLook (const cEntity & a_Entity) override; virtual void SendEntityLook (const cEntity & a_Entity) override; diff --git a/source/Protocol/Protocol16x.cpp b/source/Protocol/Protocol16x.cpp index 820e71cd9..4e8fd1887 100644 --- a/source/Protocol/Protocol16x.cpp +++ b/source/Protocol/Protocol16x.cpp @@ -43,6 +43,7 @@ enum PACKET_ATTACH_ENTITY = 0x27, PACKET_ENTITY_PROPERTIES = 0x2c, PACKET_WINDOW_OPEN = 0x64, + PACKET_TILE_EDITOR_OPEN = 0x85, PACKET_PLAYER_ABILITIES = 0xca, } ; @@ -84,6 +85,22 @@ void cProtocol161::SendChat(const AString & a_Message) + +void cProtocol161::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ) +{ + cCSLock Lock(m_CSPacket); + WriteByte(PACKET_TILE_EDITOR_OPEN); + WriteByte(0); + WriteInt(a_BlockX); + WriteInt(a_BlockY); + WriteInt(a_BlockZ); + Flush(); +} + + + + + void cProtocol161::SendGameMode(eGameMode a_GameMode) { super::SendGameMode(a_GameMode); diff --git a/source/Protocol/Protocol16x.h b/source/Protocol/Protocol16x.h index 4dba5eab6..077c7958b 100644 --- a/source/Protocol/Protocol16x.h +++ b/source/Protocol/Protocol16x.h @@ -35,6 +35,7 @@ protected: // cProtocol150 overrides: virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity * a_Vehicle) override; virtual void SendChat (const AString & a_Message) override; + virtual void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ) override; ///< Request the client to open up the sign editor for the sign (1.6+) virtual void SendGameMode (eGameMode a_GameMode) override; virtual void SendHealth (void) override; virtual void SendPlayerMaxSpeed(void) override; diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp index de4ccc03e..3cff9789e 100644 --- a/source/Protocol/ProtocolRecognizer.cpp +++ b/source/Protocol/ProtocolRecognizer.cpp @@ -201,6 +201,16 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason) +void cProtocolRecognizer::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ) +{ + ASSERT(m_Protocol != NULL); + m_Protocol->SendEditSign(a_BlockX, a_BlockY, a_BlockZ); +} + + + + + void cProtocolRecognizer::SendEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) { ASSERT(m_Protocol != NULL); diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h index 2179f3b05..1256f38e0 100644 --- a/source/Protocol/ProtocolRecognizer.h +++ b/source/Protocol/ProtocolRecognizer.h @@ -67,6 +67,7 @@ public: virtual void SendCollectPickup (const cPickup & a_Pickup, const cPlayer & a_Player) override; virtual void SendDestroyEntity (const cEntity & a_Entity) override; virtual void SendDisconnect (const AString & a_Reason) override; + virtual void SendEditSign (int a_BlockX, int a_BlockY, int a_BlockZ) override; ///< Request the client to open up the sign editor for the sign (1.6+) virtual void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) override; virtual void SendEntityHeadLook (const cEntity & a_Entity) override; virtual void SendEntityLook (const cEntity & a_Entity) override; |