summaryrefslogtreecommitdiffstats
path: root/ProtoProxy
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ProtoProxy/Connection.cpp37
-rw-r--r--ProtoProxy/Connection.h2
2 files changed, 39 insertions, 0 deletions
diff --git a/ProtoProxy/Connection.cpp b/ProtoProxy/Connection.cpp
index aba0c8255..fabdebfe2 100644
--- a/ProtoProxy/Connection.cpp
+++ b/ProtoProxy/Connection.cpp
@@ -111,6 +111,7 @@ enum
PACKET_PLAYER_POSITION = 0x0b,
PACKET_PLAYER_LOOK = 0x0c,
PACKET_PLAYER_POSITION_LOOK = 0x0d,
+ PACKET_BLOCK_DIG = 0x0e,
PACKET_BLOCK_PLACE = 0x0f,
PACKET_SLOT_SELECT = 0x10,
PACKET_ANIMATION = 0x12,
@@ -504,6 +505,7 @@ bool cConnection::DecodeClientsPackets(const char * a_Data, int a_Size)
switch (PacketType)
{
case PACKET_ANIMATION: HANDLE_CLIENT_READ(HandleClientAnimation); break;
+ case PACKET_BLOCK_DIG: HANDLE_CLIENT_READ(HandleClientBlockDig); break;
case PACKET_BLOCK_PLACE: HANDLE_CLIENT_READ(HandleClientBlockPlace); break;
case PACKET_CHAT_MESSAGE: HANDLE_CLIENT_READ(HandleClientChatMessage); break;
case PACKET_CLIENT_STATUSES: HANDLE_CLIENT_READ(HandleClientClientStatuses); break;
@@ -615,6 +617,7 @@ bool cConnection::DecodeServersPackets(const char * a_Data, int a_Size)
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_SLOT_SELECT: HANDLE_SERVER_READ(HandleServerSlotSelect); break;
case PACKET_SOUND_EFFECT: HANDLE_SERVER_READ(HandleServerSoundEffect); break;
case PACKET_SPAWN_MOB: HANDLE_SERVER_READ(HandleServerSpawnMob); break;
case PACKET_SPAWN_OBJECT_VEHICLE: HANDLE_SERVER_READ(HandleServerSpawnObjectVehicle); break;
@@ -679,6 +682,25 @@ bool cConnection::HandleClientAnimation(void)
+bool cConnection::HandleClientBlockDig(void)
+{
+ HANDLE_CLIENT_PACKET_READ(ReadByte, Byte, Status);
+ HANDLE_CLIENT_PACKET_READ(ReadBEInt, int, BlockX);
+ HANDLE_CLIENT_PACKET_READ(ReadByte, Byte, BlockY);
+ HANDLE_CLIENT_PACKET_READ(ReadBEInt, int, BlockZ);
+ HANDLE_CLIENT_PACKET_READ(ReadByte, Byte, BlockFace);
+ Log("Received a PACKET_BLOCK_DIG from the client:");
+ Log(" Status = %d", Status);
+ Log(" Pos = <%d, %d, %d>", BlockX, BlockY, BlockZ);
+ Log(" BlockFace = %d", BlockFace);
+ COPY_TO_SERVER();
+ return true;
+}
+
+
+
+
+
bool cConnection::HandleClientBlockPlace(void)
{
HANDLE_CLIENT_PACKET_READ(ReadBEInt, int, BlockX);
@@ -1458,6 +1480,7 @@ bool cConnection::HandleServerMapChunkBulk(void)
{
HANDLE_SERVER_PACKET_READ(ReadBEShort, short, ChunkCount);
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, CompressedSize);
+ HANDLE_SERVER_PACKET_READ(ReadBool, bool, IsSkyLightSent);
AString CompressedData;
if (!m_ServerBuffer.ReadString(CompressedData, CompressedSize))
{
@@ -1471,6 +1494,7 @@ bool cConnection::HandleServerMapChunkBulk(void)
Log("Received a PACKET_MAP_CHUNK_BULK from the server:");
Log(" ChunkCount = %d", ChunkCount);
Log(" Compressed size = %d (0x%x)", CompressedSize, CompressedSize);
+ Log(" IsSkyLightSent = %s", IsSkyLightSent ? "true" : "false");
// TODO: Save the compressed data into a file for later analysis
@@ -1617,6 +1641,19 @@ bool cConnection::HandleServerSetSlot(void)
+bool cConnection::HandleServerSlotSelect(void)
+{
+ HANDLE_SERVER_PACKET_READ(ReadBEShort, short, SlotNum);
+ Log("Received a PACKET_SLOT_SELECT from the server:");
+ Log(" SlotNum = %d", SlotNum);
+ COPY_TO_CLIENT();
+ return true;
+}
+
+
+
+
+
bool cConnection::HandleServerSoundEffect(void)
{
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, EffectID);
diff --git a/ProtoProxy/Connection.h b/ProtoProxy/Connection.h
index 307076ed8..7dc642042 100644
--- a/ProtoProxy/Connection.h
+++ b/ProtoProxy/Connection.h
@@ -98,6 +98,7 @@ protected:
// Packet handling, client-side:
bool HandleClientAnimation(void);
+ bool HandleClientBlockDig(void);
bool HandleClientBlockPlace(void);
bool HandleClientChatMessage(void);
bool HandleClientClientStatuses(void);
@@ -151,6 +152,7 @@ protected:
bool HandleServerPlayerPositionLook(void);
bool HandleServerSetExperience(void);
bool HandleServerSetSlot(void);
+ bool HandleServerSlotSelect(void);
bool HandleServerSoundEffect(void);
bool HandleServerSpawnMob(void);
bool HandleServerSpawnObjectVehicle(void);