From 5d62d8158cc79013e4e8ff3c620708c90313d069 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 18 Sep 2012 08:17:38 +0000 Subject: ProtoProxy: Added the PACKET_SET_EXPERIENCE packet handling git-svn-id: http://mc-server.googlecode.com/svn/trunk@861 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- ProtoProxy/Connection.cpp | 19 +++++++++++++++++++ ProtoProxy/Connection.h | 1 + 2 files changed, 20 insertions(+) diff --git a/ProtoProxy/Connection.cpp b/ProtoProxy/Connection.cpp index 69bbcf66d..4d87888c2 100644 --- a/ProtoProxy/Connection.cpp +++ b/ProtoProxy/Connection.cpp @@ -114,6 +114,7 @@ enum PACKET_BLOCK_PLACE = 0x0f, PACKET_SLOT_SELECT = 0x10, PACKET_ANIMATION = 0x12, + PACKET_SET_EXPERIENCE = 0x2b, PACKET_MAP_CHUNK = 0x33, PACKET_MULTI_BLOCK_CHANGE = 0x34, PACKET_BLOCK_CHANGE = 0x35, @@ -551,6 +552,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size) case PACKET_PLAYER_ABILITIES: HANDLE_SERVER_READ(HandleServerPlayerAbilities); break; case PACKET_PLAYER_LIST_ITEM: HANDLE_SERVER_READ(HandleServerPlayerListItem); break; case PACKET_PLAYER_POSITION_LOOK: HANDLE_SERVER_READ(HandleServerPlayerPositionLook); break; + case PACKET_SET_EXPERIENCE: HANDLE_SERVER_READ(HandleServerSetExperience); break; case PACKET_SET_SLOT: HANDLE_SERVER_READ(HandleServerSetSlot); break; case PACKET_TIME_UPDATE: HANDLE_SERVER_READ(HandleServerTimeUpdate); break; case PACKET_UPDATE_HEALTH: HANDLE_SERVER_READ(HandleServerUpdateHealth); break; @@ -1219,6 +1221,23 @@ bool cConnection::HandleServerPlayerPositionLook(void) +bool cConnection::HandleServerSetExperience(void) +{ + HANDLE_SERVER_PACKET_READ(ReadBEFloat, float, ExperienceBar); + HANDLE_SERVER_PACKET_READ(ReadBEShort, short, Level); + HANDLE_SERVER_PACKET_READ(ReadBEShort, short, TotalExperience); + Log("Received a PACKET_SET_EXPERIENCE from the server:"); + Log(" ExperienceBar = %.05f", ExperienceBar); + Log(" Level = %d", Level); + Log(" TotalExperience = %d", TotalExperience); + COPY_TO_CLIENT(); + return true; +} + + + + + bool cConnection::HandleServerSetSlot(void) { HANDLE_SERVER_PACKET_READ(ReadChar, char, WindowID); diff --git a/ProtoProxy/Connection.h b/ProtoProxy/Connection.h index ee59311cd..b54535764 100644 --- a/ProtoProxy/Connection.h +++ b/ProtoProxy/Connection.h @@ -133,6 +133,7 @@ protected: bool HandleServerPlayerAbilities(void); bool HandleServerPlayerListItem(void); bool HandleServerPlayerPositionLook(void); + bool HandleServerSetExperience(void); bool HandleServerSetSlot(void); bool HandleServerTimeUpdate(void); bool HandleServerUpdateHealth(void); -- cgit v1.2.3