From 13e5ee887c5f1fd47ddccd5471baf4e70ed45180 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 18 Sep 2012 08:35:06 +0000 Subject: ProtoProxy: Added the PACKET_MAP_CHUNK_BULK packet handling git-svn-id: http://mc-server.googlecode.com/svn/trunk@862 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- ProtoProxy/Connection.cpp | 30 ++++++++++++++++++++++++++++++ ProtoProxy/Connection.h | 1 + 2 files changed, 31 insertions(+) diff --git a/ProtoProxy/Connection.cpp b/ProtoProxy/Connection.cpp index 4d87888c2..7826bd002 100644 --- a/ProtoProxy/Connection.cpp +++ b/ProtoProxy/Connection.cpp @@ -118,6 +118,7 @@ enum PACKET_MAP_CHUNK = 0x33, PACKET_MULTI_BLOCK_CHANGE = 0x34, PACKET_BLOCK_CHANGE = 0x35, + PACKET_MAP_CHUNK_BULK = 0x38, PACKET_CHANGE_GAME_STATE = 0x46, PACKET_WINDOW_CLOSE = 0x65, PACKET_WINDOW_CLICK = 0x66, @@ -548,6 +549,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size) case PACKET_KICK: HANDLE_SERVER_READ(HandleServerKick); break; case PACKET_LOGIN: HANDLE_SERVER_READ(HandleServerLogin); break; case PACKET_MAP_CHUNK: HANDLE_SERVER_READ(HandleServerMapChunk); break; + case PACKET_MAP_CHUNK_BULK: HANDLE_SERVER_READ(HandleServerMapChunkBulk); break; case PACKET_MULTI_BLOCK_CHANGE: HANDLE_SERVER_READ(HandleServerMultiBlockChange); break; case PACKET_PLAYER_ABILITIES: HANDLE_SERVER_READ(HandleServerPlayerAbilities); break; case PACKET_PLAYER_LIST_ITEM: HANDLE_SERVER_READ(HandleServerPlayerListItem); break; @@ -1145,6 +1147,34 @@ bool cConnection::HandleServerMapChunk(void) +bool cConnection::HandleServerMapChunkBulk(void) +{ + HANDLE_SERVER_PACKET_READ(ReadBEShort, short, ChunkCount); + HANDLE_SERVER_PACKET_READ(ReadBEInt, int, CompressedSize); + AString CompressedData; + if (!m_ServerBuffer.ReadString(CompressedData, CompressedSize)) + { + return false; + } + AString Meta; + if (!m_ServerBuffer.ReadString(Meta, ChunkCount * 12)) + { + return false; + } + Log("Received a PACKET_MAP_CHUNK_BULK from the server:"); + Log(" ChunkCount = %d", ChunkCount); + Log(" Compressed size = %d (0x%x)", CompressedSize, CompressedSize); + + // TODO: Save the compressed data into a file for later analysis + + COPY_TO_CLIENT(); + return true; +} + + + + + bool cConnection::HandleServerMultiBlockChange(void) { HANDLE_SERVER_PACKET_READ(ReadBEInt, int, ChunkX); diff --git a/ProtoProxy/Connection.h b/ProtoProxy/Connection.h index b54535764..65f916077 100644 --- a/ProtoProxy/Connection.h +++ b/ProtoProxy/Connection.h @@ -129,6 +129,7 @@ protected: bool HandleServerKick(void); bool HandleServerLogin(void); bool HandleServerMapChunk(void); + bool HandleServerMapChunkBulk(void); bool HandleServerMultiBlockChange(void); bool HandleServerPlayerAbilities(void); bool HandleServerPlayerListItem(void); -- cgit v1.2.3