Add api to update expedition expire time

Add SetSecondsRemaining method to set expire time on expedition
This commit is contained in:
hg
2020-09-24 19:23:37 -04:00
parent 2c2c2ac5ee
commit b965a165b1
9 changed files with 51 additions and 2 deletions
+18
View File
@@ -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;
}
}
}