Combat fix: restore reliable melee hits via movement/state sync

Resolved a melee desync where attacks could fail unless constantly moving through target.

Movement opcode handling:

- In 0x006B compatibility path, prefer compressed-move batch detection before weather alias routing.

- Route 0x006B payloads shaped like SMSG_COMPRESSED_MOVES sub-packets to handleCompressedMoves().

Root/unroot state synchronization:

- Added handling for SMSG_FORCE_MOVE_ROOT and SMSG_FORCE_MOVE_UNROOT.

- Added handleForceMoveRootState() to apply server-authoritative ROOT flag locally.

- Send CMSG_FORCE_MOVE_ROOT_ACK / CMSG_FORCE_MOVE_UNROOT_ACK with current movement payload and counter.

Melee facing stability:

- Added periodic facing sync during auto-attack (MSG_MOVE_SET_FACING) when angular drift to target exceeds threshold.

- Keeps server front-arc/facing checks aligned while stationary meleeing.

Noise reduction / stream hygiene:

- Consume optional legacy/system packets safely: SMSG_FRIEND_LIST, SMSG_IGNORE_LIST, SMSG_ADDON_INFO, SMSG_EXPECTED_SPAM_RECORDS.

Validation:

- Rebuilt successfully with cmake --build build -j32.
This commit is contained in:
Kelsi 2026-02-20 03:14:48 -08:00
parent 610ed71922
commit cb044e3985
2 changed files with 116 additions and 1 deletions

View file

@ -1128,6 +1128,7 @@ private:
// ---- Speed change handler ----
void handleForceRunSpeedChange(network::Packet& packet);
void handleForceMoveRootState(network::Packet& packet, bool rooted);
// ---- Arena / Battleground handlers ----
void handleBattlefieldStatus(network::Packet& packet);
@ -1361,6 +1362,7 @@ private:
uint64_t autoAttackTarget = 0;
bool autoAttackOutOfRange_ = false;
float autoAttackResendTimer_ = 0.0f; // Re-send CMSG_ATTACKSWING every ~1s while attacking
float autoAttackFacingSyncTimer_ = 0.0f; // Periodic facing sync while meleeing
std::unordered_set<uint64_t> hostileAttackers_;
std::vector<CombatTextEntry> combatText;