mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-01 11:36:36 +00:00
Add api to update expedition expire time
Add SetSecondsRemaining method to set expire time on expedition
This commit is contained in:
@@ -157,6 +157,18 @@ void ExpeditionCache::RemoveAllMembers(uint32_t expedition_id)
|
||||
}
|
||||
}
|
||||
|
||||
void ExpeditionCache::SetSecondsRemaining(uint32_t expedition_id, uint32_t seconds_remaining)
|
||||
{
|
||||
auto it = std::find_if(m_expeditions.begin(), m_expeditions.end(), [&](const Expedition& expedition) {
|
||||
return expedition.GetID() == expedition_id;
|
||||
});
|
||||
|
||||
if (it != m_expeditions.end())
|
||||
{
|
||||
it->UpdateDzSecondsRemaining(seconds_remaining);
|
||||
}
|
||||
}
|
||||
|
||||
void ExpeditionCache::Process()
|
||||
{
|
||||
if (!m_process_throttle_timer.Check())
|
||||
@@ -448,6 +460,12 @@ void ExpeditionMessage::HandleZoneMessage(ServerPacket* pack)
|
||||
ExpeditionMessage::RequestInvite(pack);
|
||||
break;
|
||||
}
|
||||
case ServerOP_ExpeditionSecondsRemaining:
|
||||
{
|
||||
auto buf = reinterpret_cast<ServerExpeditionUpdateDuration_Struct*>(pack->pBuffer);
|
||||
expedition_cache.SetSecondsRemaining(buf->expedition_id, buf->new_duration_seconds);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ public:
|
||||
void LoadActiveExpeditions();
|
||||
void MemberChange(uint32_t expedition_id, uint32_t character_id, bool remove);
|
||||
void RemoveAllMembers(uint32_t expedition_id);
|
||||
void SetSecondsRemaining(uint32_t expedition_id, uint32_t seconds_remaining);
|
||||
void Process();
|
||||
|
||||
private:
|
||||
|
||||
@@ -1385,6 +1385,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
case ServerOP_ExpeditionCharacterLockout:
|
||||
case ServerOP_ExpeditionSaveInvite:
|
||||
case ServerOP_ExpeditionRequestInvite:
|
||||
case ServerOP_ExpeditionSecondsRemaining:
|
||||
{
|
||||
ExpeditionMessage::HandleZoneMessage(pack);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user