mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 07:18:37 +00:00
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:
+16
-14
@@ -9613,19 +9613,6 @@ Expedition* Client::GetExpedition() const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<ExpeditionLockoutTimer> Client::GetExpeditionLockouts(const std::string& expedition_name)
|
||||
{
|
||||
std::vector<ExpeditionLockoutTimer> lockouts;
|
||||
for (const auto& lockout : m_expedition_lockouts)
|
||||
{
|
||||
if (lockout.GetExpeditionName() == expedition_name)
|
||||
{
|
||||
lockouts.emplace_back(lockout);
|
||||
}
|
||||
}
|
||||
return lockouts;
|
||||
}
|
||||
|
||||
void Client::AddExpeditionLockout(const ExpeditionLockoutTimer& lockout, bool update_db, bool update_client)
|
||||
{
|
||||
// todo: support for account based lockouts like live AoC expeditions
|
||||
@@ -9707,7 +9694,7 @@ const ExpeditionLockoutTimer* Client::GetExpeditionLockout(
|
||||
{
|
||||
for (const auto& expedition_lockout : m_expedition_lockouts)
|
||||
{
|
||||
if ((include_expired || expedition_lockout.GetSecondsRemaining() > 0) &&
|
||||
if ((include_expired || !expedition_lockout.IsExpired()) &&
|
||||
expedition_lockout.IsSameLockout(expedition_name, event_name))
|
||||
{
|
||||
return &expedition_lockout;
|
||||
@@ -9716,6 +9703,21 @@ const ExpeditionLockoutTimer* Client::GetExpeditionLockout(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::vector<ExpeditionLockoutTimer> Client::GetExpeditionLockouts(
|
||||
const std::string& expedition_name, bool include_expired)
|
||||
{
|
||||
std::vector<ExpeditionLockoutTimer> lockouts;
|
||||
for (const auto& lockout : m_expedition_lockouts)
|
||||
{
|
||||
if ((include_expired || !lockout.IsExpired()) &&
|
||||
lockout.GetExpeditionName() == expedition_name)
|
||||
{
|
||||
lockouts.emplace_back(lockout);
|
||||
}
|
||||
}
|
||||
return lockouts;
|
||||
}
|
||||
|
||||
bool Client::HasExpeditionLockout(
|
||||
const std::string& expedition_name, const std::string& event_name, bool include_expired)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user