[Code] ZoneStore Global to Singleton Cleanup (#4934)

This commit is contained in:
Alex King
2025-06-23 06:45:06 -04:00
committed by GitHub
parent bac892b582
commit 2e760d6397
26 changed files with 379 additions and 384 deletions
+1 -1
View File
@@ -2368,7 +2368,7 @@ bool Client::StoreCharacter(
return false;
}
const std::string& zone_name = zone_store.GetZoneName(p_player_profile_struct->zone_id, true);
const std::string& zone_name = ZoneStore::Instance()->GetZoneName(p_player_profile_struct->zone_id, true);
if (Strings::EqualFold(zone_name, "UNKNOWN")) {
p_player_profile_struct->zone_id = Zones::QEYNOS;
}
+2 -2
View File
@@ -1219,7 +1219,7 @@ void ConsoleCrossZoneMove(
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
const auto& z = !zone_short_name.empty() ? zone_store.GetZone(zone_short_name) : nullptr;
const auto& z = !zone_short_name.empty() ? ZoneStore::Instance()->GetZone(zone_short_name) : nullptr;
if (z && !z->id) {
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
@@ -1289,7 +1289,7 @@ void ConsoleWorldWideMove(
const auto& zone_short_name = !Strings::IsNumber(args[2]) ? args[2] : "";
const uint16 instance_id = Strings::IsNumber(args[2]) ? static_cast<uint16>(Strings::ToUnsignedInt(args[2])) : 0;
const auto& z = !zone_short_name.empty() ? zone_store.GetZone(zone_short_name) : nullptr;
const auto& z = !zone_short_name.empty() ? ZoneStore::Instance()->GetZone(zone_short_name) : nullptr;
if (z && !z->id) {
connection->SendLine(fmt::format("No zone with the short name '{}' exists.", zone_short_name));
-1
View File
@@ -91,7 +91,6 @@
#include "../common/repositories/character_parcels_repository.h"
#include "../common/ip_util.h"
ZoneStore zone_store;
ClientList client_list;
GroupLFPList LFPGroupList;
ZSList zoneserver_list;
+2 -2
View File
@@ -279,9 +279,9 @@ bool WorldBoot::DatabaseLoadRoutines(int argc, char **argv)
LogInfo("Loading zones");
zone_store.LoadZones(content_db);
ZoneStore::Instance()->LoadZones(content_db);
if (zone_store.GetZones().empty()) {
if (ZoneStore::Instance()->GetZones().empty()) {
LogError("Failed to load zones data, check your schema for possible errors");
return 1;
}