Feature flag all logic

This commit is contained in:
Akkadius 2024-11-17 19:48:15 -06:00
parent 6424e6a3f3
commit 2d8ef8d286
6 changed files with 28 additions and 14 deletions

View File

@ -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)

View File

@ -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;
}
}
}

View File

@ -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()) {

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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();
}
}
}
}