Add character id based expedition apis

Add static expedition methods to add or remove character lockouts

Add CreateLockout static helper to ExpeditionLockoutTimer

Refactor existing character lockout removal to allow removal of lockouts
for offline characters (was only used by #dz lockouts remove command)

Fix #dz list member count
This commit is contained in:
hg
2020-07-02 22:50:56 -04:00
parent 09d7731ccf
commit 0d8df60358
15 changed files with 257 additions and 63 deletions
+14
View File
@@ -20,6 +20,7 @@
#include "expedition_lockout_timer.h"
#include "../common/string_util.h"
#include "../common/util/uuid.h"
#include <fmt/format.h>
const char* const DZ_REPLAY_TIMER_NAME = "Replay Timer"; // see December 14, 2016 patch notes
@@ -40,6 +41,19 @@ ExpeditionLockoutTimer::ExpeditionLockoutTimer(
}
}
ExpeditionLockoutTimer ExpeditionLockoutTimer::CreateLockout(
const std::string& expedition_name, const std::string& event_name, uint32_t seconds, std::string uuid)
{
if (uuid.empty())
{
uuid = EQ::Util::UUID::Generate().ToString();
}
ExpeditionLockoutTimer lockout{uuid, expedition_name, event_name, 0, seconds};
lockout.Reset(); // sets expire time
return lockout;
}
uint32_t ExpeditionLockoutTimer::GetSecondsRemaining() const
{
auto now = std::chrono::system_clock::now();