mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Expeditions] Refactor expedition caching (#1315)
Add common expedition base class Use repository for zone and world expedition caching World now stores members and leader as Member objects instead of ids This improves readability of the caching methods and lets world cache expedition dzs and members like zone. World also now caches expeditions as unique_ptr which will be necessary for future dz callback lambdas that capture 'this' so addresses don't change on cache vector resizes.
This commit is contained in:
@@ -64,22 +64,6 @@ DynamicZone* DynamicZone::FindDynamicZoneByID(uint32_t dz_id)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::unordered_map<uint32_t, DynamicZone> DynamicZone::LoadMultipleDzFromDatabase(
|
||||
const std::vector<uint32_t>& dynamic_zone_ids)
|
||||
{
|
||||
LogDynamicZonesDetail("Loading dynamic zone data for [{}] instances", dynamic_zone_ids.size());
|
||||
|
||||
std::unordered_map<uint32_t, DynamicZone> dynamic_zones;
|
||||
|
||||
auto entries = DynamicZonesRepository::GetWithInstance(database, dynamic_zone_ids);
|
||||
for (auto& entry : entries)
|
||||
{
|
||||
dynamic_zones.emplace(entry.id, std::move(entry));
|
||||
}
|
||||
|
||||
return dynamic_zones;
|
||||
}
|
||||
|
||||
void DynamicZone::StartAllClientRemovalTimers()
|
||||
{
|
||||
for (const auto& client_iter : entity_list.GetClientList())
|
||||
|
||||
Reference in New Issue
Block a user