1
0

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
This commit is contained in:
madmaxoft@gmail.com 2012-09-19 07:17:47 +00:00
parent 44e38e9643
commit 6229de5e67
2 changed files with 28 additions and 0 deletions

View File

@ -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);

View File

@ -152,6 +152,7 @@ protected:
bool HandleServerTimeUpdate(void);
bool HandleServerUpdateHealth(void);
bool HandleServerUpdateSign(void);
bool HandleServerUpdateTileEntity(void);
bool HandleServerWindowClose(void);
bool HandleServerWindowContents(void);