summaryrefslogtreecommitdiffstats
path: root/ProtoProxy
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-18 10:35:06 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-18 10:35:06 +0200
commit13e5ee887c5f1fd47ddccd5471baf4e70ed45180 (patch)
treeb8111540f9687c0f5d33610d35687c440d9bccb9 /ProtoProxy
parentProtoProxy: Added the PACKET_SET_EXPERIENCE packet handling (diff)
downloadcuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.tar
cuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.tar.gz
cuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.tar.bz2
cuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.tar.lz
cuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.tar.xz
cuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.tar.zst
cuberite-13e5ee887c5f1fd47ddccd5471baf4e70ed45180.zip
Diffstat (limited to 'ProtoProxy')
-rw-r--r--ProtoProxy/Connection.cpp30
-rw-r--r--ProtoProxy/Connection.h1
2 files changed, 31 insertions, 0 deletions
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);