diff --git a/common/ruletypes.h b/common/ruletypes.h index 2b52e081d..7800c7ff7 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -373,6 +373,7 @@ RULE_BOOL(Zone, AllowCrossZoneSpellsOnBots, false, "Set to true to allow cross z RULE_BOOL(Zone, AllowCrossZoneSpellsOnMercs, false, "Set to true to allow cross zone spells (cast/remove) to affect mercenaries") RULE_BOOL(Zone, AllowCrossZoneSpellsOnPets, false, "Set to true to allow cross zone spells (cast/remove) to affect pets") RULE_BOOL(Zone, ZoneShardQuestMenuOnly, false, "Set to true if you only want quests to show the zone shard menu") +RULE_BOOL(Zone, AkkadiusTempPerformanceFeatureFlag, true, "Enable or disable the Akkadius Temp Performance Feature Flag") RULE_CATEGORY_END() RULE_CATEGORY(Map) diff --git a/zone/client.cpp b/zone/client.cpp index 5b2ec15b0..6ed5d68ff 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -12968,15 +12968,17 @@ void Client::CheckSendBulkClientPositionUpdate() } } - // if we have seen this mob before and it hasn't moved, skip it - if (m_last_seen_mob_position.contains(mob->GetID())) { - if (m_last_seen_mob_position[mob->GetID()] == mob->GetPosition()) { - LogVisibilityDetail( - "Mob [{}] has already been sent to client [{}] at this position, skipping", - mob->GetCleanName(), - GetCleanName() - ); - continue; + // if we have seen this mob before, and it hasn't moved, skip it + if (RuleB(Zone, AkkadiusTempPerformanceFeatureFlag)) { + if (m_last_seen_mob_position.contains(mob->GetID())) { + if (m_last_seen_mob_position[mob->GetID()] == mob->GetPosition()) { + LogVisibilityDetail( + "Mob [{}] has already been sent to client [{}] at this position, skipping", + mob->GetCleanName(), + GetCleanName() + ); + continue; + } } } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 96a34bda1..dbfe26dd8 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -971,7 +971,9 @@ void Client::CompleteConnect() RecordStats(); AutoGrantAAPoints(); - m_last_seen_mob_position.reserve(entity_list.GetMobList().size()); + if (RuleB(Zone, AkkadiusTempPerformanceFeatureFlag)) { + m_last_seen_mob_position.reserve(entity_list.GetMobList().size()); + } // enforce some rules.. if (!CanEnterZone()) { diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 0e2d5ff23..3a4651077 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -122,7 +122,11 @@ bool Client::Process() { /* I haven't naturally updated my position in 10 seconds, updating manually */ if (!IsMoving() && m_position_update_timer.Check()) { - CastToClient()->BroadcastPositionUpdate(); + if (RuleB(Zone, AkkadiusTempPerformanceFeatureFlag)) { + CastToClient()->BroadcastPositionUpdate(); + } else { + SentPositionPacket(0.0f, 0.0f, 0.0f, 0.0f, 0); + } } if (mana_timer.Check()) @@ -285,7 +289,7 @@ bool Client::Process() { entity_list.ScanCloseMobs(this); } - if (m_see_close_mobs_timer.Check()) { + if (m_see_close_mobs_timer.Check() && RuleB(Zone, AkkadiusTempPerformanceFeatureFlag)) { entity_list.UpdateVisibility(this); } diff --git a/zone/entity.cpp b/zone/entity.cpp index 3c5762836..1716cfef9 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -2871,6 +2871,7 @@ bool EntityList::RemoveMobFromCloseLists(Mob *mob) it->second->m_close_mobs.erase(entity_id); it->second->m_can_see_mob.erase(entity_id); it->second->m_last_seen_mob_position.erase(entity_id); + ++it; } diff --git a/zone/mob_movement_manager.cpp b/zone/mob_movement_manager.cpp index b2e5e8a82..3edfd27ab 100644 --- a/zone/mob_movement_manager.cpp +++ b/zone/mob_movement_manager.cpp @@ -852,7 +852,9 @@ void MobMovementManager::SendCommandToClients( } c->QueuePacket(&outapp, false); - c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition(); + if (RuleB(Zone, AkkadiusTempPerformanceFeatureFlag)) { + c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition(); + } } } else { @@ -903,7 +905,9 @@ void MobMovementManager::SendCommandToClients( } c->QueuePacket(&outapp, false); - c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition(); + if (RuleB(Zone, AkkadiusTempPerformanceFeatureFlag)) { + c->m_last_seen_mob_position[mob->GetID()] = mob->GetPosition(); + } } } }