diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index 1efd2707c..50210f2f3 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -10,9 +10,9 @@ SET(world_sources eql_config.cpp eqemu_api_world_data_service.cpp expedition.cpp - expedition_cache.cpp expedition_database.cpp expedition_message.cpp + expedition_state.cpp launcher_link.cpp launcher_list.cpp lfplist.cpp @@ -44,9 +44,9 @@ SET(world_headers eql_config.h eqemu_api_world_data_service.h expedition.h - expedition_cache.h expedition_database.h expedition_message.h + expedition_state.h launcher_link.h launcher_list.h lfplist.h diff --git a/world/expedition_message.cpp b/world/expedition_message.cpp index 990c4dc41..282c2dbe8 100644 --- a/world/expedition_message.cpp +++ b/world/expedition_message.cpp @@ -19,7 +19,7 @@ */ #include "expedition_message.h" -#include "expedition_cache.h" +#include "expedition_state.h" #include "cliententry.h" #include "clientlist.h" #include "zonelist.h" @@ -37,29 +37,29 @@ void ExpeditionMessage::HandleZoneMessage(ServerPacket* pack) case ServerOP_ExpeditionCreate: { auto buf = reinterpret_cast(pack->pBuffer); - expedition_cache.AddExpedition(buf->expedition_id); + expedition_state.AddExpedition(buf->expedition_id); zoneserver_list.SendPacket(pack); break; } case ServerOP_ExpeditionMemberChange: { auto buf = reinterpret_cast(pack->pBuffer); - expedition_cache.MemberChange(buf->expedition_id, buf->char_id, buf->removed); + expedition_state.MemberChange(buf->expedition_id, buf->char_id, buf->removed); zoneserver_list.SendPacket(pack); break; } case ServerOP_ExpeditionMemberSwap: { auto buf = reinterpret_cast(pack->pBuffer); - expedition_cache.MemberChange(buf->expedition_id, buf->remove_char_id, true); - expedition_cache.MemberChange(buf->expedition_id, buf->add_char_id, false); + expedition_state.MemberChange(buf->expedition_id, buf->remove_char_id, true); + expedition_state.MemberChange(buf->expedition_id, buf->add_char_id, false); zoneserver_list.SendPacket(pack); break; } case ServerOP_ExpeditionMembersRemoved: { auto buf = reinterpret_cast(pack->pBuffer); - expedition_cache.RemoveAllMembers(buf->expedition_id); + expedition_state.RemoveAllMembers(buf->expedition_id); zoneserver_list.SendPacket(pack); break; } @@ -101,7 +101,7 @@ void ExpeditionMessage::HandleZoneMessage(ServerPacket* pack) case ServerOP_ExpeditionSecondsRemaining: { auto buf = reinterpret_cast(pack->pBuffer); - expedition_cache.SetSecondsRemaining(buf->expedition_id, buf->new_duration_seconds); + expedition_state.SetSecondsRemaining(buf->expedition_id, buf->new_duration_seconds); break; } } diff --git a/world/expedition_cache.cpp b/world/expedition_state.cpp similarity index 89% rename from world/expedition_cache.cpp rename to world/expedition_state.cpp index 2c1b68f5b..d97c4f72e 100644 --- a/world/expedition_cache.cpp +++ b/world/expedition_state.cpp @@ -18,7 +18,7 @@ * */ -#include "expedition_cache.h" +#include "expedition_state.h" #include "expedition.h" #include "expedition_database.h" #include "zonelist.h" @@ -28,9 +28,9 @@ extern ZSList zoneserver_list; -ExpeditionCache expedition_cache; +ExpeditionState expedition_state; -void ExpeditionCache::LoadActiveExpeditions() +void ExpeditionState::LoadActiveExpeditions() { BenchTimer benchmark; @@ -40,7 +40,7 @@ void ExpeditionCache::LoadActiveExpeditions() LogExpeditions("World caching [{}] expeditions took [{}s]", m_expeditions.size(), elapsed); } -void ExpeditionCache::AddExpedition(uint32_t expedition_id) +void ExpeditionState::AddExpedition(uint32_t expedition_id) { if (expedition_id == 0) { @@ -62,7 +62,7 @@ void ExpeditionCache::AddExpedition(uint32_t expedition_id) } } -void ExpeditionCache::RemoveExpedition(uint32_t expedition_id) +void ExpeditionState::RemoveExpedition(uint32_t expedition_id) { m_expeditions.erase(std::remove_if(m_expeditions.begin(), m_expeditions.end(), [&](const Expedition& expedition) { @@ -71,7 +71,7 @@ void ExpeditionCache::RemoveExpedition(uint32_t expedition_id) ), m_expeditions.end()); } -void ExpeditionCache::MemberChange(uint32_t expedition_id, uint32_t character_id, bool remove) +void ExpeditionState::MemberChange(uint32_t expedition_id, uint32_t character_id, bool remove) { auto it = std::find_if(m_expeditions.begin(), m_expeditions.end(), [&](const Expedition& expedition) { return expedition.GetID() == expedition_id; @@ -87,7 +87,7 @@ void ExpeditionCache::MemberChange(uint32_t expedition_id, uint32_t character_id } } -void ExpeditionCache::RemoveAllMembers(uint32_t expedition_id) +void ExpeditionState::RemoveAllMembers(uint32_t expedition_id) { auto it = std::find_if(m_expeditions.begin(), m_expeditions.end(), [&](const Expedition& expedition) { return expedition.GetID() == expedition_id; @@ -99,7 +99,7 @@ void ExpeditionCache::RemoveAllMembers(uint32_t expedition_id) } } -void ExpeditionCache::SetSecondsRemaining(uint32_t expedition_id, uint32_t seconds_remaining) +void ExpeditionState::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; @@ -111,7 +111,7 @@ void ExpeditionCache::SetSecondsRemaining(uint32_t expedition_id, uint32_t secon } } -void ExpeditionCache::Process() +void ExpeditionState::Process() { if (!m_process_throttle_timer.Check()) { diff --git a/world/expedition_cache.h b/world/expedition_state.h similarity index 92% rename from world/expedition_cache.h rename to world/expedition_state.h index 83632e51e..6a9f230c2 100644 --- a/world/expedition_cache.h +++ b/world/expedition_state.h @@ -18,19 +18,19 @@ * */ -#ifndef WORLD_EXPEDITION_CACHE_H -#define WORLD_EXPEDITION_CACHE_H +#ifndef WORLD_EXPEDITION_STATE_H +#define WORLD_EXPEDITION_STATE_H #include "../common/rulesys.h" #include "../common/timer.h" #include #include -extern class ExpeditionCache expedition_cache; +extern class ExpeditionState expedition_state; class Expedition; -class ExpeditionCache +class ExpeditionState { public: void AddExpedition(uint32_t expedition_id); diff --git a/world/main.cpp b/world/main.cpp index e10b09b45..01682b26a 100644 --- a/world/main.cpp +++ b/world/main.cpp @@ -88,8 +88,8 @@ union semun { #include "queryserv.h" #include "web_interface.h" #include "console.h" -#include "expedition_cache.h" #include "expedition_database.h" +#include "expedition_state.h" #include "../common/net/servertalk_server.h" #include "../zone/data_bucket.h" @@ -436,7 +436,7 @@ int main(int argc, char** argv) { ExpeditionDatabase::PurgeExpiredCharacterLockouts(); LogInfo("Loading active expeditions"); - expedition_cache.LoadActiveExpeditions(); + expedition_state.LoadActiveExpeditions(); LogInfo("Loading char create info"); content_db.LoadCharacterCreateAllocations(); @@ -624,7 +624,7 @@ int main(int argc, char** argv) { launcher_list.Process(); LFPGroupList.Process(); adventure_manager.Process(); - expedition_cache.Process(); + expedition_state.Process(); if (InterserverTimer.Check()) { InterserverTimer.Start();