Reduce Stormwind stutter from spawn retry churn and log I/O

- Cache non-renderable creature display IDs and fail-fast future spawn attempts

- Mark GUIDs tied to non-renderable displays as permanent failures to avoid long retry loops

- Skip queued spawn retry work immediately for known non-renderable display IDs

- Clear non-renderable display cache on expansion reload/logout

- Downgrade high-volume UNIT spawn logs to debug and fix mislabeled time-sync log
This commit is contained in:
Kelsi 2026-02-21 03:29:13 -08:00
parent f8fc34ff2c
commit d40cfcad90
2 changed files with 29 additions and 6 deletions

View file

@ -1885,7 +1885,7 @@ void GameHandler::handlePacket(network::Packet& packet) {
break;
}
uint32_t reason = packet.readUInt32();
LOG_INFO("Resurrect cancel reason: ", reason);
LOG_DEBUG("Time sync request reason: ", reason);
resurrectPending_ = false;
resurrectRequestPending_ = false;
break;
@ -4986,8 +4986,8 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
}
// Trigger creature spawn callback for units/players with displayId
if (block.objectType == ObjectType::UNIT && unit->getDisplayId() == 0) {
LOG_INFO("[Spawn] UNIT guid=0x", std::hex, block.guid, std::dec,
" has displayId=0 — no spawn (entry=", unit->getEntry(), ")");
LOG_DEBUG("[Spawn] UNIT guid=0x", std::hex, block.guid, std::dec,
" has displayId=0 — no spawn (entry=", unit->getEntry(), ")");
}
if ((block.objectType == ObjectType::UNIT || block.objectType == ObjectType::PLAYER) && unit->getDisplayId() != 0) {
if (block.objectType == ObjectType::PLAYER && block.guid == playerGuid) {
@ -5004,9 +5004,9 @@ void GameHandler::handleUpdateObject(network::Packet& packet) {
}
}
} else if (creatureSpawnCallback_) {
LOG_INFO("[Spawn] UNIT guid=0x", std::hex, block.guid, std::dec,
" displayId=", unit->getDisplayId(), " at (",
unit->getX(), ",", unit->getY(), ",", unit->getZ(), ")");
LOG_DEBUG("[Spawn] UNIT guid=0x", std::hex, block.guid, std::dec,
" displayId=", unit->getDisplayId(), " at (",
unit->getX(), ",", unit->getY(), ",", unit->getZ(), ")");
creatureSpawnCallback_(block.guid, unit->getDisplayId(),
unit->getX(), unit->getY(), unit->getZ(), unit->getOrientation());
if (unitInitiallyDead && npcDeathCallback_) {