From 6229de5e6723b5399bae5166e7c5cf2fb5620d0e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Wed, 19 Sep 2012 07:17:47 +0000 Subject: ProtoProxy: Added the PACKET_UPDATE_TILE_ENTITY packet handling git-svn-id: http://mc-server.googlecode.com/svn/trunk@865 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- ProtoProxy/Connection.cpp | 27 +++++++++++++++++++++++++++ ProtoProxy/Connection.h | 1 + 2 files changed, 28 insertions(+) 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); -- cgit v1.2.3