Let world dispatch expedition expire warnings

This depends on C++14 remaining enabled for chrono literals
This commit is contained in:
hg
2020-10-06 22:23:31 -04:00
parent da5d4b9830
commit ca113cdd85
5 changed files with 44 additions and 17 deletions
-10
View File
@@ -1742,16 +1742,6 @@ void Expedition::SendWorldSetSecondsRemaining(uint32_t seconds_remaining)
worldserver.SendPacket(pack.get());
}
void Expedition::SendWorldExpireWarning(uint32_t minutes_remaining)
{
uint32_t pack_size = sizeof(ServerExpeditionExpireWarning_Struct);
auto pack = std::unique_ptr<ServerPacket>(new ServerPacket(ServerOP_ExpeditionExpireWarning, pack_size));
auto buf = reinterpret_cast<ServerExpeditionExpireWarning_Struct*>(pack->pBuffer);
buf->expedition_id = GetID();
buf->minutes_remaining = minutes_remaining;
worldserver.SendPacket(pack.get());
}
void Expedition::AddLockoutByCharacterID(
uint32_t character_id, const std::string& expedition_name, const std::string& event_name,
uint32_t seconds, const std::string& uuid)
-1
View File
@@ -142,7 +142,6 @@ public:
void SetLootEventBySpawnID(uint32_t spawn_id, const std::string& event_name);
void SendClientExpeditionInfo(Client* client);
void SendWorldExpireWarning(uint32_t minutes);
void SendWorldPendingInvite(const ExpeditionInvite& invite, const std::string& add_name);
void DzAddPlayer(Client* requester, const std::string& add_char_name, const std::string& swap_remove_name = {});
+3 -6
View File
@@ -1524,16 +1524,13 @@ bool Zone::Process() {
if (minutes_warning > 0)
{
// expedition expire warnings are handled by world
auto expedition = Expedition::FindCachedExpeditionByZoneInstance(GetZoneID(), GetInstanceID());
if (expedition)
{
expedition->SendWorldExpireWarning(minutes_warning);
}
else
if (!expedition)
{
entity_list.ExpeditionWarning(minutes_warning);
Instance_Warning_timer = new Timer(10000);
}
Instance_Warning_timer = new Timer(10000);
}
}
else if(Instance_Warning_timer->Check())