From af7ee903fb0a0ee53ea6784cf565b7e2bc016983 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Fri, 28 Dec 2012 06:05:52 +0000 Subject: ProtoProxy: Now handles the ATTACH_ENTITY packet (0x27) git-svn-id: http://mc-server.googlecode.com/svn/trunk@1115 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- ProtoProxy/Connection.cpp | 17 +++++++++++++++++ ProtoProxy/Connection.h | 1 + 2 files changed, 18 insertions(+) diff --git a/ProtoProxy/Connection.cpp b/ProtoProxy/Connection.cpp index 7aac27fd4..0f5963587 100644 --- a/ProtoProxy/Connection.cpp +++ b/ProtoProxy/Connection.cpp @@ -131,6 +131,7 @@ enum PACKET_ENTITY_TELEPORT = 0x22, PACKET_ENTITY_HEAD_LOOK = 0x23, PACKET_ENTITY_STATUS = 0x26, + PACKET_ATTACH_ENTITY = 0x27, PACKET_ENTITY_METADATA = 0x28, PACKET_ENTITY_EFFECT = 0x29, PACKET_ENTITY_EFFECT_REMOVE = 0x2a, @@ -587,6 +588,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size) Log("Decoding server's packets, there are now %d bytes in the queue; next packet is 0x%x", m_ServerBuffer.GetReadableSpace(), PacketType); switch (PacketType) { + case PACKET_ATTACH_ENTITY: HANDLE_SERVER_READ(HandleServerAttachEntity); break; case PACKET_BLOCK_ACTION: HANDLE_SERVER_READ(HandleServerBlockAction); break; case PACKET_BLOCK_CHANGE: HANDLE_SERVER_READ(HandleServerBlockChange); break; case PACKET_CHANGE_GAME_STATE: HANDLE_SERVER_READ(HandleServerChangeGameState); break; @@ -1054,6 +1056,21 @@ bool cConnection::HandleClientWindowClose(void) +bool cConnection::HandleServerAttachEntity(void) +{ + HANDLE_SERVER_PACKET_READ(ReadBEInt, int, EntityID); + HANDLE_SERVER_PACKET_READ(ReadBEInt, int, VehicleID); + Log("Received a PACKET_ATTACH_ENTITY from the server:"); + Log(" EntityID = %d (0x%x)", EntityID, EntityID); + Log(" VehicleID = %d (0x%x)", VehicleID, VehicleID); + COPY_TO_CLIENT(); + return true; +} + + + + + bool cConnection::HandleServerBlockAction(void) { HANDLE_SERVER_PACKET_READ(ReadBEInt, int, BlockX); diff --git a/ProtoProxy/Connection.h b/ProtoProxy/Connection.h index 54cc7ef71..b7c24d853 100644 --- a/ProtoProxy/Connection.h +++ b/ProtoProxy/Connection.h @@ -121,6 +121,7 @@ protected: bool HandleClientWindowClose(void); // Packet handling, server-side: + bool HandleServerAttachEntity(void); bool HandleServerBlockAction(void); bool HandleServerBlockChange(void); bool HandleServerChangeGameState(void); -- cgit v1.2.3