Don't sync character lockout uuid

Fixes regression that caused loot event apis to stop working
This commit is contained in:
hg 2020-11-11 22:25:15 -05:00
parent 8b2b2db848
commit a312cd6e1d
2 changed files with 6 additions and 3 deletions

View File

@ -2238,7 +2238,7 @@ void Expedition::SendMembersExpireWarning(uint32_t minutes_remaining)
void Expedition::SyncCharacterLockouts(
uint32_t character_id, std::vector<ExpeditionLockoutTimer>& client_lockouts)
{
// adds missing event lockouts to client for this expedition and replaces
// adds missing event lockouts to client for this expedition and updates
// client timers that are both shorter and from another expedition
BenchTimer benchmark;
@ -2265,9 +2265,10 @@ void Expedition::SyncCharacterLockouts(
else if (client_lockout_iter->GetSecondsRemaining() < lockout.GetSecondsRemaining() &&
client_lockout_iter->GetExpeditionUUID() != m_uuid)
{
// only update lockout timer not uuid so loot event apis still work
modified = true;
client_lockouts.erase(client_lockout_iter);
client_lockouts.emplace_back(lockout); // replaced existing
client_lockout_iter->SetDuration(lockout.GetDuration());
client_lockout_iter->SetExpireTime(lockout.GetExpireTime());
}
}

View File

@ -60,6 +60,8 @@ public:
bool IsSameLockout(const ExpeditionLockoutTimer& compare_lockout) const;
bool IsSameLockout(const std::string& expedition_name, const std::string& event_name) const;
void Reset() { m_expire_time = std::chrono::system_clock::now() + m_duration; }
void SetDuration(uint32_t seconds) { m_duration = std::chrono::seconds(seconds); }
void SetExpireTime(uint64_t expire_time) { m_expire_time = std::chrono::system_clock::from_time_t(expire_time); }
void SetUUID(const std::string& uuid) { m_expedition_uuid = uuid; }
private: