diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-03 20:05:11 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-03 20:05:11 +0100 |
commit | 01b24d73eab6b0e708063d82f01ea9bb9296550c (patch) | |
tree | 6646ddda7a137b8960484b9fa2614683545e756a /source/Protocol | |
parent | Simulators are woken up upon chunk load (diff) | |
download | cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.gz cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.bz2 cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.lz cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.xz cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.tar.zst cuberite-01b24d73eab6b0e708063d82f01ea9bb9296550c.zip |
Diffstat (limited to 'source/Protocol')
-rw-r--r-- | source/Protocol/Protocol.h | 1 | ||||
-rw-r--r-- | source/Protocol/Protocol125.cpp | 14 | ||||
-rw-r--r-- | source/Protocol/Protocol125.h | 1 | ||||
-rw-r--r-- | source/Protocol/ProtocolRecognizer.cpp | 10 | ||||
-rw-r--r-- | source/Protocol/ProtocolRecognizer.h | 1 |
5 files changed, 27 insertions, 0 deletions
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h index 876ab51f5..7a3270541 100644 --- a/source/Protocol/Protocol.h +++ b/source/Protocol/Protocol.h @@ -50,6 +50,7 @@ public: virtual void DataReceived(const char * a_Data, int a_Size) = 0;
// Sending stuff to clients (alphabetically sorted):
+ virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity * a_Vehicle) = 0;
virtual void SendBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType) = 0;
virtual void SendBlockBreakAnim (int a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage) = 0;
virtual void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) = 0;
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index 4fef5623e..72a1d3b0c 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -63,6 +63,7 @@ enum PACKET_ENT_TELEPORT = 0x22,
PACKET_ENT_HEAD_LOOK = 0x23,
PACKET_ENT_STATUS = 0x26,
+ PACKET_ATTACH_ENTITY = 0x27,
PACKET_METADATA = 0x28,
PACKET_PRE_CHUNK = 0x32,
PACKET_MAP_CHUNK = 0x33,
@@ -122,6 +123,19 @@ cProtocol125::cProtocol125(cClientHandle * a_Client) : +void cProtocol125::SendAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_ATTACH_ENTITY);
+ WriteInt(a_Entity.GetUniqueID());
+ WriteInt((a_Vehicle == NULL) ? -1 : a_Vehicle->GetUniqueID());
+ Flush();
+}
+
+
+
+
+
void cProtocol125::SendBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType)
{
UNUSED(a_BlockType);
diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h index ad50c5796..b3dd79069 100644 --- a/source/Protocol/Protocol125.h +++ b/source/Protocol/Protocol125.h @@ -27,6 +27,7 @@ public: virtual void DataReceived(const char * a_Data, int a_Size) override;
/// Sending stuff to clients (alphabetically sorted):
+ virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity * a_Vehicle) override;
virtual void SendBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType) override;
virtual void SendBlockBreakAnim (int a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage) override;
virtual void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp index ccce8890d..8a40376a3 100644 --- a/source/Protocol/ProtocolRecognizer.cpp +++ b/source/Protocol/ProtocolRecognizer.cpp @@ -88,6 +88,16 @@ void cProtocolRecognizer::DataReceived(const char * a_Data, int a_Size) +void cProtocolRecognizer::SendAttachEntity(const cEntity & a_Entity, const cEntity * a_Vehicle)
+{
+ ASSERT(m_Protocol != NULL);
+ m_Protocol->SendAttachEntity(a_Entity, a_Vehicle);
+}
+
+
+
+
+
void cProtocolRecognizer::SendBlockAction(int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType)
{
ASSERT(m_Protocol != NULL);
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h index fdced8bbe..a4cec69f8 100644 --- a/source/Protocol/ProtocolRecognizer.h +++ b/source/Protocol/ProtocolRecognizer.h @@ -52,6 +52,7 @@ public: virtual void DataReceived(const char * a_Data, int a_Size) override;
/// Sending stuff to clients (alphabetically sorted):
+ virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity * a_Vehicle) override;
virtual void SendBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType) override;
virtual void SendBlockBreakAnim (int a_EntityID, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Stage) override;
virtual void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
|