1
0

ProtoProxy: more 1.4.6 stuff, now the connection holds stable with the 1.4.6 client.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1103 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-12-26 09:08:44 +00:00
parent 812e2f00f7
commit fa6bfc154b
2 changed files with 39 additions and 0 deletions

View File

@ -111,6 +111,7 @@ enum
PACKET_PLAYER_POSITION = 0x0b, PACKET_PLAYER_POSITION = 0x0b,
PACKET_PLAYER_LOOK = 0x0c, PACKET_PLAYER_LOOK = 0x0c,
PACKET_PLAYER_POSITION_LOOK = 0x0d, PACKET_PLAYER_POSITION_LOOK = 0x0d,
PACKET_BLOCK_DIG = 0x0e,
PACKET_BLOCK_PLACE = 0x0f, PACKET_BLOCK_PLACE = 0x0f,
PACKET_SLOT_SELECT = 0x10, PACKET_SLOT_SELECT = 0x10,
PACKET_ANIMATION = 0x12, PACKET_ANIMATION = 0x12,
@ -504,6 +505,7 @@ bool cConnection::DecodeClientsPackets(const char * a_Data, int a_Size)
switch (PacketType) switch (PacketType)
{ {
case PACKET_ANIMATION: HANDLE_CLIENT_READ(HandleClientAnimation); break; 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_BLOCK_PLACE: HANDLE_CLIENT_READ(HandleClientBlockPlace); break;
case PACKET_CHAT_MESSAGE: HANDLE_CLIENT_READ(HandleClientChatMessage); break; case PACKET_CHAT_MESSAGE: HANDLE_CLIENT_READ(HandleClientChatMessage); break;
case PACKET_CLIENT_STATUSES: HANDLE_CLIENT_READ(HandleClientClientStatuses); 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_PLAYER_POSITION_LOOK: HANDLE_SERVER_READ(HandleServerPlayerPositionLook); break;
case PACKET_SET_EXPERIENCE: HANDLE_SERVER_READ(HandleServerSetExperience); break; case PACKET_SET_EXPERIENCE: HANDLE_SERVER_READ(HandleServerSetExperience); break;
case PACKET_SET_SLOT: HANDLE_SERVER_READ(HandleServerSetSlot); 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_SOUND_EFFECT: HANDLE_SERVER_READ(HandleServerSoundEffect); break;
case PACKET_SPAWN_MOB: HANDLE_SERVER_READ(HandleServerSpawnMob); break; case PACKET_SPAWN_MOB: HANDLE_SERVER_READ(HandleServerSpawnMob); break;
case PACKET_SPAWN_OBJECT_VEHICLE: HANDLE_SERVER_READ(HandleServerSpawnObjectVehicle); 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) bool cConnection::HandleClientBlockPlace(void)
{ {
HANDLE_CLIENT_PACKET_READ(ReadBEInt, int, BlockX); 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(ReadBEShort, short, ChunkCount);
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, CompressedSize); HANDLE_SERVER_PACKET_READ(ReadBEInt, int, CompressedSize);
HANDLE_SERVER_PACKET_READ(ReadBool, bool, IsSkyLightSent);
AString CompressedData; AString CompressedData;
if (!m_ServerBuffer.ReadString(CompressedData, CompressedSize)) 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("Received a PACKET_MAP_CHUNK_BULK from the server:");
Log(" ChunkCount = %d", ChunkCount); Log(" ChunkCount = %d", ChunkCount);
Log(" Compressed size = %d (0x%x)", CompressedSize, CompressedSize); 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 // 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) bool cConnection::HandleServerSoundEffect(void)
{ {
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, EffectID); HANDLE_SERVER_PACKET_READ(ReadBEInt, int, EffectID);

View File

@ -98,6 +98,7 @@ protected:
// Packet handling, client-side: // Packet handling, client-side:
bool HandleClientAnimation(void); bool HandleClientAnimation(void);
bool HandleClientBlockDig(void);
bool HandleClientBlockPlace(void); bool HandleClientBlockPlace(void);
bool HandleClientChatMessage(void); bool HandleClientChatMessage(void);
bool HandleClientClientStatuses(void); bool HandleClientClientStatuses(void);
@ -151,6 +152,7 @@ protected:
bool HandleServerPlayerPositionLook(void); bool HandleServerPlayerPositionLook(void);
bool HandleServerSetExperience(void); bool HandleServerSetExperience(void);
bool HandleServerSetSlot(void); bool HandleServerSetSlot(void);
bool HandleServerSlotSelect(void);
bool HandleServerSoundEffect(void); bool HandleServerSoundEffect(void);
bool HandleServerSpawnMob(void); bool HandleServerSpawnMob(void);
bool HandleServerSpawnObjectVehicle(void); bool HandleServerSpawnObjectVehicle(void);