1
0

ProtoProxy: Now handles the ATTACH_ENTITY packet (0x27)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1115 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-12-28 06:05:52 +00:00
parent 0cc3ab7c1e
commit af7ee903fb
2 changed files with 18 additions and 0 deletions

View File

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

View File

@ -121,6 +121,7 @@ protected:
bool HandleClientWindowClose(void);
// Packet handling, server-side:
bool HandleServerAttachEntity(void);
bool HandleServerBlockAction(void);
bool HandleServerBlockChange(void);
bool HandleServerChangeGameState(void);