mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 08:03:50 +00:00
fix(movement): upgrade teleport and heartbeat diagnostics to WARNING
MSG_MOVE_TELEPORT_ACK now logs server-sent coordinates AND current position at WARNING level (was LOG_INFO, invisible in log file). Heartbeat position audit now logs every ~60 heartbeats (~30s) at WARNING level to trace position drift before rogue teleports.
This commit is contained in:
parent
722c065089
commit
696baffdf7
1 changed files with 10 additions and 7 deletions
|
|
@ -630,10 +630,12 @@ void MovementHandler::sendMovement(Opcode opcode) {
|
||||||
wireInfo.y = serverPos.y;
|
wireInfo.y = serverPos.y;
|
||||||
wireInfo.z = serverPos.z;
|
wireInfo.z = serverPos.z;
|
||||||
|
|
||||||
// Periodic position audit — DEBUG to avoid flooding production logs.
|
// Periodic position audit — log every ~60 heartbeats (~30s) to trace position drift.
|
||||||
if (opcode == Opcode::MSG_MOVE_HEARTBEAT && ++heartbeatLogCount_ % 30 == 0) {
|
if (opcode == Opcode::MSG_MOVE_HEARTBEAT && ++heartbeatLogCount_ % 60 == 0) {
|
||||||
LOG_DEBUG("HEARTBEAT pos canonical=(", movementInfo.x, ",", movementInfo.y, ",", movementInfo.z,
|
LOG_WARNING("HEARTBEAT #", heartbeatLogCount_, " canonical=(",
|
||||||
") wire=(", wireInfo.x, ",", wireInfo.y, ",", wireInfo.z, ")");
|
movementInfo.x, ",", movementInfo.y, ",", movementInfo.z,
|
||||||
|
") server=(", wireInfo.x, ",", wireInfo.y, ",", wireInfo.z,
|
||||||
|
") flags=0x", std::hex, movementInfo.flags, std::dec);
|
||||||
}
|
}
|
||||||
|
|
||||||
wireInfo.orientation = core::coords::canonicalToServerYaw(wireInfo.orientation);
|
wireInfo.orientation = core::coords::canonicalToServerYaw(wireInfo.orientation);
|
||||||
|
|
@ -1671,9 +1673,10 @@ void MovementHandler::handleTeleportAck(network::Packet& packet) {
|
||||||
float serverZ = packet.readFloat();
|
float serverZ = packet.readFloat();
|
||||||
float orientation = packet.readFloat();
|
float orientation = packet.readFloat();
|
||||||
|
|
||||||
LOG_INFO("MSG_MOVE_TELEPORT_ACK: guid=0x", std::hex, guid, std::dec,
|
LOG_WARNING("MSG_MOVE_TELEPORT_ACK: guid=0x", std::hex, guid, std::dec,
|
||||||
" counter=", counter,
|
" counter=", counter,
|
||||||
" pos=(", serverX, ", ", serverY, ", ", serverZ, ")");
|
" pos=(", serverX, ", ", serverY, ", ", serverZ, ")",
|
||||||
|
" currentPos=(", movementInfo.x, ", ", movementInfo.y, ", ", movementInfo.z, ")");
|
||||||
|
|
||||||
glm::vec3 canonical = core::coords::serverToCanonical(glm::vec3(serverX, serverY, serverZ));
|
glm::vec3 canonical = core::coords::serverToCanonical(glm::vec3(serverX, serverY, serverZ));
|
||||||
movementInfo.x = canonical.x;
|
movementInfo.x = canonical.x;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue