[Expeditions] Let dz process its expired state (#1310)

Move early empty shutdown and process rate rules to DynamicZone scope

This decouples the expired status check from expeditions into an
internal dz method that can be called by its owning system
This commit is contained in:
hg
2021-03-28 21:43:09 -04:00
committed by GitHub
parent 97c11a1199
commit f5cf566fca
7 changed files with 60 additions and 39 deletions
+18
View File
@@ -161,3 +161,21 @@ void Expedition::CheckLeader()
ChooseNewLeader();
}
}
bool Expedition::Process()
{
// returns true if expedition needs to be deleted from world cache and db
// expedition is not deleted until its dz has no clients to prevent exploits
auto status = m_dynamic_zone.Process(IsEmpty()); // force expire if no members
if (status == DynamicZoneStatus::ExpiredEmpty)
{
LogExpeditions("Expedition [{}] expired or empty, notifying zones and deleting", GetID());
SendZonesExpeditionDeleted();
return true;
}
CheckExpireWarning();
CheckLeader();
return false;
}