summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-07 11:27:59 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-07 11:27:59 +0200
commitcf872484af282a1023fab87b973fa6434b8bbab6 (patch)
tree012825eb56057216b2c53937eb2149549c93d6e7 /source/cClientHandle.cpp
parent(Temporary) hotfix for the "too many packets" error - set the packet limit 5x higher. (diff)
downloadcuberite-cf872484af282a1023fab87b973fa6434b8bbab6.tar
cuberite-cf872484af282a1023fab87b973fa6434b8bbab6.tar.gz
cuberite-cf872484af282a1023fab87b973fa6434b8bbab6.tar.bz2
cuberite-cf872484af282a1023fab87b973fa6434b8bbab6.tar.lz
cuberite-cf872484af282a1023fab87b973fa6434b8bbab6.tar.xz
cuberite-cf872484af282a1023fab87b973fa6434b8bbab6.tar.zst
cuberite-cf872484af282a1023fab87b973fa6434b8bbab6.zip
Diffstat (limited to 'source/cClientHandle.cpp')
-rw-r--r--source/cClientHandle.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index e6f4d3a82..24c732185 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -68,6 +68,7 @@
// DEBUG:
#include "packets/cPacket_BlockChange.h"
+#include "packets/cPacket_MultiBlock.h"
@@ -1939,13 +1940,30 @@ void cClientHandle::GetOutgoingData(AString & a_Data)
{
int x = ((cPacket_BlockChange *)(*itr))->m_PosX;
int z = ((cPacket_BlockChange *)(*itr))->m_PosZ;
+ char ToBlock = ((cPacket_BlockChange *)(*itr))->m_BlockType;
int y, cx, cz;
cChunkDef::AbsoluteToRelative(x, y, z, cx, cz);
bool IsWanted = (abs(cx - ChunkX) <= m_ViewDistance) && (abs(cz - ChunkZ) <= m_ViewDistance);
- LOG("Packet %4d: type %2x (BlockChange: [%d, %d], %s chunk)",
+ LOG("Packet %4d: type %2x (BlockChange: [%d, %d], %s chunk; to block %d)",
Idx++, (*itr)->m_PacketID,
cx, cz,
- IsWanted ? "wanted" : "unwanted"
+ IsWanted ? "wanted" : "unwanted",
+ ToBlock
+ );
+ break;
+ }
+
+ case E_MULTI_BLOCK:
+ {
+ int cx = ((cPacket_MultiBlock *)(*itr))->m_ChunkX;
+ int cz = ((cPacket_MultiBlock *)(*itr))->m_ChunkZ;
+ int NumBlocks = ((cPacket_MultiBlock *)(*itr))->m_NumBlocks;
+ bool IsWanted = (abs(cx - ChunkX) <= m_ViewDistance) && (abs(cz - ChunkZ) <= m_ViewDistance);
+ LOG("Packet %4d: type %2x (MultiBlock: [%d, %d], %s chunk, %d blocks)",
+ Idx++, (*itr)->m_PacketID,
+ cx, cz,
+ IsWanted ? "wanted" : "unwanted",
+ NumBlocks
);
break;
}