summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-19 09:17:47 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-19 09:17:47 +0200
commit6229de5e6723b5399bae5166e7c5cf2fb5620d0e (patch)
tree4b0ed3ecc463cbc1036e0113b9a94c5650546abb
parentProtoProxy: added handling of several spawning packets (diff)
downloadcuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.tar
cuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.tar.gz
cuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.tar.bz2
cuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.tar.lz
cuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.tar.xz
cuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.tar.zst
cuberite-6229de5e6723b5399bae5166e7c5cf2fb5620d0e.zip
-rw-r--r--ProtoProxy/Connection.cpp27
-rw-r--r--ProtoProxy/Connection.h1
2 files changed, 28 insertions, 0 deletions
diff --git a/ProtoProxy/Connection.cpp b/ProtoProxy/Connection.cpp
index a04605abc..ca26c873a 100644
--- a/ProtoProxy/Connection.cpp
+++ b/ProtoProxy/Connection.cpp
@@ -144,6 +144,7 @@ enum
PACKET_WINDOW_CONTENTS = 0x68,
PACKET_CREATIVE_INVENTORY_ACTION = 0x6b,
PACKET_UPDATE_SIGN = 0x82,
+ PACKET_UPDATE_TILE_ENTITY = 0x84,
PACKET_PLAYER_LIST_ITEM = 0xc9,
PACKET_PLAYER_ABILITIES = 0xca,
PACKET_LOCALE_AND_VIEW = 0xcc,
@@ -610,6 +611,8 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size)
case PACKET_TIME_UPDATE: HANDLE_SERVER_READ(HandleServerTimeUpdate); break;
case PACKET_UPDATE_HEALTH: HANDLE_SERVER_READ(HandleServerUpdateHealth); break;
case PACKET_UPDATE_SIGN: HANDLE_SERVER_READ(HandleServerUpdateSign); break;
+ case PACKET_UPDATE_TILE_ENTITY: HANDLE_SERVER_READ(HandleServerUpdateTileEntity); break;
+ case PACKET_WINDOW_CLOSE: HANDLE_SERVER_READ(HandleServerWindowClose); break;
case PACKET_WINDOW_CONTENTS: HANDLE_SERVER_READ(HandleServerWindowContents); break;
default:
{
@@ -1672,6 +1675,30 @@ bool cConnection::HandleServerUpdateSign(void)
+bool cConnection::HandleServerUpdateTileEntity(void)
+{
+ HANDLE_SERVER_PACKET_READ(ReadBEInt, int, BlockX);
+ HANDLE_SERVER_PACKET_READ(ReadBEShort, short, BlockY);
+ HANDLE_SERVER_PACKET_READ(ReadBEInt, int, BlockZ);
+ HANDLE_SERVER_PACKET_READ(ReadByte, Byte, Action);
+ HANDLE_SERVER_PACKET_READ(ReadBEShort, short, DataLength);
+ AString Data;
+ if ((DataLength > 0) && !m_ServerBuffer.ReadString(Data, DataLength))
+ {
+ return false;
+ }
+ Log("Received a PACKET_UPDATE_TILE_ENTITY from the server:");
+ Log(" Block = {%d, %d, %d}", BlockX, BlockY, BlockZ);
+ Log(" Action = %d", Action);
+ DataLog(Data.data(), Data.size(), " Data (%d bytes)", Data.size());
+ COPY_TO_CLIENT();
+ return true;
+}
+
+
+
+
+
bool cConnection::HandleServerWindowClose(void)
{
HANDLE_SERVER_PACKET_READ(ReadChar, char, WindowID);
diff --git a/ProtoProxy/Connection.h b/ProtoProxy/Connection.h
index b80a8bfcb..aa73182ff 100644
--- a/ProtoProxy/Connection.h
+++ b/ProtoProxy/Connection.h
@@ -152,6 +152,7 @@ protected:
bool HandleServerTimeUpdate(void);
bool HandleServerUpdateHealth(void);
bool HandleServerUpdateSign(void);
+ bool HandleServerUpdateTileEntity(void);
bool HandleServerWindowClose(void);
bool HandleServerWindowContents(void);