From e32a85f752819d9fdc0f2325fb2a752dfa11b5df Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 18 Sep 2012 08:13:12 +0000 Subject: ProtoProxy: added the CHANGE_GAME_STATE packet handling git-svn-id: http://mc-server.googlecode.com/svn/trunk@860 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 bdf735199..69bbcf66d 100644 --- a/ProtoProxy/Connection.cpp +++ b/ProtoProxy/Connection.cpp @@ -117,6 +117,7 @@ enum PACKET_MAP_CHUNK = 0x33, PACKET_MULTI_BLOCK_CHANGE = 0x34, PACKET_BLOCK_CHANGE = 0x35, + PACKET_CHANGE_GAME_STATE = 0x46, PACKET_WINDOW_CLOSE = 0x65, PACKET_WINDOW_CLICK = 0x66, PACKET_SET_SLOT = 0x67, @@ -536,6 +537,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size) switch (PacketType) { case PACKET_BLOCK_CHANGE: HANDLE_SERVER_READ(HandleServerBlockChange); break; + case PACKET_CHANGE_GAME_STATE: HANDLE_SERVER_READ(HandleServerChangeGameState); break; case PACKET_CHAT_MESSAGE: HANDLE_SERVER_READ(HandleServerChatMessage); break; case PACKET_COMPASS: HANDLE_SERVER_READ(HandleServerCompass); break; case PACKET_ENCRYPTION_KEY_REQUEST: HANDLE_SERVER_READ(HandleServerEncryptionKeyRequest); break; @@ -940,6 +942,21 @@ bool cConnection::HandleServerBlockChange(void) +bool cConnection::HandleServerChangeGameState(void) +{ + HANDLE_SERVER_PACKET_READ(ReadChar, char, Reason); + HANDLE_SERVER_PACKET_READ(ReadChar, char, Data); + Log("Received a PACKET_CHANGE_GAME_STATE from the server:"); + Log(" Reason = %d", Reason); + Log(" Data = %d", Data); + COPY_TO_CLIENT(); + return true; +} + + + + + bool cConnection::HandleServerChatMessage(void) { HANDLE_SERVER_PACKET_READ(ReadBEUTF16String16, AString, Message); diff --git a/ProtoProxy/Connection.h b/ProtoProxy/Connection.h index c3ed5472e..ee59311cd 100644 --- a/ProtoProxy/Connection.h +++ b/ProtoProxy/Connection.h @@ -119,6 +119,7 @@ protected: // Packet handling, server-side: bool HandleServerBlockChange(void); + bool HandleServerChangeGameState(void); bool HandleServerChatMessage(void); bool HandleServerCompass(void); bool HandleServerEncryptionKeyRequest(void); -- cgit v1.2.3