1
0

Added more statistics to the packet queue overfill problem.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@566 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com 2012-06-07 09:27:59 +00:00
parent b0ffd6ad94
commit cf872484af

View File

@ -68,6 +68,7 @@
// DEBUG: // DEBUG:
#include "packets/cPacket_BlockChange.h" #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 x = ((cPacket_BlockChange *)(*itr))->m_PosX;
int z = ((cPacket_BlockChange *)(*itr))->m_PosZ; int z = ((cPacket_BlockChange *)(*itr))->m_PosZ;
char ToBlock = ((cPacket_BlockChange *)(*itr))->m_BlockType;
int y, cx, cz; int y, cx, cz;
cChunkDef::AbsoluteToRelative(x, y, z, cx, cz); cChunkDef::AbsoluteToRelative(x, y, z, cx, cz);
bool IsWanted = (abs(cx - ChunkX) <= m_ViewDistance) && (abs(cz - ChunkZ) <= m_ViewDistance); 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, Idx++, (*itr)->m_PacketID,
cx, cz, 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; break;
} }