From 2ae14d5d38312290d09b972b3f15230fb38aa512 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Sun, 29 Mar 2026 18:46:25 -0700 Subject: [PATCH] fix: RX silence 15s warning fired ~30 times per window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The 10s silence warning used a one-shot bool guard, but the 15s warning used a 500ms time window — firing every frame (~30 times at 60fps). Added rxSilence15sLogged_ guard consistent with the 10s pattern. --- include/game/game_handler.hpp | 1 + src/game/game_handler.cpp | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/include/game/game_handler.hpp b/include/game/game_handler.hpp index 3438eab8..c6838cb4 100644 --- a/include/game/game_handler.hpp +++ b/include/game/game_handler.hpp @@ -3047,6 +3047,7 @@ private: // ---- RX silence detection ---- std::chrono::steady_clock::time_point lastRxTime_{}; bool rxSilenceLogged_ = false; + bool rxSilence15sLogged_ = false; // ---- XP tracking ---- uint32_t playerXp_ = 0; diff --git a/src/game/game_handler.cpp b/src/game/game_handler.cpp index ae31e1f2..87e297d3 100644 --- a/src/game/game_handler.cpp +++ b/src/game/game_handler.cpp @@ -887,7 +887,8 @@ void GameHandler::updateNetworking(float deltaTime) { rxSilenceLogged_ = true; LOG_WARNING("RX SILENCE: No packets from server for ", silenceMs, "ms — possible soft disconnect"); } - if (silenceMs > 15000 && silenceMs < 15500) { + if (silenceMs > 15000 && !rxSilence15sLogged_) { + rxSilence15sLogged_ = true; LOG_WARNING("RX SILENCE: 15s — server appears to have stopped sending"); } } @@ -4126,6 +4127,7 @@ void GameHandler::enqueueIncomingPacket(const network::Packet& packet) { pendingIncomingPackets_.push_back(packet); lastRxTime_ = std::chrono::steady_clock::now(); rxSilenceLogged_ = false; + rxSilence15sLogged_ = false; } void GameHandler::enqueueIncomingPacketFront(network::Packet&& packet) { @@ -4568,17 +4570,10 @@ void GameHandler::selectCharacter(uint64_t characterGuid) { playerRangedCritPct_ = -1.0f; std::fill(std::begin(playerSpellCritPct_), std::end(playerSpellCritPct_), -1.0f); std::fill(std::begin(playerCombatRatings_), std::end(playerCombatRatings_), -1); - if (spellHandler_) spellHandler_->knownSpells_.clear(); - if (spellHandler_) spellHandler_->spellCooldowns_.clear(); + if (spellHandler_) spellHandler_->resetAllState(); spellFlatMods_.clear(); spellPctMods_.clear(); actionBar = {}; - if (spellHandler_) { - spellHandler_->playerAuras_.clear(); - spellHandler_->targetAuras_.clear(); - spellHandler_->unitAurasCache_.clear(); - } - if (spellHandler_) spellHandler_->unitCastStates_.clear(); petGuid_ = 0; stableWindowOpen_ = false; stableMasterGuid_ = 0; @@ -4598,7 +4593,7 @@ void GameHandler::selectCharacter(uint64_t characterGuid) { pendingQuestAcceptNpcGuids_.clear(); npcQuestStatus_.clear(); if (combatHandler_) combatHandler_->resetAllCombatState(); - if (spellHandler_) spellHandler_->resetCastState(); + // resetCastState() already called inside resetAllState() above pendingGameObjectInteractGuid_ = 0; lastInteractedGoGuid_ = 0; playerDead_ = false;