mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-13 06:21:28 +00:00
Move LoadAllClientLockouts back to a client method
This commit is contained in:
parent
158dad052c
commit
af766dd323
@ -9581,7 +9581,7 @@ void Client::UpdateExpeditionInfoAndLockouts()
|
||||
}
|
||||
}
|
||||
|
||||
Expedition::LoadAllClientLockouts(this);
|
||||
LoadAllExpeditionLockouts();
|
||||
}
|
||||
|
||||
Expedition* Client::CreateExpedition(
|
||||
@ -9704,6 +9704,22 @@ bool Client::HasExpeditionLockout(
|
||||
return (GetExpeditionLockout(expedition_name, event_name, include_expired) != nullptr);
|
||||
}
|
||||
|
||||
void Client::LoadAllExpeditionLockouts()
|
||||
{
|
||||
auto results = ExpeditionDatabase::LoadCharacterLockouts(CharacterID());
|
||||
if (results.Success())
|
||||
{
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
{
|
||||
auto expire_time = strtoull(row[0], nullptr, 10);
|
||||
auto original_duration = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
ExpeditionLockoutTimer lockout{ row[2], row[3], expire_time, original_duration };
|
||||
AddExpeditionLockout(lockout);
|
||||
}
|
||||
}
|
||||
SendExpeditionLockoutTimers();
|
||||
}
|
||||
|
||||
void Client::SendExpeditionLockoutTimers()
|
||||
{
|
||||
std::vector<ExpeditionLockoutTimerEntry_Struct> lockout_entries;
|
||||
|
||||
@ -1134,6 +1134,7 @@ public:
|
||||
void SetPendingExpeditionInvite(uint32 id) { m_pending_expedition_invite_id = id; }
|
||||
void SendExpeditionLockoutTimers();
|
||||
void SetExpeditionID(uint32 expedition_id) { m_expedition_id = expedition_id; };
|
||||
void LoadAllExpeditionLockouts();
|
||||
void UpdateExpeditionInfoAndLockouts();
|
||||
void DzListTimers();
|
||||
void SetDzRemovalTimer(bool enable_timer);
|
||||
|
||||
@ -254,27 +254,6 @@ bool Expedition::CacheAllFromDatabase()
|
||||
return true;
|
||||
}
|
||||
|
||||
void Expedition::LoadAllClientLockouts(Client* client)
|
||||
{
|
||||
if (!client)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
auto results = ExpeditionDatabase::LoadCharacterLockouts(client->CharacterID());
|
||||
if (results.Success())
|
||||
{
|
||||
for (auto row = results.begin(); row != results.end(); ++row)
|
||||
{
|
||||
auto expire_time = strtoull(row[0], nullptr, 10);
|
||||
auto original_duration = static_cast<uint32_t>(strtoul(row[1], nullptr, 10));
|
||||
ExpeditionLockoutTimer lockout{ row[2], row[3], expire_time, original_duration };
|
||||
client->AddExpeditionLockout(lockout);
|
||||
}
|
||||
}
|
||||
client->SendExpeditionLockoutTimers();
|
||||
}
|
||||
|
||||
void Expedition::LoadMembers()
|
||||
{
|
||||
m_members.clear();
|
||||
|
||||
@ -73,7 +73,6 @@ public:
|
||||
static void CacheFromDatabase(uint32_t expedition_id);
|
||||
static bool CacheAllFromDatabase();
|
||||
static void CacheExpeditions(MySQLRequestResult& results);
|
||||
static void LoadAllClientLockouts(Client* client);
|
||||
static Expedition* FindCachedExpeditionByCharacterID(uint32_t character_id);
|
||||
static Expedition* FindCachedExpeditionByCharacterName(const std::string& char_name);
|
||||
static Expedition* FindCachedExpeditionByID(uint32_t expedition_id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user