Let world handle expedition leader changes

This should eliminate race conditions caused by zones trying to set
a leader when members in different zones quit at the same time

Zone still detects when leader goes offline to trigger a change
since it's easier than having world process expedition member status
updates and perform expedition lookups
This commit is contained in:
hg
2020-11-01 15:01:43 -05:00
parent 955cbeb826
commit 6acfc41778
15 changed files with 170 additions and 127 deletions
-11
View File
@@ -629,17 +629,6 @@ void ExpeditionDatabase::InsertMembers(
}
}
void ExpeditionDatabase::UpdateLeaderID(uint32_t expedition_id, uint32_t leader_id)
{
LogExpeditionsDetail("Updating leader [{}] for expedition [{}]", leader_id, expedition_id);
auto query = fmt::format(SQL(
UPDATE expeditions SET leader_id = {} WHERE id = {};
), leader_id, expedition_id);
database.QueryDatabase(query);
}
void ExpeditionDatabase::UpdateLockState(uint32_t expedition_id, bool is_locked)
{
LogExpeditionsDetail("Updating lock state [{}] for expedition [{}]", is_locked, expedition_id);