Ignore expired lockouts on expedition invite

This fixes an edge case with client invites sometimes failing because
an expired lockout hasn't been removed from client yet

Clients no longer receive expired lockouts from expeditions when joining
This commit is contained in:
hg
2020-06-01 18:21:12 -04:00
parent 4284624096
commit f9eafa52f9
5 changed files with 33 additions and 26 deletions
+3 -3
View File
@@ -613,7 +613,7 @@ void Expedition::SendClientExpeditionInvite(
{
// live doesn't issue a warning for the dz's replay timer
const ExpeditionLockoutTimer& lockout = lockout_iter.second;
if (!lockout.IsInherited() && !lockout.IsReplayTimer() &&
if (!lockout.IsInherited() && !lockout.IsExpired() && !lockout.IsReplayTimer() &&
!client->HasExpeditionLockout(m_expedition_name, lockout.GetEventName()))
{
if (!warned)
@@ -680,7 +680,7 @@ bool Expedition::ProcessAddConflicts(Client* leader_client, Client* add_client,
}
}
// check any extra event lockouts for this expedition that the client has and leader doesn't
// check any extra event lockouts for this expedition that the client has and expedition doesn't
auto client_lockouts = add_client->GetExpeditionLockouts(m_expedition_name);
for (const auto& client_lockout : client_lockouts)
{
@@ -776,7 +776,7 @@ void Expedition::DzInviteResponse(Client* add_client, bool accepted, const std::
for (const auto& lockout_iter : m_lockouts)
{
const ExpeditionLockoutTimer& lockout = lockout_iter.second;
if (!lockout.IsInherited() &&
if (!lockout.IsInherited() && !lockout.IsExpired() &&
!add_client->HasExpeditionLockout(m_expedition_name, lockout.GetEventName()))
{
// replay timers are optionally added to new members immediately on