Throttle auto expedition leader changes (#1293)

This fixes unnecessary leader processing on mass dzquits

Also marks leader dirty for empty expeditions in case something goes
wrong (shouldn't be possible after 62e480fe)
This commit is contained in:
hg
2021-03-16 01:01:48 -04:00
committed by GitHub
parent 0d12bf0b1f
commit 18a3ff5f12
4 changed files with 27 additions and 6 deletions
+5 -2
View File
@@ -37,6 +37,7 @@ public:
void RemoveMember(uint32_t character_id);
void RemoveAllMembers() { m_member_ids.clear(); }
void CheckExpireWarning();
void CheckLeader();
void ChooseNewLeader();
uint32_t GetID() const { return m_expedition_id; }
uint16_t GetInstanceID() const { return static_cast<uint16_t>(m_dz_instance_id); }
@@ -62,8 +63,10 @@ private:
uint32_t m_dz_instance_id = 0;
uint32_t m_dz_zone_id = 0;
uint32_t m_leader_id = 0;
bool m_pending_delete = false;
Timer m_warning_cooldown_timer;
bool m_pending_delete = false;
bool m_choose_leader_needed = false;
Timer m_choose_leader_cooldown_timer;
Timer m_warning_cooldown_timer;
std::vector<uint32_t> m_member_ids;
std::chrono::seconds m_duration;
std::chrono::time_point<std::chrono::system_clock> m_start_time;