diff --git a/CMakeLists.txt b/CMakeLists.txt
index f93cabb22..e53a05bef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -42,6 +42,7 @@ IF(USE_MAP_MMFS)
ENDIF (USE_MAP_MMFS)
IF(MSVC)
+ add_compile_options(/bigobj)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-DNOMINMAX)
ADD_DEFINITIONS(-DCRASH_LOGGING)
diff --git a/README.md b/README.md
index 1a2ae2b3a..033fcccab 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@
-EverQuest Emulator (EQEmu) - A Fan-Made Project Honoring the Legendary MMORPG
+EQEmulator - A Fan-Made Project Honoring a Legendary MMORPG
@@ -26,19 +26,19 @@
***
-EQEmulator is a passion-driven, open source server emulator project dedicated to preserving and celebrating the groundbreaking world of EverQuest, the massively multiplayer online role-playing game originally developed by Verant Interactive and Sony Online Entertainment (now Daybreak Game Company).
+EQEmulator is a passion-driven, open source server emulator project dedicated to preserving and celebrating the legacy of a groundbreaking classic MMORPG.
-For over two decades and continuing, EQEmulator has served as a fan tribute, providing tools and technology that allow players to explore, customize, and experience EverQuest’s iconic gameplay in new ways. This project exists solely out of deep admiration for the original developers, artists, designers, and visionaries who created one of the most influential online worlds of all time.
+For over two decades and continuing, EQEmulator has served as a fan tribute, providing tools and technology that allow players to explore, customize, and experience the legendary game's iconic gameplay in new ways. This project exists solely out of deep admiration for the original developers, artists, designers, and visionaries who created one of the most influential online worlds of all time.
-We do not claim ownership of EverQuest or its assets. All credit and respect belong to the original creators and Daybreak Game Company, whose work continues to inspire generations of players and developers alike.
+We do not claim ownership of the original game or its assets. All credit and respect belong to the original creators and Daybreak Game Company, whose work continues to inspire generations of players and developers alike.
-EQEmulator has for over 20 years and always will be a fan-based, non-commercial open-source effort made by players, for players—preserving the legacy of EverQuest while empowering community-driven creativity, learning and joy that the game and its creators has so strongly inspired in us all.
+EQEmulator has for over 20 years and always will be a fan-based, non-commercial open-source effort made by players, for players—preserving the legacy of the game while empowering community-driven creativity, learning and joy that the game and its creators has so strongly inspired in us all.
***
@@ -47,7 +47,7 @@ EQEmulator has for over 20 years and always will be a fan-based, non-com
Technical Overview & Reverse Engineering Effort
-EQEmulator represents over two decades of collaborative reverse engineering, rebuilding the EverQuest server from the ground up without access to the original source code. This effort was achieved entirely through community-driven analysis, network protocol decoding, and in-game behavioral research.
+EQEmulator represents over two decades of collaborative reverse engineering, building the server from the ground up without access to the original source code. This effort was achieved entirely through community-driven analysis, network protocol decoding, and in-game behavioral research.
💡 How We Did It
@@ -104,10 +104,10 @@ Every system, packet, opcode, and game mechanic has been reconstructed through c
🚀 Why It Matters
-🧬 EQEmulator stands as a technical preservation project, ensuring that the magic of classic and custom EverQuest servers lives on for future generations of players, tinkerers, and game designers.
+
🧬 EQEmulator stands as a technical preservation project, ensuring that the magic of classic and custom servers lives on for future generations of players, tinkerers, and game designers.
-> We humbly acknowledge and thank the original developers at **Verant Interactive** and **Sony Online Entertainment (now Daybreak Game Company)** for creating one of the most influential online experiences in gaming history.
+> We humbly acknowledge and thank the original developers for creating one of the most influential online experiences in gaming history.
🧑💻🖥️ Supported Clients
@@ -148,4 +148,3 @@ If you want to set up your own EQEmulator server, please refer to the current [s
-
diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp
index a930d5404..f7519d040 100644
--- a/client_files/export/main.cpp
+++ b/client_files/export/main.cpp
@@ -38,12 +38,8 @@
#include "../../common/skill_caps.h"
#include "../../common/evolving_items.h"
-EQEmuLogSys LogSys;
WorldContentService content_service;
-ZoneStore zone_store;
-PathManager path;
PlayerEventLogs player_event_logs;
-EvolvingItemsManager evolving_items_manager;
void ExportSpells(SharedDatabase *db);
void ExportSkillCaps(SharedDatabase *db);
@@ -53,10 +49,10 @@ void ExportDBStrings(SharedDatabase *db);
int main(int argc, char **argv)
{
RegisterExecutablePlatform(ExePlatformClientExport);
- LogSys.LoadLogSettingsDefaults();
+ EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
set_exception_handler();
- path.LoadPaths();
+ PathManager::Instance()->Init();
LogInfo("Client Files Export Utility");
if (!EQEmuConfig::LoadConfig()) {
@@ -99,8 +95,8 @@ int main(int argc, char **argv)
content_db.SetMySQL(database);
}
- LogSys.SetDatabase(&database)
- ->SetLogPath(path.GetLogPath())
+ EQEmuLogSys::Instance()->SetDatabase(&database)
+ ->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();
@@ -129,14 +125,14 @@ int main(int argc, char **argv)
ExportBaseData(&content_db);
ExportDBStrings(&database);
- LogSys.CloseFileLogs();
+ EQEmuLogSys::Instance()->CloseFileLogs();
return 0;
}
void ExportSpells(SharedDatabase* db)
{
- std::ofstream file(fmt::format("{}/export/spells_us.txt", path.GetServerPath()));
+ std::ofstream file(fmt::format("{}/export/spells_us.txt", PathManager::Instance()->GetServerPath()));
if (!file || !file.is_open()) {
LogError("Unable to open export/spells_us.txt to write, skipping.");
return;
@@ -155,7 +151,7 @@ void ExportSpells(SharedDatabase* db)
void ExportSkillCaps(SharedDatabase* db)
{
- std::ofstream file(fmt::format("{}/export/SkillCaps.txt", path.GetServerPath()));
+ std::ofstream file(fmt::format("{}/export/SkillCaps.txt", PathManager::Instance()->GetServerPath()));
if (!file || !file.is_open()) {
LogError("Unable to open export/SkillCaps.txt to write, skipping.");
return;
@@ -174,7 +170,7 @@ void ExportSkillCaps(SharedDatabase* db)
void ExportBaseData(SharedDatabase *db)
{
- std::ofstream file(fmt::format("{}/export/BaseData.txt", path.GetServerPath()));
+ std::ofstream file(fmt::format("{}/export/BaseData.txt", PathManager::Instance()->GetServerPath()));
if (!file || !file.is_open()) {
LogError("Unable to open export/BaseData.txt to write, skipping.");
return;
@@ -193,7 +189,7 @@ void ExportBaseData(SharedDatabase *db)
void ExportDBStrings(SharedDatabase *db)
{
- std::ofstream file(fmt::format("{}/export/dbstr_us.txt", path.GetServerPath()));
+ std::ofstream file(fmt::format("{}/export/dbstr_us.txt", PathManager::Instance()->GetServerPath()));
if (!file || !file.is_open()) {
LogError("Unable to open export/dbstr_us.txt to write, skipping.");
return;
diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp
index 74f447a23..ab3d184df 100644
--- a/client_files/import/main.cpp
+++ b/client_files/import/main.cpp
@@ -32,12 +32,8 @@
#include "../../common/events/player_event_logs.h"
#include "../../common/evolving_items.h"
-EQEmuLogSys LogSys;
WorldContentService content_service;
-ZoneStore zone_store;
-PathManager path;
PlayerEventLogs player_event_logs;
-EvolvingItemsManager evolving_items_manager;
void ImportSpells(SharedDatabase *db);
void ImportSkillCaps(SharedDatabase *db);
@@ -46,10 +42,10 @@ void ImportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientImport);
- LogSys.LoadLogSettingsDefaults();
+ EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
set_exception_handler();
- path.LoadPaths();
+ PathManager::Instance()->Init();
LogInfo("Client Files Import Utility");
if(!EQEmuConfig::LoadConfig()) {
@@ -92,8 +88,8 @@ int main(int argc, char **argv) {
content_db.SetMySQL(database);
}
- LogSys.SetDatabase(&database)
- ->SetLogPath(path.GetLogPath())
+ EQEmuLogSys::Instance()->SetDatabase(&database)
+ ->SetLogPath(PathManager::Instance()->GetLogPath())
->LoadLogDatabaseSettings()
->StartFileLogs();
@@ -102,7 +98,7 @@ int main(int argc, char **argv) {
ImportBaseData(&content_db);
ImportDBStrings(&database);
- LogSys.CloseFileLogs();
+ EQEmuLogSys::Instance()->CloseFileLogs();
return 0;
}
@@ -138,7 +134,7 @@ bool IsStringField(int i) {
void ImportSpells(SharedDatabase *db) {
LogInfo("Importing Spells");
- std::string file = fmt::format("{}/import/spells_us.txt", path.GetServerPath());
+ std::string file = fmt::format("{}/import/spells_us.txt", PathManager::Instance()->GetServerPath());
FILE *f = fopen(file.c_str(), "r");
if(!f) {
LogError("Unable to open {} to read, skipping.", file);
@@ -228,7 +224,7 @@ void ImportSpells(SharedDatabase *db) {
void ImportSkillCaps(SharedDatabase *db) {
LogInfo("Importing Skill Caps");
- std::string file = fmt::format("{}/import/SkillCaps.txt", path.GetServerPath());
+ std::string file = fmt::format("{}/import/SkillCaps.txt", PathManager::Instance()->GetServerPath());
FILE *f = fopen(file.c_str(), "r");
if(!f) {
LogError("Unable to open {} to read, skipping.", file);
@@ -265,7 +261,7 @@ void ImportBaseData(SharedDatabase *db)
{
LogInfo("Importing Base Data");
- const std::string& file_name = fmt::format("{}/import/BaseData.txt", path.GetServerPath());
+ const std::string& file_name = fmt::format("{}/import/BaseData.txt", PathManager::Instance()->GetServerPath());
const auto& file_contents = File::GetContents(file_name);
if (!file_contents.error.empty()) {
@@ -305,7 +301,7 @@ void ImportBaseData(SharedDatabase *db)
void ImportDBStrings(SharedDatabase *db) {
LogInfo("Importing DB Strings");
- std::string file = fmt::format("{}/import/dbstr_us.txt", path.GetServerPath());
+ std::string file = fmt::format("{}/import/dbstr_us.txt", PathManager::Instance()->GetServerPath());
FILE *f = fopen(file.c_str(), "r");
if(!f) {
LogError("Unable to open {} to read, skipping.", file);
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index 0350cb6d4..787cd299c 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -842,7 +842,7 @@ IF (UNIX)
ENDIF (UNIX)
IF (WIN32 AND EQEMU_BUILD_PCH)
- TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/pch.h)
+ TARGET_PRECOMPILE_HEADERS(common PRIVATE pch/std-pch.h)
ENDIF ()
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
diff --git a/common/content/world_content_service.cpp b/common/content/world_content_service.cpp
index 7d23c9d13..b54dd7032 100644
--- a/common/content/world_content_service.cpp
+++ b/common/content/world_content_service.cpp
@@ -185,7 +185,7 @@ void WorldContentService::ReloadContentFlags()
SetContentFlags(set_content_flags);
LoadStaticGlobalZoneInstances();
- zone_store.LoadZones(*m_content_database);
+ ZoneStore::Instance()->LoadZones(*m_content_database);
}
Database *WorldContentService::GetDatabase() const
@@ -291,7 +291,7 @@ WorldContentService *WorldContentService::LoadStaticGlobalZoneInstances()
// instance_list table entry for lavastorm has version = 1, is_global = 1, never_expires = 1
WorldContentService::FindZoneResult WorldContentService::FindZone(uint32 zone_id, uint32 instance_id)
{
- for (const auto &z: zone_store.GetZones()) {
+ for (const auto &z: ZoneStore::Instance()->GetZones()) {
for (auto &i: m_zone_static_instances) {
if (
z.zoneidnumber == zone_id &&
diff --git a/common/crash.cpp b/common/crash.cpp
index 3828a9af0..968a7c5ff 100644
--- a/common/crash.cpp
+++ b/common/crash.cpp
@@ -27,6 +27,8 @@ void SendCrashReport(const std::string &crash_report)
// "http://localhost:3010/api/v1/analytics/server-crash-report", // development
};
+ EQEmuLogSys* log = EQEmuLogSys::Instance();
+
auto config = EQEmuConfig::get();
for (auto &e: endpoints) {
uri u(e);
@@ -68,12 +70,12 @@ void SendCrashReport(const std::string &crash_report)
p["cpus"] = cpus.size();
p["origination_info"] = "";
- if (!LogSys.origination_info.zone_short_name.empty()) {
+ if (!log->origination_info.zone_short_name.empty()) {
p["origination_info"] = fmt::format(
"{} ({}) instance_id [{}]",
- LogSys.origination_info.zone_short_name,
- LogSys.origination_info.zone_long_name,
- LogSys.origination_info.instance_id
+ log->origination_info.zone_short_name,
+ log->origination_info.zone_long_name,
+ log->origination_info.instance_id
);
}
@@ -294,7 +296,7 @@ void print_trace()
SendCrashReport(crash_report);
}
- LogSys.CloseFileLogs();
+ EQEmuLogSys::Instance()->CloseFileLogs();
exit(1);
}
diff --git a/common/data_bucket.cpp b/common/data_bucket.cpp
index d0ad01b7e..166100549 100644
--- a/common/data_bucket.cpp
+++ b/common/data_bucket.cpp
@@ -19,6 +19,37 @@ extern WorldDatabase database;
#error "You must define either ZONE or WORLD"
#endif
+// Key: compound cache key (e.g., account_id|character_id|zone_id|instance_id|top_key|full_key)
+// Value: resolved DataBuckets with extracted nested value
+static std::unordered_map g_nested_bucket_cache;
+
+static std::string MakeNestedCacheKey(const DataBucketKey &k, const std::string &full_key) {
+ return fmt::format(
+ "account_id:{}|character_id:{}|npc_id:{}|bot_id:{}|zone_id:{}|instance_id:{}|top_key:{}|full_key:{}",
+ k.account_id, k.character_id, k.npc_id, k.bot_id, k.zone_id, k.instance_id,
+ Strings::Split(full_key, NESTED_KEY_DELIMITER).front(),
+ full_key
+ );
+}
+
+static std::string MakeNestedCacheKeyPrefix(const DataBucketKey &k, const std::string &top_key) {
+ return fmt::format(
+ "account_id:{}|character_id:{}|npc_id:{}|bot_id:{}|zone_id:{}|instance_id:{}|top_key:{}|",
+ k.account_id, k.character_id, k.npc_id, k.bot_id, k.zone_id, k.instance_id, top_key
+ );
+}
+
+static void InvalidateNestedCacheForKey(const DataBucketKey &k, const std::string &top_key) {
+ std::string prefix = MakeNestedCacheKeyPrefix(k, top_key);
+ for (auto it = g_nested_bucket_cache.begin(); it != g_nested_bucket_cache.end(); ) {
+ if (it->first.find(prefix) == 0) {
+ it = g_nested_bucket_cache.erase(it);
+ } else {
+ ++it;
+ }
+ }
+}
+
void DataBucket::SetData(const std::string &bucket_key, const std::string &bucket_value, std::string expires_time)
{
auto k = DataBucketKey{
@@ -136,6 +167,15 @@ void DataBucket::SetData(const DataBucketKey &k_)
// Serialize JSON back to string
b.value = json_value.dump();
b.key_ = top_key; // Use the top-level key
+
+ if (CanCache(k_)) {
+ InvalidateNestedCacheForKey(k_, top_key);
+ std::string nested_cache_key = MakeNestedCacheKey(k_, k_.key);
+ auto extracted = ExtractNestedValue(b, k_.key);
+ if (extracted.id > 0) {
+ g_nested_bucket_cache[nested_cache_key] = extracted;
+ }
+ }
}
if (bucket_id) {
@@ -251,12 +291,27 @@ DataBucketsRepository::DataBuckets DataBucket::GetData(const DataBucketKey &k_,
LogDataBuckets("Returning key [{}] value [{}] from cache", e.key_, e.value);
if (is_nested_key && !k_.key.empty()) {
- return ExtractNestedValue(e, k_.key);
+ std::string nested_cache_key = MakeNestedCacheKey(k_, k.key);
+
+ auto it = g_nested_bucket_cache.find(nested_cache_key);
+ if (it != g_nested_bucket_cache.end()) {
+ LogDataBucketsDetail("Nested cache hit for key [{}]", nested_cache_key);
+ return it->second;
+ }
+
+ auto extracted = ExtractNestedValue(e, k_.key);
+ if (extracted.id > 0) {
+ g_nested_bucket_cache[nested_cache_key] = extracted;
+ }
+ return extracted;
}
return e;
}
}
+
+ // if we can cache its assumed we didn't load this into the cache so we should not return a miss
+ return DataBucketsRepository::NewEntity(); // Not found in cache
}
// Fetch the value from the database
@@ -315,23 +370,42 @@ DataBucketsRepository::DataBuckets DataBucket::GetData(const DataBucketKey &k_,
}
// Add the value to the cache if it doesn't exist
+ // If cacheable and not found in cache, short-circuit and assume it doesn't exist
if (can_cache) {
- bool has_cache = false;
+ bool found_in_cache = false;
for (const auto &e : g_data_bucket_cache) {
- if (e.id == bucket.id) {
- has_cache = true;
+ if (CheckBucketMatch(e, k)) {
+ found_in_cache = true;
break;
}
}
- if (!has_cache) {
- g_data_bucket_cache.emplace_back(bucket);
+ if (!found_in_cache) {
+ LogDataBuckets("Cache miss for key [{}] - skipping DB due to CanCache", k.key);
+ return DataBucketsRepository::NewEntity();
}
}
// Handle nested key extraction
if (is_nested_key && !k_.key.empty()) {
- return ExtractNestedValue(bucket, k_.key);
+ if (CanCache(k_)) {
+ std::string nested_cache_key = MakeNestedCacheKey(k_, k.key);
+
+ auto it = g_nested_bucket_cache.find(nested_cache_key);
+ if (it != g_nested_bucket_cache.end()) {
+ LogDataBucketsDetail("Nested cache hit for key [{}]", nested_cache_key);
+ return it->second;
+ }
+
+ auto extracted = ExtractNestedValue(bucket, k_.key);
+ if (extracted.id > 0) {
+ g_nested_bucket_cache[nested_cache_key] = extracted;
+ }
+ return extracted;
+ } else {
+ // Not cacheable, just extract and return
+ return ExtractNestedValue(bucket, k_.key);
+ }
}
return bucket;
diff --git a/common/database.cpp b/common/database.cpp
index c79ae0117..099b796ad 100644
--- a/common/database.cpp
+++ b/common/database.cpp
@@ -708,6 +708,20 @@ const std::string Database::GetNPCNameByID(uint32 npc_id)
return e.id ? e.name : std::string();
}
+template
+inline auto CleanMobName(InputIterator first, InputIterator last, OutputIterator result)
+{
+ for (; first != last; ++first) {
+ if (*first == '_') {
+ *result = ' ';
+ }
+ else if (isalpha(*first) || *first == '`') {
+ *result = *first;
+ }
+ }
+ return result;
+}
+
const std::string Database::GetCleanNPCNameByID(uint32 npc_id)
{
const auto& e = NpcTypesRepository::FindOne(*this, npc_id);
diff --git a/common/database/database_dump_service.cpp b/common/database/database_dump_service.cpp
index acf0f4de0..6cbea2d48 100644
--- a/common/database/database_dump_service.cpp
+++ b/common/database/database_dump_service.cpp
@@ -204,7 +204,7 @@ void DatabaseDumpService::DatabaseDump()
}
if (IsDumpOutputToConsole()) {
- LogSys.SilenceConsoleLogging();
+ EQEmuLogSys::Instance()->SilenceConsoleLogging();
}
LogInfo("MySQL installed [{}]", GetMySQLVersion());
@@ -324,7 +324,7 @@ void DatabaseDumpService::DatabaseDump()
}
if (!IsDumpOutputToConsole()) {
- LogSys.LoadLogSettingsDefaults();
+ EQEmuLogSys::Instance()->LoadLogSettingsDefaults();
}
if (!pipe_file.empty()) {
diff --git a/common/database/database_update.cpp b/common/database/database_update.cpp
index c82e2e727..d296aa92b 100644
--- a/common/database/database_update.cpp
+++ b/common/database/database_update.cpp
@@ -154,7 +154,7 @@ bool DatabaseUpdate::UpdateManifest(
std::vector missing_migrations = {};
if (version_low != version_high) {
- LogSys.DisableMySQLErrorLogs();
+ EQEmuLogSys::Instance()->DisableMySQLErrorLogs();
bool force_interactive = false;
for (int version = version_low + 1; version <= version_high; ++version) {
for (auto &e: entries) {
@@ -184,7 +184,7 @@ bool DatabaseUpdate::UpdateManifest(
}
}
}
- LogSys.EnableMySQLErrorLogs();
+ EQEmuLogSys::Instance()->EnableMySQLErrorLogs();
LogInfo("{}", Strings::Repeat("-", BREAK_LENGTH));
if (!missing_migrations.empty() && m_skip_backup) {
diff --git a/common/database/database_update.h b/common/database/database_update.h
index 03d55d5ea..a445422bc 100644
--- a/common/database/database_update.h
+++ b/common/database/database_update.h
@@ -33,6 +33,13 @@ public:
DatabaseUpdate *SetContentDatabase(Database *db);
DatabaseUpdate *SetSkipBackup(bool skip);
bool HasPendingUpdates();
+
+ static DatabaseUpdate* Instance()
+ {
+ static DatabaseUpdate instance;
+ return &instance;
+ }
+
private:
bool m_skip_backup = false;
Database *m_database;
diff --git a/common/database/database_update_manifest.cpp b/common/database/database_update_manifest.cpp
index 1b2f7bc61..5a3a8f683 100644
--- a/common/database/database_update_manifest.cpp
+++ b/common/database/database_update_manifest.cpp
@@ -7109,6 +7109,18 @@ ALTER TABLE `npc_types`
ALTER TABLE `character_data`
CHANGE COLUMN `firstlogon` `ingame` tinyint(1) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`,
ADD COLUMN `first_login` int(11) UNSIGNED NOT NULL DEFAULT 0 AFTER `xtargets`;
+)",
+ .content_schema_update = false
+ },
+ ManifestEntry{
+ .version = 9324,
+ .description = "2025_06_11_player_event_logs_table.sql",
+ .check = "SHOW CREATE TABLE `player_event_logs`",
+ .condition = "missing",
+ .match = "COMPRESS",
+ .sql = R"(
+ALTER TABLE player_event_logs ROW_FORMAT=COMPRESSED;
+CREATE INDEX idx_event_type_char_id ON player_event_logs (event_type_id, character_id);
)",
.content_schema_update = false
},
diff --git a/common/dbcore.cpp b/common/dbcore.cpp
index a6117cfd2..ff0afac3a 100644
--- a/common/dbcore.cpp
+++ b/common/dbcore.cpp
@@ -160,7 +160,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
(uint32) mysql_insert_id(mysql)
);
- if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
+ if (EQEmuLogSys::Instance()->log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
if ((strncasecmp(query, "select", 6) == 0)) {
LogMySQLQuery(
"{0} -- ({1} row{2} returned) ({3}s)",
diff --git a/common/discord/discord.h b/common/discord/discord.h
index 5cc59202a..8b8a19290 100644
--- a/common/discord/discord.h
+++ b/common/discord/discord.h
@@ -4,7 +4,6 @@
#include
#include "../types.h"
-#include "../http/httplib.h"
#include "../repositories/player_event_logs_repository.h"
#include "../events/player_events.h"
diff --git a/common/discord/discord_manager.cpp b/common/discord/discord_manager.cpp
index a425d4c34..dd84d863f 100644
--- a/common/discord/discord_manager.cpp
+++ b/common/discord/discord_manager.cpp
@@ -26,7 +26,7 @@ void DiscordManager::ProcessMessageQueue()
continue;
}
- auto webhook = LogSys.GetDiscordWebhooks()[q.first];
+ auto webhook = EQEmuLogSys::Instance()->GetDiscordWebhooks()[q.first];
std::string message;
for (auto &m: q.second) {
diff --git a/common/discord/discord_manager.h b/common/discord/discord_manager.h
index f577d994f..d02180859 100644
--- a/common/discord/discord_manager.h
+++ b/common/discord/discord_manager.h
@@ -13,6 +13,12 @@ public:
void QueueWebhookMessage(uint32 webhook_id, const std::string& message);
void ProcessMessageQueue();
void QueuePlayerEventMessage(const PlayerEvent::PlayerEventContainer& e);
+
+ static DiscordManager* Instance()
+ {
+ static DiscordManager instance;
+ return &instance;
+ }
private:
std::mutex webhook_queue_lock{};
std::map> webhook_message_queue{};
diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp
index 0182c53f4..d17ed54c0 100644
--- a/common/eq_stream.cpp
+++ b/common/eq_stream.cpp
@@ -545,13 +545,13 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p)
uint32 chunksize, used;
uint32 length;
- if (LogSys.log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
+ if (EQEmuLogSys::Instance()->log_settings[Logs::Server_Client_Packet].is_category_enabled == 1){
if (p->GetOpcode() != OP_SpecialMesg){
Log(Logs::General, Logs::Server_Client_Packet, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size());
}
}
- if (LogSys.log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
+ if (EQEmuLogSys::Instance()->log_settings[Logs::Server_Client_Packet_With_Dump].is_category_enabled == 1){
if (p->GetOpcode() != OP_SpecialMesg){
Log(Logs::General, Logs::Server_Client_Packet_With_Dump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(p->GetOpcode()), p->GetOpcode(), p->Size(), DumpPacketToString(p).c_str());
}
diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp
index 453234604..e2f35106c 100644
--- a/common/eqemu_config.cpp
+++ b/common/eqemu_config.cpp
@@ -436,11 +436,11 @@ void EQEmuConfig::CheckUcsConfigConversion()
LogInfo("Migrating old [eqemu_config] UCS configuration to new configuration");
std::string config_file_path = std::filesystem::path{
- path.GetServerPath() + "/eqemu_config.json"
+ PathManager::Instance()->GetServerPath() + "/eqemu_config.json"
}.string();
std::string config_file_bak_path = std::filesystem::path{
- path.GetServerPath() + "/eqemu_config.ucs-migrate-json.bak"
+ PathManager::Instance()->GetServerPath() + "/eqemu_config.ucs-migrate-json.bak"
}.string();
// copy eqemu_config.json to eqemu_config.json.bak
diff --git a/common/eqemu_config.h b/common/eqemu_config.h
index 6ba637ea8..57a0543c8 100644
--- a/common/eqemu_config.h
+++ b/common/eqemu_config.h
@@ -191,7 +191,7 @@ class EQEmuConfig
std::string file = fmt::format(
"{}/{}",
- (file_path.empty() ? path.GetServerPath() : file_path),
+ (file_path.empty() ? PathManager::Instance()->GetServerPath() : file_path),
EQEmuConfig::ConfigFile
);
diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp
index bb28d0aec..0d735b407 100644
--- a/common/eqemu_logsys.cpp
+++ b/common/eqemu_logsys.cpp
@@ -537,9 +537,9 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
{
EQEmuLogSys::CloseFileLogs();
- if (!File::Exists(path.GetLogPath())) {
- LogInfo("Logs directory not found, creating [{}]", path.GetLogPath());
- File::Makedir(path.GetLogPath());
+ if (!File::Exists(PathManager::Instance()->GetLogPath())) {
+ LogInfo("Logs directory not found, creating [{}]", PathManager::Instance()->GetLogPath());
+ File::Makedir(PathManager::Instance()->GetLogPath());
}
/**
@@ -656,7 +656,7 @@ EQEmuLogSys *EQEmuLogSys::LoadLogDatabaseSettings(bool silent_load)
// If we go through this whole loop and nothing is set to any debug level, there
// is no point to create a file or keep anything open
if (log_settings[c.log_category_id].log_to_file > 0) {
- LogSys.m_file_logs_enabled = true;
+ m_file_logs_enabled = true;
}
db_categories.emplace_back(c.log_category_id);
diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h
index 39c9ab948..0757b3e98 100644
--- a/common/eqemu_logsys.h
+++ b/common/eqemu_logsys.h
@@ -266,8 +266,6 @@ namespace Logs {
};
}
-#include "eqemu_logsys_log_aliases.h"
-
class Database;
constexpr uint16 MAX_DISCORD_WEBHOOK_ID = 300;
@@ -285,6 +283,12 @@ public:
EQEmuLogSys *LoadLogSettingsDefaults();
EQEmuLogSys *LoadLogDatabaseSettings(bool silent_load = false);
+ static EQEmuLogSys *Instance()
+ {
+ static EQEmuLogSys instance;
+ return &instance;
+ }
+
/**
* @param directory_name
*/
@@ -350,7 +354,7 @@ public:
/**
* Internally used memory reference for all log settings per category
* These are loaded via DB and have defaults loaded in LoadLogSettingsDefaults
- * Database loaded via LogSys.SetDatabase(&database)->LoadLogDatabaseSettings();
+ * Database loaded via EQEmuLogSys::Instance()->SetDatabase(&database)->LoadLogDatabaseSettings();
*/
LogSettings log_settings[Logs::LogCategory::MaxCategoryID]{};
@@ -434,7 +438,7 @@ private:
void InjectTablesIfNotExist();
};
-extern EQEmuLogSys LogSys;
+#include "eqemu_logsys_log_aliases.h"
/**
template
@@ -456,7 +460,7 @@ void OutF(
#define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \
do { \
- ls.Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \
+ ls->Out(debug_level, log_category, file, func, line, fmt::format(formatStr, ##__VA_ARGS__).c_str()); \
} while(0)
#endif
diff --git a/common/eqemu_logsys_log_aliases.h b/common/eqemu_logsys_log_aliases.h
index 55fa7fa20..a2c88a03f 100644
--- a/common/eqemu_logsys_log_aliases.h
+++ b/common/eqemu_logsys_log_aliases.h
@@ -21,917 +21,919 @@
#ifndef EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
#define EQEMU_EQEMU_LOGSYS_LOG_ALIASES_H
+inline auto logsys = EQEmuLogSys::Instance();
+
#define LogAA(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::AA))\
- OutF(LogSys, Logs::General, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::AA))\
+ OutF(logsys, Logs::General, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAADetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::AA))\
- OutF(LogSys, Logs::Detail, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::AA))\
+ OutF(logsys, Logs::Detail, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAI(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::AI))\
- OutF(LogSys, Logs::General, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::AI))\
+ OutF(logsys, Logs::General, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAIDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::AI))\
- OutF(LogSys, Logs::Detail, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::AI))\
+ OutF(logsys, Logs::Detail, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAggro(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Aggro))\
- OutF(LogSys, Logs::General, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Aggro))\
+ OutF(logsys, Logs::General, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAggroDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Aggro))\
- OutF(LogSys, Logs::Detail, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Aggro))\
+ OutF(logsys, Logs::Detail, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAttack(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Attack))\
- OutF(LogSys, Logs::General, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Attack))\
+ OutF(logsys, Logs::General, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAttackDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Attack))\
- OutF(LogSys, Logs::Detail, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Attack))\
+ OutF(logsys, Logs::Detail, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPacketClientServer(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::PacketClientServer))\
- OutF(LogSys, Logs::General, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::PacketClientServer))\
+ OutF(logsys, Logs::General, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPacketClientServerDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::PacketClientServer))\
- OutF(LogSys, Logs::Detail, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::PacketClientServer))\
+ OutF(logsys, Logs::Detail, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCombat(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Combat))\
- OutF(LogSys, Logs::General, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Combat))\
+ OutF(logsys, Logs::General, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCombatDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Combat))\
- OutF(LogSys, Logs::Detail, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Combat))\
+ OutF(logsys, Logs::Detail, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCommands(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Commands))\
- OutF(LogSys, Logs::General, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Commands))\
+ OutF(logsys, Logs::General, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCommandsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Commands))\
- OutF(LogSys, Logs::Detail, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Commands))\
+ OutF(logsys, Logs::Detail, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCrash(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Crash))\
- OutF(LogSys, Logs::General, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Crash))\
+ OutF(logsys, Logs::General, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCrashDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Crash))\
- OutF(LogSys, Logs::Detail, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Crash))\
+ OutF(logsys, Logs::Detail, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDebug(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Debug))\
- OutF(LogSys, Logs::General, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Debug))\
+ OutF(logsys, Logs::General, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDebugDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Debug))\
- OutF(LogSys, Logs::Detail, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Debug))\
+ OutF(logsys, Logs::Detail, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDoors(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Doors))\
- OutF(LogSys, Logs::General, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Doors))\
+ OutF(logsys, Logs::General, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDoorsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Doors))\
- OutF(LogSys, Logs::Detail, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Doors))\
+ OutF(logsys, Logs::Detail, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogError(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Error))\
- OutF(LogSys, Logs::General, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Error))\
+ OutF(logsys, Logs::General, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogErrorDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Error))\
- OutF(LogSys, Logs::Detail, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Error))\
+ OutF(logsys, Logs::Detail, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEvolveItem(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::EvolveItem))\
- OutF(LogSys, Logs::General, Logs::EvolveItem, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::EvolveItem))\
+ OutF(logsys, Logs::General, Logs::EvolveItem, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEvolveItemDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::EvolveItem))\
- OutF(LogSys, Logs::Detail, Logs::EvolveItem, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::EvolveItem))\
+ OutF(logsys, Logs::Detail, Logs::EvolveItem, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogGuilds(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Guilds))\
- OutF(LogSys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Guilds))\
+ OutF(logsys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogGuildsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Guilds))\
- OutF(LogSys, Logs::Detail, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Guilds))\
+ OutF(logsys, Logs::Detail, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogInventory(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Inventory))\
- OutF(LogSys, Logs::General, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Inventory))\
+ OutF(logsys, Logs::General, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogInventoryDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Inventory))\
- OutF(LogSys, Logs::Detail, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Inventory))\
+ OutF(logsys, Logs::Detail, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLauncher(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Launcher))\
- OutF(LogSys, Logs::General, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Launcher))\
+ OutF(logsys, Logs::General, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLauncherDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Launcher))\
- OutF(LogSys, Logs::Detail, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Launcher))\
+ OutF(logsys, Logs::Detail, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNetcode(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Netcode))\
- OutF(LogSys, Logs::General, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Netcode))\
+ OutF(logsys, Logs::General, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNetcodeDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Netcode))\
- OutF(LogSys, Logs::Detail, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Netcode))\
+ OutF(logsys, Logs::Detail, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNormal(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Normal))\
- OutF(LogSys, Logs::General, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Normal))\
+ OutF(logsys, Logs::General, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNormalDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Normal))\
- OutF(LogSys, Logs::Detail, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Normal))\
+ OutF(logsys, Logs::Detail, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogObject(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Object))\
- OutF(LogSys, Logs::General, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Object))\
+ OutF(logsys, Logs::General, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogObjectDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Object))\
- OutF(LogSys, Logs::Detail, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Object))\
+ OutF(logsys, Logs::Detail, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPathing(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Pathing))\
- OutF(LogSys, Logs::General, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Pathing))\
+ OutF(logsys, Logs::General, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPathingDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Pathing))\
- OutF(LogSys, Logs::Detail, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Pathing))\
+ OutF(logsys, Logs::Detail, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogQuests(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Quests))\
- OutF(LogSys, Logs::General, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Quests))\
+ OutF(logsys, Logs::General, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogQuestsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Quests))\
- OutF(LogSys, Logs::Detail, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Quests))\
+ OutF(logsys, Logs::Detail, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogRules(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Rules))\
- OutF(LogSys, Logs::General, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Rules))\
+ OutF(logsys, Logs::General, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogRulesDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Rules))\
- OutF(LogSys, Logs::Detail, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Rules))\
+ OutF(logsys, Logs::Detail, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSkills(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Skills))\
- OutF(LogSys, Logs::General, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Skills))\
+ OutF(logsys, Logs::General, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSkillsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Skills))\
- OutF(LogSys, Logs::Detail, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Skills))\
+ OutF(logsys, Logs::Detail, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSpawns(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Spawns))\
- OutF(LogSys, Logs::General, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Spawns))\
+ OutF(logsys, Logs::General, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSpawnsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Spawns))\
- OutF(LogSys, Logs::Detail, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Spawns))\
+ OutF(logsys, Logs::Detail, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSpells(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Spells))\
- OutF(LogSys, Logs::General, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Spells))\
+ OutF(logsys, Logs::General, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSpellsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Spells))\
- OutF(LogSys, Logs::Detail, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Spells))\
+ OutF(logsys, Logs::Detail, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTasks(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Tasks))\
- OutF(LogSys, Logs::General, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Tasks))\
+ OutF(logsys, Logs::General, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTasksDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Tasks))\
- OutF(LogSys, Logs::Detail, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Tasks))\
+ OutF(logsys, Logs::Detail, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTradeskills(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Tradeskills))\
- OutF(LogSys, Logs::General, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Tradeskills))\
+ OutF(logsys, Logs::General, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTradeskillsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Tradeskills))\
- OutF(LogSys, Logs::Detail, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Tradeskills))\
+ OutF(logsys, Logs::Detail, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTrading(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Trading))\
- OutF(LogSys, Logs::General, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Trading))\
+ OutF(logsys, Logs::General, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTradingDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Trading))\
- OutF(LogSys, Logs::Detail, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Trading))\
+ OutF(logsys, Logs::Detail, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTribute(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Tribute))\
- OutF(LogSys, Logs::General, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Tribute))\
+ OutF(logsys, Logs::General, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTributeDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Tribute))\
- OutF(LogSys, Logs::Detail, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Tribute))\
+ OutF(logsys, Logs::Detail, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMySQLError(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::MySQLError))\
- OutF(LogSys, Logs::General, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::MySQLError))\
+ OutF(logsys, Logs::General, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMySQLErrorDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::MySQLError))\
- OutF(LogSys, Logs::Detail, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::MySQLError))\
+ OutF(logsys, Logs::Detail, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMySQLQuery(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::MySQLQuery))\
- OutF(LogSys, Logs::General, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::MySQLQuery))\
+ OutF(logsys, Logs::General, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMySQLQueryDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::MySQLQuery))\
- OutF(LogSys, Logs::Detail, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::MySQLQuery))\
+ OutF(logsys, Logs::Detail, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMercenaries(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Mercenaries))\
- OutF(LogSys, Logs::General, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Mercenaries))\
+ OutF(logsys, Logs::General, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMercenariesDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Mercenaries))\
- OutF(LogSys, Logs::Detail, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Mercenaries))\
+ OutF(logsys, Logs::Detail, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogQuestDebug(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::QuestDebug))\
- OutF(LogSys, Logs::General, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::QuestDebug))\
+ OutF(logsys, Logs::General, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogQuestDebugDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::QuestDebug))\
- OutF(LogSys, Logs::Detail, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::QuestDebug))\
+ OutF(logsys, Logs::Detail, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPacketServerClient(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::PacketServerClient))\
- OutF(LogSys, Logs::General, Logs::PacketServerClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::PacketServerClient))\
+ OutF(logsys, Logs::General, Logs::PacketServerClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPacketServerClientDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerClient))\
- OutF(LogSys, Logs::Detail, Logs::PacketServerClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::PacketServerClient))\
+ OutF(logsys, Logs::Detail, Logs::PacketServerClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLoginserver(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Loginserver))\
- OutF(LogSys, Logs::General, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Loginserver))\
+ OutF(logsys, Logs::General, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLoginserverDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Loginserver))\
- OutF(LogSys, Logs::Detail, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Loginserver))\
+ OutF(logsys, Logs::Detail, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogClientLogin(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::ClientLogin))\
- OutF(LogSys, Logs::General, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::ClientLogin))\
+ OutF(logsys, Logs::General, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogClientLoginDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::ClientLogin))\
- OutF(LogSys, Logs::Detail, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::ClientLogin))\
+ OutF(logsys, Logs::Detail, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHPUpdate(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::HPUpdate))\
- OutF(LogSys, Logs::General, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::HPUpdate))\
+ OutF(logsys, Logs::General, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHPUpdateDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::HPUpdate))\
- OutF(LogSys, Logs::Detail, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::HPUpdate))\
+ OutF(logsys, Logs::Detail, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFixZ(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::FixZ))\
- OutF(LogSys, Logs::General, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::FixZ))\
+ OutF(logsys, Logs::General, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFixZDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::FixZ))\
- OutF(LogSys, Logs::Detail, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::FixZ))\
+ OutF(logsys, Logs::Detail, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFood(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Food))\
- OutF(LogSys, Logs::General, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Food))\
+ OutF(logsys, Logs::General, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFoodDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Food))\
- OutF(LogSys, Logs::Detail, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Food))\
+ OutF(logsys, Logs::Detail, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTraps(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Traps))\
- OutF(LogSys, Logs::General, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Traps))\
+ OutF(logsys, Logs::General, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogTrapsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Traps))\
- OutF(LogSys, Logs::Detail, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Traps))\
+ OutF(logsys, Logs::Detail, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNPCRoamBox(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::NPCRoamBox))\
- OutF(LogSys, Logs::General, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::NPCRoamBox))\
+ OutF(logsys, Logs::General, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNPCRoamBoxDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::NPCRoamBox))\
- OutF(LogSys, Logs::Detail, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::NPCRoamBox))\
+ OutF(logsys, Logs::Detail, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNPCScaling(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::NPCScaling))\
- OutF(LogSys, Logs::General, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::NPCScaling))\
+ OutF(logsys, Logs::General, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNPCScalingDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::NPCScaling))\
- OutF(LogSys, Logs::Detail, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::NPCScaling))\
+ OutF(logsys, Logs::Detail, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMobAppearance(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::MobAppearance))\
- OutF(LogSys, Logs::General, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::MobAppearance))\
+ OutF(logsys, Logs::General, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMobAppearanceDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::MobAppearance))\
- OutF(LogSys, Logs::Detail, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::MobAppearance))\
+ OutF(logsys, Logs::Detail, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogInfo(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Info))\
- OutF(LogSys, Logs::General, Logs::Info, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Info))\
+ OutF(logsys, Logs::General, Logs::Info, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogInfoDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Info))\
- OutF(LogSys, Logs::Detail, Logs::Info, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Info))\
+ OutF(logsys, Logs::Detail, Logs::Info, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogWarning(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Warning))\
- OutF(LogSys, Logs::General, Logs::Warning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Warning))\
+ OutF(logsys, Logs::General, Logs::Warning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogWarningDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Warning))\
- OutF(LogSys, Logs::Detail, Logs::Warning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Warning))\
+ OutF(logsys, Logs::Detail, Logs::Warning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCritical(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Critical))\
- OutF(LogSys, Logs::General, Logs::Critical, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Critical))\
+ OutF(logsys, Logs::General, Logs::Critical, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCriticalDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Critical))\
- OutF(LogSys, Logs::Detail, Logs::Critical, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Critical))\
+ OutF(logsys, Logs::Detail, Logs::Critical, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEmergency(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Emergency))\
- OutF(LogSys, Logs::General, Logs::Emergency, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Emergency))\
+ OutF(logsys, Logs::General, Logs::Emergency, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEmergencyDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Emergency))\
- OutF(LogSys, Logs::Detail, Logs::Emergency, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Emergency))\
+ OutF(logsys, Logs::Detail, Logs::Emergency, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAlert(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Alert))\
- OutF(LogSys, Logs::General, Logs::Alert, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Alert))\
+ OutF(logsys, Logs::General, Logs::Alert, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAlertDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Alert))\
- OutF(LogSys, Logs::Detail, Logs::Alert, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Alert))\
+ OutF(logsys, Logs::Detail, Logs::Alert, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNotice(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Notice))\
- OutF(LogSys, Logs::General, Logs::Notice, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Notice))\
+ OutF(logsys, Logs::General, Logs::Notice, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNoticeDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Notice))\
- OutF(LogSys, Logs::Detail, Logs::Notice, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Notice))\
+ OutF(logsys, Logs::Detail, Logs::Notice, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAIScanClose(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::AIScanClose))\
- OutF(LogSys, Logs::General, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::AIScanClose))\
+ OutF(logsys, Logs::General, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAIScanCloseDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::AIScanClose))\
- OutF(LogSys, Logs::Detail, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::AIScanClose))\
+ OutF(logsys, Logs::Detail, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAIYellForHelp(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::AIYellForHelp))\
- OutF(LogSys, Logs::General, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::AIYellForHelp))\
+ OutF(logsys, Logs::General, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAIYellForHelpDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::AIYellForHelp))\
- OutF(LogSys, Logs::Detail, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::AIYellForHelp))\
+ OutF(logsys, Logs::Detail, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAICastBeneficialClose(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::AICastBeneficialClose))\
- OutF(LogSys, Logs::General, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::AICastBeneficialClose))\
+ OutF(logsys, Logs::General, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAICastBeneficialCloseDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::AICastBeneficialClose))\
- OutF(LogSys, Logs::Detail, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::AICastBeneficialClose))\
+ OutF(logsys, Logs::Detail, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAoeCast(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::AoeCast))\
- OutF(LogSys, Logs::General, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::AoeCast))\
+ OutF(logsys, Logs::General, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAoeCastDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::AoeCast))\
- OutF(LogSys, Logs::Detail, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::AoeCast))\
+ OutF(logsys, Logs::Detail, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEntityManagement(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::EntityManagement))\
- OutF(LogSys, Logs::General, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::EntityManagement))\
+ OutF(logsys, Logs::General, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEntityManagementDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::EntityManagement))\
- OutF(LogSys, Logs::Detail, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::EntityManagement))\
+ OutF(logsys, Logs::Detail, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFlee(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Flee))\
- OutF(LogSys, Logs::General, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Flee))\
+ OutF(logsys, Logs::General, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFleeDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Flee))\
- OutF(LogSys, Logs::Detail, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Flee))\
+ OutF(logsys, Logs::Detail, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAura(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Aura))\
- OutF(LogSys, Logs::General, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Aura))\
+ OutF(logsys, Logs::General, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogAuraDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Aura))\
- OutF(LogSys, Logs::Detail, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Aura))\
+ OutF(logsys, Logs::Detail, Logs::Aura, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHotReload(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::HotReload))\
- OutF(LogSys, Logs::General, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::HotReload))\
+ OutF(logsys, Logs::General, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHotReloadDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::HotReload))\
- OutF(LogSys, Logs::Detail, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::HotReload))\
+ OutF(logsys, Logs::Detail, Logs::HotReload, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMerchants(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Merchants))\
- OutF(LogSys, Logs::General, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Merchants))\
+ OutF(logsys, Logs::General, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogMerchantsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Merchants))\
- OutF(LogSys, Logs::Detail, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Merchants))\
+ OutF(logsys, Logs::Detail, Logs::Merchants, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZonePoints(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::ZonePoints))\
- OutF(LogSys, Logs::General, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::ZonePoints))\
+ OutF(logsys, Logs::General, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZonePointsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::ZonePoints))\
- OutF(LogSys, Logs::Detail, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::ZonePoints))\
+ OutF(logsys, Logs::Detail, Logs::ZonePoints, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLoot(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Loot))\
- OutF(LogSys, Logs::General, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Loot))\
+ OutF(logsys, Logs::General, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogLootDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Loot))\
- OutF(LogSys, Logs::Detail, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Loot))\
+ OutF(logsys, Logs::Detail, Logs::Loot, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogExpeditions(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Expeditions))\
- OutF(LogSys, Logs::General, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Expeditions))\
+ OutF(logsys, Logs::General, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogExpeditionsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Expeditions))\
- OutF(LogSys, Logs::Detail, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Expeditions))\
+ OutF(logsys, Logs::Detail, Logs::Expeditions, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDynamicZones(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::DynamicZones))\
- OutF(LogSys, Logs::General, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::DynamicZones))\
+ OutF(logsys, Logs::General, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDynamicZonesDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::DynamicZones))\
- OutF(LogSys, Logs::Detail, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::DynamicZones))\
+ OutF(logsys, Logs::Detail, Logs::DynamicZones, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogScheduler(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Scheduler))\
- OutF(LogSys, Logs::General, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Scheduler))\
+ OutF(logsys, Logs::General, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSchedulerDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Scheduler))\
- OutF(LogSys, Logs::Detail, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Scheduler))\
+ OutF(logsys, Logs::Detail, Logs::Scheduler, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCheat(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Cheat))\
- OutF(LogSys, Logs::General, Logs::Cheat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Cheat))\
+ OutF(logsys, Logs::General, Logs::Cheat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCheatDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Cheat))\
- OutF(LogSys, Logs::Detail, Logs::Cheat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Cheat))\
+ OutF(logsys, Logs::Detail, Logs::Cheat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogClientList(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::ClientList))\
- OutF(LogSys, Logs::General, Logs::ClientList, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::ClientList))\
+ OutF(logsys, Logs::General, Logs::ClientList, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogClientListDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::ClientList))\
- OutF(LogSys, Logs::Detail, Logs::ClientList, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::ClientList))\
+ OutF(logsys, Logs::Detail, Logs::ClientList, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDiaWind(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::DiaWind))\
- OutF(LogSys, Logs::General, Logs::DiaWind, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::DiaWind))\
+ OutF(logsys, Logs::General, Logs::DiaWind, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDiaWindDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::DiaWind))\
- OutF(LogSys, Logs::Detail, Logs::DiaWind, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::DiaWind))\
+ OutF(logsys, Logs::Detail, Logs::DiaWind, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHTTP(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::HTTP))\
- OutF(LogSys, Logs::General, Logs::HTTP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::HTTP))\
+ OutF(logsys, Logs::General, Logs::HTTP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHTTPDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::HTTP))\
- OutF(LogSys, Logs::Detail, Logs::HTTP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::HTTP))\
+ OutF(logsys, Logs::Detail, Logs::HTTP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSaylink(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Saylink))\
- OutF(LogSys, Logs::General, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Saylink))\
+ OutF(logsys, Logs::General, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogSaylinkDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Saylink))\
- OutF(LogSys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Saylink))\
+ OutF(logsys, Logs::Detail, Logs::Saylink, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogChecksumVerification(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::ChecksumVerification))\
- OutF(LogSys, Logs::General, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::ChecksumVerification))\
+ OutF(logsys, Logs::General, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogChecksumVerificationDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::ChecksumVerification))\
- OutF(LogSys, Logs::Detail, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::ChecksumVerification))\
+ OutF(logsys, Logs::Detail, Logs::ChecksumVerification, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCombatRecord(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::CombatRecord))\
- OutF(LogSys, Logs::General, Logs::CombatRecord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::CombatRecord))\
+ OutF(logsys, Logs::General, Logs::CombatRecord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCombatRecordDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::CombatRecord))\
- OutF(LogSys, Logs::Detail, Logs::CombatRecord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::CombatRecord))\
+ OutF(logsys, Logs::Detail, Logs::CombatRecord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHate(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Hate))\
- OutF(LogSys, Logs::General, Logs::Hate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Hate))\
+ OutF(logsys, Logs::General, Logs::Hate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogHateDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Hate))\
- OutF(LogSys, Logs::Detail, Logs::Hate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Hate))\
+ OutF(logsys, Logs::Detail, Logs::Hate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDiscord(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Discord))\
- OutF(LogSys, Logs::General, Logs::Discord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Discord))\
+ OutF(logsys, Logs::General, Logs::Discord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDiscordDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Discord))\
- OutF(LogSys, Logs::Detail, Logs::Discord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Discord))\
+ OutF(logsys, Logs::Detail, Logs::Discord, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFaction(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Faction))\
- OutF(LogSys, Logs::General, Logs::Faction, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Faction))\
+ OutF(logsys, Logs::General, Logs::Faction, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogFactionDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Faction))\
- OutF(LogSys, Logs::Detail, Logs::Faction, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Faction))\
+ OutF(logsys, Logs::Detail, Logs::Faction, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPacketServerToServer(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::PacketServerToServer))\
- OutF(LogSys, Logs::General, Logs::PacketServerToServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::PacketServerToServer))\
+ OutF(logsys, Logs::General, Logs::PacketServerToServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPacketServerToServerDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerToServer))\
- OutF(LogSys, Logs::Detail, Logs::PacketServerToServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::PacketServerToServer))\
+ OutF(logsys, Logs::Detail, Logs::PacketServerToServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
// manually created
#define LogBugs(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Bugs))\
- OutF(LogSys, Logs::General, Logs::Bugs, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Bugs))\
+ OutF(logsys, Logs::General, Logs::Bugs, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBugsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Bugs))\
- OutF(LogSys, Logs::Detail, Logs::Bugs, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Bugs))\
+ OutF(logsys, Logs::Detail, Logs::Bugs, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogQuestErrors(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::QuestErrors))\
- OutF(LogSys, Logs::General, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::QuestErrors))\
+ OutF(logsys, Logs::General, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogQuestErrorsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::QuestErrors))\
- OutF(LogSys, Logs::Detail, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::QuestErrors))\
+ OutF(logsys, Logs::Detail, Logs::QuestErrors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPlayerEvents(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::PlayerEvents))\
- OutF(LogSys, Logs::General, Logs::PlayerEvents, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::PlayerEvents))\
+ OutF(logsys, Logs::General, Logs::PlayerEvents, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPlayerEventsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::PlayerEvents))\
- OutF(LogSys, Logs::Detail, Logs::PlayerEvents, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::PlayerEvents))\
+ OutF(logsys, Logs::Detail, Logs::PlayerEvents, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDataBuckets(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::DataBuckets))\
- OutF(LogSys, Logs::General, Logs::DataBuckets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::DataBuckets))\
+ OutF(logsys, Logs::General, Logs::DataBuckets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogDataBucketsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::DataBuckets))\
- OutF(LogSys, Logs::Detail, Logs::DataBuckets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::DataBuckets))\
+ OutF(logsys, Logs::Detail, Logs::DataBuckets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZoning(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Zoning))\
- OutF(LogSys, Logs::General, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Zoning))\
+ OutF(logsys, Logs::General, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZoningDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Zoning))\
- OutF(LogSys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Zoning))\
+ OutF(logsys, Logs::Detail, Logs::Zoning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEqTime(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::EqTime))\
- OutF(LogSys, Logs::General, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::EqTime))\
+ OutF(logsys, Logs::General, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogEqTimeDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::EqTime))\
- OutF(LogSys, Logs::Detail, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::EqTime))\
+ OutF(logsys, Logs::Detail, Logs::EqTime, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCorpses(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::Corpses))\
- OutF(LogSys, Logs::General, Logs::Corpses, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::Corpses))\
+ OutF(logsys, Logs::General, Logs::Corpses, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogCorpsesDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::Corpses))\
- OutF(LogSys, Logs::Detail, Logs::Corpses, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::Corpses))\
+ OutF(logsys, Logs::Detail, Logs::Corpses, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogXTargets(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::XTargets))\
- OutF(LogSys, Logs::General, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::XTargets))\
+ OutF(logsys, Logs::General, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogXTargetsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::XTargets))\
- OutF(LogSys, Logs::Detail, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::XTargets))\
+ OutF(logsys, Logs::Detail, Logs::XTargets, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPositionUpdate(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::PositionUpdate))\
- OutF(LogSys, Logs::General, Logs::PositionUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::PositionUpdate))\
+ OutF(logsys, Logs::General, Logs::PositionUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogPositionUpdateDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::PositionUpdate))\
- OutF(LogSys, Logs::Detail, Logs::PositionUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__); \
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::PositionUpdate))\
+ OutF(logsys, Logs::Detail, Logs::PositionUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__); \
} while (0)
#define LogKSM(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::KSM))\
- OutF(LogSys, Logs::General, Logs::KSM, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::KSM))\
+ OutF(logsys, Logs::General, Logs::KSM, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogKSMDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::KSM))\
- OutF(LogSys, Logs::Detail, Logs::KSM, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::KSM))\
+ OutF(logsys, Logs::Detail, Logs::KSM, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBotSettings(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::BotSettings))\
- OutF(LogSys, Logs::General, Logs::BotSettings, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::BotSettings))\
+ OutF(logsys, Logs::General, Logs::BotSettings, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBotSettingsDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotSettings))\
- OutF(LogSys, Logs::Detail, Logs::BotSettings, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::BotSettings))\
+ OutF(logsys, Logs::Detail, Logs::BotSettings, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBotSpellChecks(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::BotSpellChecks))\
- OutF(LogSys, Logs::General, Logs::BotSpellChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::BotSpellChecks))\
+ OutF(logsys, Logs::General, Logs::BotSpellChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBotSpellChecksDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotSpellChecks))\
- OutF(LogSys, Logs::Detail, Logs::BotSpellChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::BotSpellChecks))\
+ OutF(logsys, Logs::Detail, Logs::BotSpellChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBotSpellTypeChecks(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::BotSpellTypeChecks))\
- OutF(LogSys, Logs::General, Logs::BotSpellTypeChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::BotSpellTypeChecks))\
+ OutF(logsys, Logs::General, Logs::BotSpellTypeChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogBotSpellTypeChecksDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::BotSpellTypeChecks))\
- OutF(LogSys, Logs::Detail, Logs::BotSpellTypeChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::BotSpellTypeChecks))\
+ OutF(logsys, Logs::Detail, Logs::BotSpellTypeChecks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNpcHandin(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::NpcHandin))\
- OutF(LogSys, Logs::General, Logs::NpcHandin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::NpcHandin))\
+ OutF(logsys, Logs::General, Logs::NpcHandin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNpcHandinDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::NpcHandin))\
- OutF(LogSys, Logs::Detail, Logs::NpcHandin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::NpcHandin))\
+ OutF(logsys, Logs::Detail, Logs::NpcHandin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZoneState(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::ZoneState))\
- OutF(LogSys, Logs::General, Logs::ZoneState, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::ZoneState))\
+ OutF(logsys, Logs::General, Logs::ZoneState, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogZoneStateDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::ZoneState))\
- OutF(LogSys, Logs::Detail, Logs::ZoneState, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::ZoneState))\
+ OutF(logsys, Logs::Detail, Logs::ZoneState, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNetClient(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::NetClient))\
- OutF(LogSys, Logs::General, Logs::NetClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::NetClient))\
+ OutF(logsys, Logs::General, Logs::NetClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNetClientDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::NetClient))\
- OutF(LogSys, Logs::Detail, Logs::NetClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::NetClient))\
+ OutF(logsys, Logs::Detail, Logs::NetClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNetTCP(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::General, Logs::NetTCP))\
- OutF(LogSys, Logs::General, Logs::NetTCP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::General, Logs::NetTCP))\
+ OutF(logsys, Logs::General, Logs::NetTCP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogNetTCPDetail(message, ...) do {\
- if (LogSys.IsLogEnabled(Logs::Detail, Logs::NetTCP))\
- OutF(LogSys, Logs::Detail, Logs::NetTCP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(Logs::Detail, Logs::NetTCP))\
+ OutF(logsys, Logs::Detail, Logs::NetTCP, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define Log(debug_level, log_category, message, ...) do {\
- if (LogSys.IsLogEnabled(debug_level, log_category))\
- LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(debug_level, log_category))\
+ logsys->Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
#define LogF(debug_level, log_category, message, ...) do {\
- if (LogSys.IsLogEnabled(debug_level, log_category))\
- OutF(LogSys, debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
+ if (logsys->IsLogEnabled(debug_level, log_category))\
+ OutF(logsys, debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0)
diff --git a/common/events/player_event_discord_formatter.cpp b/common/events/player_event_discord_formatter.cpp
index e3e4e5c27..5b068f507 100644
--- a/common/events/player_event_discord_formatter.cpp
+++ b/common/events/player_event_discord_formatter.cpp
@@ -716,7 +716,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
);
for (int i = 0; i < h.augment_ids.size(); i++) {
- if (!Strings::EqualFold(h.augment_names[i], "None")) {
+ if (!h.augment_names[i].empty()) {
const uint8 slot_id = (i + 1);
handin_items_info += fmt::format(
"Augment {}: {} ({})\n",
@@ -741,7 +741,7 @@ std::string PlayerEventDiscordFormatter::FormatNPCHandinEvent(
);
for (int i = 0; i < r.augment_ids.size(); i++) {
- if (!Strings::EqualFold(r.augment_names[i], "None")) {
+ if (!r.augment_names[i].empty()) {
const uint8 slot_id = (i + 1);
return_items_info += fmt::format(
"Augment {}: {} ({})\n",
diff --git a/common/events/player_event_logs.cpp b/common/events/player_event_logs.cpp
index 41be9f7d1..daa8cd17c 100644
--- a/common/events/player_event_logs.cpp
+++ b/common/events/player_event_logs.cpp
@@ -195,10 +195,12 @@ void PlayerEventLogs::ProcessBatchQueue()
};
// Helper to assign ETL table ID
- auto AssignEtlId = [&](
- PlayerEventLogsRepository::PlayerEventLogs &r,
- PlayerEvent::EventType type
- ) {
+
+ auto AssignEtlId = [&](
+ PlayerEventLogsRepository::PlayerEventLogs& r,
+ PlayerEvent::EventType type
+ )
+ {
if (m_etl_settings.contains(type)) {
r.etl_table_id = m_etl_settings.at(type).next_id++;
}
@@ -406,7 +408,6 @@ void PlayerEventLogs::ProcessBatchQueue()
auto it = event_processors.find(static_cast(r.event_type_id));
if (it != event_processors.end()) {
it->second(r); // Call the appropriate lambda
- r.event_data = "{}"; // Clear event data
}
else {
LogPlayerEventsDetail("Non-Implemented ETL routing [{}]", r.event_type_id);
@@ -508,7 +509,7 @@ bool PlayerEventLogs::IsEventDiscordEnabled(int32_t event_type_id)
}
// ensure there is a matching webhook to begin with
- if (!LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
+ if (!EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
return true;
}
@@ -528,13 +529,27 @@ std::string PlayerEventLogs::GetDiscordWebhookUrlFromEventType(int32_t event_typ
}
// ensure there is a matching webhook to begin with
- if (!LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
- return LogSys.GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url;
+ if (!EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url.empty()) {
+ return EQEmuLogSys::Instance()->GetDiscordWebhooks()[m_settings[event_type_id].discord_webhook_id].webhook_url;
}
return "";
}
+void PlayerEventLogs::LoadPlayerEventSettingsFromQS(
+ const std::vector &settings
+)
+{
+ for (const auto &e : settings) {
+ if (e.id >= PlayerEvent::MAX || e.id < 0) {
+ continue;
+ }
+ m_settings[e.id] = e;
+ }
+
+ LogInfo("Applied [{}] player event log settings from QS", settings.size());
+}
+
// GM_COMMAND | [x] Implemented Formatter
// ZONING | [x] Implemented Formatter
// AA_GAIN | [x] Implemented Formatter
diff --git a/common/events/player_event_logs.h b/common/events/player_event_logs.h
index 8a9ccb202..cbc455666 100644
--- a/common/events/player_event_logs.h
+++ b/common/events/player_event_logs.h
@@ -73,9 +73,11 @@ public:
return BuildPlayerEventPacket(c);
}
- [[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings *GetSettings() const;
- bool IsEventDiscordEnabled(int32_t event_type_id);
- std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
+ [[nodiscard]] const PlayerEventLogSettingsRepository::PlayerEventLogSettings * GetSettings() const;
+ bool IsEventDiscordEnabled(int32_t event_type_id);
+ std::string GetDiscordWebhookUrlFromEventType(int32_t event_type_id);
+
+ void LoadPlayerEventSettingsFromQS(const std::vector& settings);
static std::string GetDiscordPayloadFromEvent(const PlayerEvent::PlayerEventContainer &e);
diff --git a/common/events/player_events.h b/common/events/player_events.h
index 78b9fc10d..b2a485621 100644
--- a/common/events/player_events.h
+++ b/common/events/player_events.h
@@ -7,8 +7,16 @@
#include "../rulesys.h"
#include "../repositories/player_event_logs_repository.h"
-namespace PlayerEvent {
+#define CEREAL_NVP_IF_NONZERO(ar, name) \
+if ((name) != 0) ar(cereal::make_nvp(#name, name))
+#define CEREAL_NVP_IF_NOT_EMPTY(ar, name) \
+if (!(name).empty()) ar(cereal::make_nvp(#name, name))
+
+#define CEREAL_NVP_IF_TRUE(ar, name) \
+if ((name)) ar(cereal::make_nvp(#name, name))
+
+namespace PlayerEvent {
enum EventType {
GM_COMMAND = 1,
ZONING,
@@ -26,10 +34,10 @@ namespace PlayerEvent {
LOOT_ITEM,
MERCHANT_PURCHASE,
MERCHANT_SELL,
- GROUP_JOIN, // unimplemented
+ GROUP_JOIN, // unimplemented
GROUP_LEAVE, // unimplemented
- RAID_JOIN, // unimplemented
- RAID_LEAVE, // unimplemented
+ RAID_JOIN, // unimplemented
+ RAID_LEAVE, // unimplemented
GROUNDSPAWN_PICKUP,
NPC_HANDIN,
SKILL_UP,
@@ -45,12 +53,12 @@ namespace PlayerEvent {
COMBINE_SUCCESS,
DROPPED_ITEM,
SPLIT_MONEY,
- DZ_JOIN, // unimplemented
+ DZ_JOIN, // unimplemented
DZ_LEAVE, // unimplemented
TRADER_PURCHASE,
TRADER_SELL,
BANDOLIER_CREATE, // unimplemented
- BANDOLIER_SWAP, // unimplemented
+ BANDOLIER_SWAP, // unimplemented
DISCOVER_ITEM,
POSSIBLE_HACK,
KILLED_NPC,
@@ -76,7 +84,7 @@ namespace PlayerEvent {
// If event is unimplemented just tag (Unimplemented) in the name
// Events don't get saved to the database if unimplemented or deprecated
// Events tagged as deprecated will get automatically removed
- static const char *EventName[EventType::MAX] = {
+ static const char* EventName[EventType::MAX] = {
"None",
"GM Command",
"Zoning",
@@ -156,8 +164,8 @@ namespace PlayerEvent {
float heading;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(account_id),
@@ -185,8 +193,8 @@ namespace PlayerEvent {
PlayerEventLogsRepository::PlayerEventLogs player_event_log;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(player_event),
@@ -200,8 +208,8 @@ namespace PlayerEvent {
std::string noop; // noop, gets discard upstream
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(noop)
@@ -224,8 +232,38 @@ namespace PlayerEvent {
bool attuned;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(
+ CEREAL_NVP(item_id),
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(to_slot),
+ CEREAL_NVP(charges)
+ );
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+ CEREAL_NVP_IF_TRUE(ar, attuned);
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -284,8 +322,37 @@ namespace PlayerEvent {
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void save(Archive& ar) const
+ {
+ ar(
+ CEREAL_NVP(slot),
+ CEREAL_NVP(item_id)
+ );
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NOT_EMPTY(ar, augment_1_name);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NOT_EMPTY(ar, augment_2_name);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NOT_EMPTY(ar, augment_3_name);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NOT_EMPTY(ar, augment_4_name);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NOT_EMPTY(ar, augment_5_name);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+ CEREAL_NVP_IF_NOT_EMPTY(ar, augment_6_name);
+
+ ar(
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(charges)
+ );
+
+ CEREAL_NVP_IF_TRUE(ar, in_bag);
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(slot),
@@ -295,7 +362,7 @@ namespace PlayerEvent {
CEREAL_NVP(augment_2_id),
CEREAL_NVP(augment_2_name),
CEREAL_NVP(augment_3_id),
- CEREAL_NVP(augment_1_name),
+ CEREAL_NVP(augment_3_name),
CEREAL_NVP(augment_4_id),
CEREAL_NVP(augment_4_name),
CEREAL_NVP(augment_5_id),
@@ -319,8 +386,8 @@ namespace PlayerEvent {
int32 copper;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(platinum),
@@ -342,8 +409,8 @@ namespace PlayerEvent {
std::vector character_2_give_items;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(character_1_id),
@@ -363,8 +430,8 @@ namespace PlayerEvent {
std::string target;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(message),
@@ -386,8 +453,8 @@ namespace PlayerEvent {
int32 to_instance_version;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(from_zone_long_name),
@@ -408,8 +475,8 @@ namespace PlayerEvent {
uint32 aa_gained;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(CEREAL_NVP(aa_gained));
}
@@ -422,8 +489,8 @@ namespace PlayerEvent {
int32 aa_next_id;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(aa_id),
@@ -444,9 +511,34 @@ namespace PlayerEvent {
uint32 augment_6_id;
std::string item_name;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(CEREAL_NVP(item_name));
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -471,9 +563,34 @@ namespace PlayerEvent {
uint32 augment_6_id;
std::string item_name;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(CEREAL_NVP(item_name));
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -501,9 +618,41 @@ namespace PlayerEvent {
bool attuned;
std::string reason;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(
+ CEREAL_NVP(item_id),
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(charges)
+ );
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(attuned),
+ CEREAL_NVP(reason)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -521,14 +670,15 @@ namespace PlayerEvent {
}
};
+
struct LevelGainedEvent {
uint32 from_level;
uint8 to_level;
int levels_gained;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(from_level),
@@ -544,8 +694,8 @@ namespace PlayerEvent {
int levels_lost;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(from_level),
@@ -569,8 +719,41 @@ namespace PlayerEvent {
std::string corpse_name;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(
+ CEREAL_NVP(item_id),
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(charges)
+ );
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(npc_id),
+ CEREAL_NVP(corpse_name)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -601,8 +784,8 @@ namespace PlayerEvent {
uint64 player_currency_balance;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@@ -632,8 +815,8 @@ namespace PlayerEvent {
uint64 player_currency_balance;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@@ -657,8 +840,8 @@ namespace PlayerEvent {
std::string against_who;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(skill_id),
@@ -676,8 +859,8 @@ namespace PlayerEvent {
std::string task_name;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@@ -695,8 +878,8 @@ namespace PlayerEvent {
uint32 done_count;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(task_id),
@@ -714,8 +897,8 @@ namespace PlayerEvent {
uint32 done_count;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(task_id),
@@ -731,8 +914,8 @@ namespace PlayerEvent {
std::string item_name;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -746,8 +929,8 @@ namespace PlayerEvent {
std::string target;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(message),
@@ -762,8 +945,8 @@ namespace PlayerEvent {
uint32 spell_id;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(resurrecter_name),
@@ -780,8 +963,8 @@ namespace PlayerEvent {
uint32 tradeskill_id;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(recipe_id),
@@ -805,8 +988,38 @@ namespace PlayerEvent {
uint32 charges;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(slot_id),
+ CEREAL_NVP(charges)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -833,8 +1046,8 @@ namespace PlayerEvent {
std::string skill_name;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(killer_id),
@@ -856,8 +1069,8 @@ namespace PlayerEvent {
uint64 player_money_balance;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(copper),
@@ -886,10 +1099,44 @@ namespace PlayerEvent {
uint64 total_cost;
uint64 player_money_balance;
-
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(trader_id),
+ CEREAL_NVP(trader_name),
+ CEREAL_NVP(price),
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(charges),
+ CEREAL_NVP(total_cost),
+ CEREAL_NVP(player_money_balance)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -928,10 +1175,43 @@ namespace PlayerEvent {
uint64 total_cost;
uint64 player_money_balance;
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(item_name),
+ CEREAL_NVP(buyer_id),
+ CEREAL_NVP(buyer_name),
+ CEREAL_NVP(price),
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(charges),
+ CEREAL_NVP(total_cost),
+ CEREAL_NVP(player_money_balance)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -958,8 +1238,8 @@ namespace PlayerEvent {
std::string item_name;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -978,8 +1258,8 @@ namespace PlayerEvent {
bool attuned;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -1000,8 +1280,8 @@ namespace PlayerEvent {
uint32 platinum;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(copper),
@@ -1022,8 +1302,8 @@ namespace PlayerEvent {
bool is_quest_handin;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@@ -1041,8 +1321,8 @@ namespace PlayerEvent {
std::string message;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(message)
@@ -1058,8 +1338,8 @@ namespace PlayerEvent {
uint64 total_heal_per_second_taken;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(npc_id),
@@ -1083,9 +1363,36 @@ namespace PlayerEvent {
bool attuned;
uint32 guild_favor;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+ CEREAL_NVP_IF_NONZERO(ar, charges);
+ CEREAL_NVP_IF_TRUE(ar, attuned);
+
+ ar(CEREAL_NVP(guild_favor));
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -1095,6 +1402,8 @@ namespace PlayerEvent {
CEREAL_NVP(augment_4_id),
CEREAL_NVP(augment_5_id),
CEREAL_NVP(augment_6_id),
+ CEREAL_NVP(charges),
+ CEREAL_NVP(attuned),
CEREAL_NVP(guild_favor)
);
}
@@ -1105,8 +1414,8 @@ namespace PlayerEvent {
uint32 guild_favor;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(plat),
@@ -1127,9 +1436,38 @@ namespace PlayerEvent {
std::string from_player_name;
uint32 sent_date;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(from_player_name),
+ CEREAL_NVP(sent_date)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -1160,9 +1498,40 @@ namespace PlayerEvent {
std::string to_player_name;
uint32 sent_date;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+ CEREAL_NVP_IF_NONZERO(ar, charges);
+
+ ar(
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(from_player_name),
+ CEREAL_NVP(to_player_name),
+ CEREAL_NVP(sent_date)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -1195,9 +1564,40 @@ namespace PlayerEvent {
std::string from_name;
std::string note;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(CEREAL_NVP(item_id));
+
+ CEREAL_NVP_IF_NONZERO(ar, augment_1_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_2_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_3_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_4_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_5_id);
+ CEREAL_NVP_IF_NONZERO(ar, augment_6_id);
+
+ ar(
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(char_id),
+ CEREAL_NVP(from_name),
+ CEREAL_NVP(note),
+ CEREAL_NVP(sent_date)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(item_id),
@@ -1226,8 +1626,8 @@ namespace PlayerEvent {
std::string seller_name;
uint64 total_cost;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(status),
@@ -1251,8 +1651,8 @@ namespace PlayerEvent {
double progression;
// cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(status),
@@ -1273,8 +1673,8 @@ namespace PlayerEvent {
uint32 type;
std::string message;
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
{
ar(
CEREAL_NVP(to),
@@ -1300,9 +1700,41 @@ namespace PlayerEvent {
uint32 quantity;
uint32 permission;
- // cereal
- template
- void serialize(Archive &ar)
+ template
+ void serialize(Archive& ar)
+ {
+ if constexpr (Archive::is_saving::value) {
+ save(ar);
+ }
+ else {
+ load(ar);
+ }
+ }
+
+ template
+ void save(Archive& ar) const
+ {
+ ar(
+ CEREAL_NVP(char_id),
+ CEREAL_NVP(guild_id),
+ CEREAL_NVP(item_id)
+ );
+
+ CEREAL_NVP_IF_NONZERO(ar, aug_slot_one);
+ CEREAL_NVP_IF_NONZERO(ar, aug_slot_two);
+ CEREAL_NVP_IF_NONZERO(ar, aug_slot_three);
+ CEREAL_NVP_IF_NONZERO(ar, aug_slot_four);
+ CEREAL_NVP_IF_NONZERO(ar, aug_slot_five);
+ CEREAL_NVP_IF_NONZERO(ar, aug_slot_six);
+
+ ar(
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(permission)
+ );
+ }
+
+ template
+ void load(Archive& ar)
{
ar(
CEREAL_NVP(char_id),
@@ -1314,8 +1746,9 @@ namespace PlayerEvent {
CEREAL_NVP(aug_slot_four),
CEREAL_NVP(aug_slot_five),
CEREAL_NVP(aug_slot_six),
- CEREAL_NVP(quantity)
- );
+ CEREAL_NVP(quantity),
+ CEREAL_NVP(permission)
+ );
}
};
}
diff --git a/common/evolving_items.cpp b/common/evolving_items.cpp
index b74efc17b..f7f99b7a6 100644
--- a/common/evolving_items.cpp
+++ b/common/evolving_items.cpp
@@ -21,8 +21,8 @@ void EvolvingItemsManager::LoadEvolvingItems() const
results.begin(),
results.end(),
std::inserter(
- evolving_items_manager.GetEvolvingItemsCache(),
- evolving_items_manager.GetEvolvingItemsCache().end()
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache(),
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache().end()
),
[](const ItemsEvolvingDetailsRepository::ItemsEvolvingDetails &x) {
return std::make_pair(x.item_id, x);
@@ -42,13 +42,13 @@ void EvolvingItemsManager::SetContentDatabase(Database *db)
double EvolvingItemsManager::CalculateProgression(const uint64 current_amount, const uint32 item_id)
{
- if (!evolving_items_manager.GetEvolvingItemsCache().contains(item_id)) {
+ if (!EvolvingItemsManager::Instance()->GetEvolvingItemsCache().contains(item_id)) {
return 0;
}
- return evolving_items_manager.GetEvolvingItemsCache().at(item_id).required_amount > 0
+ return EvolvingItemsManager::Instance()->GetEvolvingItemsCache().at(item_id).required_amount > 0
? static_cast(current_amount)
- / static_cast(evolving_items_manager.GetEvolvingItemsCache().at(item_id).required_amount) * 100
+ / static_cast(EvolvingItemsManager::Instance()->GetEvolvingItemsCache().at(item_id).required_amount) * 100
: 0;
}
@@ -73,7 +73,7 @@ void EvolvingItemsManager::DoLootChecks(const uint32 char_id, const uint16 slot_
e.character_id = char_id;
e.item_id = inst.GetID();
e.equipped = inst.GetEvolveEquipped();
- e.final_item_id = evolving_items_manager.GetFinalItemID(inst);
+ e.final_item_id = EvolvingItemsManager::Instance()->GetFinalItemID(inst);
auto r = CharacterEvolvingItemsRepository::InsertOne(*m_db, e);
e.id = r.id;
@@ -96,20 +96,20 @@ uint32 EvolvingItemsManager::GetFinalItemID(const EQ::ItemInstance &inst) const
}
const auto start_iterator = std::ranges::find_if(
- evolving_items_manager.GetEvolvingItemsCache().cbegin(),
- evolving_items_manager.GetEvolvingItemsCache().cend(),
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cbegin(),
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cend(),
[&](const std::pair &a) {
return a.second.item_evo_id == inst.GetEvolveLoreID();
}
);
- if (start_iterator == std::end(evolving_items_manager.GetEvolvingItemsCache())) {
+ if (start_iterator == std::end(EvolvingItemsManager::Instance()->GetEvolvingItemsCache())) {
return 0;
}
const auto final_id = std::ranges::max_element(
start_iterator,
- evolving_items_manager.GetEvolvingItemsCache().cend(),
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cend(),
[&](
const std::pair &a,
const std::pair &b
@@ -131,15 +131,15 @@ uint32 EvolvingItemsManager::GetNextEvolveItemID(const EQ::ItemInstance &inst) c
int8 const current_level = inst.GetEvolveLvl();
const auto iterator = std::ranges::find_if(
- evolving_items_manager.GetEvolvingItemsCache().cbegin(),
- evolving_items_manager.GetEvolvingItemsCache().cend(),
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cbegin(),
+ EvolvingItemsManager::Instance()->GetEvolvingItemsCache().cend(),
[&](const std::pair &a) {
return a.second.item_evo_id == inst.GetEvolveLoreID() &&
a.second.item_evolve_level == current_level + 1;
}
);
- if (iterator == std::end(evolving_items_manager.GetEvolvingItemsCache())) {
+ if (iterator == std::end(EvolvingItemsManager::Instance()->GetEvolvingItemsCache())) {
return 0;
}
@@ -255,8 +255,8 @@ EvolveTransfer EvolvingItemsManager::DetermineTransferResults(
return ets;
}
- auto evolving_details_inst_from = evolving_items_manager.GetEvolveItemDetails(inst_from.GetID());
- auto evolving_details_inst_to = evolving_items_manager.GetEvolveItemDetails(inst_to.GetID());
+ auto evolving_details_inst_from = EvolvingItemsManager::Instance()->GetEvolveItemDetails(inst_from.GetID());
+ auto evolving_details_inst_to = EvolvingItemsManager::Instance()->GetEvolveItemDetails(inst_to.GetID());
if (!evolving_details_inst_from.id || !evolving_details_inst_to.id) {
return ets;
@@ -272,10 +272,10 @@ EvolveTransfer EvolvingItemsManager::DetermineTransferResults(
compatibility = 30;
}
- xp = evolving_items_manager.GetTotalEarnedXP(inst_from) * compatibility / 100;
- auto results = evolving_items_manager.GetNextItemByXP(inst_to, xp);
+ xp = EvolvingItemsManager::Instance()->GetTotalEarnedXP(inst_from) * compatibility / 100;
+ auto results = EvolvingItemsManager::Instance()->GetNextItemByXP(inst_to, xp);
- ets.item_from_id = evolving_items_manager.GetFirstItemInLoreGroup(inst_from.GetEvolveLoreID());
+ ets.item_from_id = EvolvingItemsManager::Instance()->GetFirstItemInLoreGroup(inst_from.GetEvolveLoreID());
ets.item_from_current_amount = results.from_current_amount;
ets.item_to_id = results.new_item_id;
ets.item_to_current_amount = results.new_current_amount;
diff --git a/common/evolving_items.h b/common/evolving_items.h
index 56f7e4be8..3bdb4d697 100644
--- a/common/evolving_items.h
+++ b/common/evolving_items.h
@@ -56,12 +56,15 @@ public:
std::map& GetEvolvingItemsCache() { return m_evolving_items_cache; }
std::vector GetEvolveIDItems(uint32 evolve_id);
+ static EvolvingItemsManager* Instance()
+ {
+ static EvolvingItemsManager instance;
+ return &instance;
+ }
private:
std::map m_evolving_items_cache;
Database * m_db;
Database * m_content_db;
};
-extern EvolvingItemsManager evolving_items_manager;
-
#endif //EVOLVING_H
diff --git a/common/ipc_mutex.cpp b/common/ipc_mutex.cpp
index e2c123f22..ebd13a693 100644
--- a/common/ipc_mutex.cpp
+++ b/common/ipc_mutex.cpp
@@ -55,7 +55,7 @@ namespace EQ {
EQ_EXCEPT("IPC Mutex", "Could not create mutex.");
}
#else
- std::string final_name = fmt::format("{}/{}.lock", path.GetSharedMemoryPath(), name);
+ std::string final_name = fmt::format("{}/{}.lock", PathManager::Instance()->GetSharedMemoryPath(), name);
#ifdef __DARWIN
#if __DARWIN_C_LEVEL < 200809L
diff --git a/common/item_instance.cpp b/common/item_instance.cpp
index c25ea09d2..b2d619b5a 100644
--- a/common/item_instance.cpp
+++ b/common/item_instance.cpp
@@ -1799,7 +1799,7 @@ std::vector EQ::ItemInstance::GetAugmentNames() const
for (uint8 slot_id = invaug::SOCKET_BEGIN; slot_id <= invaug::SOCKET_END; slot_id++) {
const auto augment = GetAugment(slot_id);
- augment_names.push_back(augment ? augment->GetItem()->Name : "None");
+ augment_names.push_back(augment ? augment->GetItem()->Name : "");
}
return augment_names;
diff --git a/common/item_instance.h b/common/item_instance.h
index 805ac019d..99edfb570 100644
--- a/common/item_instance.h
+++ b/common/item_instance.h
@@ -335,7 +335,7 @@ namespace EQ
void SetEvolveAddToCurrentAmount(const uint64 in) const { m_evolving_details.current_amount += in; }
void SetEvolveFinalItemID(const uint32 in) const { m_evolving_details.final_item_id = in; }
bool TransferOwnership(Database& db, const uint32 to_char_id) const;
- void CalculateEvolveProgression() const { m_evolving_details.progression = evolving_items_manager.CalculateProgression(GetEvolveCurrentAmount(), GetID()); }
+ void CalculateEvolveProgression() const { m_evolving_details.progression = EvolvingItemsManager::Instance()->CalculateProgression(GetEvolveCurrentAmount(), GetID()); }
protected:
//////////////////////////
diff --git a/common/net/daybreak_connection.cpp b/common/net/daybreak_connection.cpp
index 322107103..9d40eadb8 100644
--- a/common/net/daybreak_connection.cpp
+++ b/common/net/daybreak_connection.cpp
@@ -1167,7 +1167,7 @@ void EQ::Net::DaybreakConnection::ProcessResend(int stream)
}
}
- if (LogSys.IsLogEnabled(Logs::General, Logs::NetClient)) {
+ if (EQEmuLogSys::Instance()->IsLogEnabled(Logs::General, Logs::NetClient)) {
size_t total_size = 0;
for (auto &e: s->sent_packets) {
total_size += e.second.packet.Length();
diff --git a/common/net/eqstream.cpp b/common/net/eqstream.cpp
index 34ad10e41..0e3c671d7 100644
--- a/common/net/eqstream.cpp
+++ b/common/net/eqstream.cpp
@@ -71,7 +71,7 @@ void EQ::Net::EQStream::QueuePacket(const EQApplicationPacket *p, bool ack_req)
OpcodeManager::EmuToName(p->GetOpcode()),
(*m_opcode_manager)->EmuToEQ(p->GetOpcode()),
p->Size(),
- (LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerClient) ? DumpPacketToString(p) : "")
+ (EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketServerClient) ? DumpPacketToString(p) : "")
);
if (m_opcode_manager && *m_opcode_manager) {
diff --git a/common/net/servertalk_server_connection.cpp b/common/net/servertalk_server_connection.cpp
index 02d4f9419..efc2d572e 100644
--- a/common/net/servertalk_server_connection.cpp
+++ b/common/net/servertalk_server_connection.cpp
@@ -319,7 +319,7 @@ void EQ::Net::ServertalkServerConnection::ProcessMessage(EQ::Net::Packet &p)
size_t message_len = length;
EQ::Net::StaticPacket packet(&data[0], message_len);
- const auto is_detail_enabled = LogSys.IsLogEnabled(Logs::Detail, Logs::PacketServerToServer);
+ const auto is_detail_enabled = EQEmuLogSys::Instance()->IsLogEnabled(Logs::Detail, Logs::PacketServerToServer);
if (opcode != ServerOP_KeepAlive || is_detail_enabled) {
LogPacketServerToServer(
"[{:#06x}] Size [{}] {}",
diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp
index 0e23bb429..15b745b16 100644
--- a/common/patches/rof.cpp
+++ b/common/patches/rof.cpp
@@ -78,7 +78,7 @@ namespace RoF
{
//create our opcode manager if we havent already
if (opcodes == nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
//load up the opcode manager.
//TODO: figure out how to support shared memory with multiple patches...
@@ -117,7 +117,7 @@ namespace RoF
//we need to go to every stream and replace it's manager.
if (opcodes != nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;
diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp
index 747d68204..0d4043d30 100644
--- a/common/patches/rof2.cpp
+++ b/common/patches/rof2.cpp
@@ -81,7 +81,7 @@ namespace RoF2
//create our opcode manager if we havent already
if (opcodes == nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
//load up the opcode manager.
//TODO: figure out how to support shared memory with multiple patches...
@@ -123,7 +123,7 @@ namespace RoF2
//we need to go to every stream and replace it's manager.
if (opcodes != nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;
diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp
index d8f174196..72a3a3c48 100644
--- a/common/patches/sod.cpp
+++ b/common/patches/sod.cpp
@@ -72,7 +72,7 @@ namespace SoD
{
//create our opcode manager if we havent already
if (opcodes == nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
//load up the opcode manager.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@@ -113,7 +113,7 @@ namespace SoD
//we need to go to every stream and replace it's manager.
if (opcodes != nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;
@@ -3966,12 +3966,12 @@ namespace SoD
SoDSlot = serverSlot - 2;
}
- else if (serverSlot <= EQ::invbag::GENERAL_BAGS_8_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
- SoDSlot = serverSlot + 11;
+ else if (serverSlot <= EQ::invbag::GENERAL_BAGS_END && serverSlot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
+ SoDSlot = serverSlot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
}
else if (serverSlot <= EQ::invbag::CURSOR_BAG_END && serverSlot >= EQ::invbag::CURSOR_BAG_BEGIN) {
- SoDSlot = serverSlot - 9;
+ SoDSlot = serverSlot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
}
else if (serverSlot <= EQ::invslot::TRIBUTE_END && serverSlot >= EQ::invslot::TRIBUTE_BEGIN) {
@@ -3991,7 +3991,7 @@ namespace SoD
}
else if (serverSlot <= EQ::invbag::BANK_BAGS_END && serverSlot >= EQ::invbag::BANK_BAGS_BEGIN) {
- SoDSlot = serverSlot + 1;
+ SoDSlot = serverSlot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
}
else if (serverSlot <= EQ::invslot::SHARED_BANK_END && serverSlot >= EQ::invslot::SHARED_BANK_BEGIN) {
@@ -3999,7 +3999,7 @@ namespace SoD
}
else if (serverSlot <= EQ::invbag::SHARED_BANK_BAGS_END && serverSlot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
- SoDSlot = serverSlot + 1;
+ SoDSlot = serverSlot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (serverSlot <= EQ::invslot::TRADE_END && serverSlot >= EQ::invslot::TRADE_BEGIN) {
@@ -4007,7 +4007,7 @@ namespace SoD
}
else if (serverSlot <= EQ::invbag::TRADE_BAGS_END && serverSlot >= EQ::invbag::TRADE_BAGS_BEGIN) {
- SoDSlot = serverSlot;
+ SoDSlot = serverSlot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((serverSlot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (serverSlot <= EQ::invslot::WORLD_END && serverSlot >= EQ::invslot::WORLD_BEGIN) {
@@ -4049,11 +4049,11 @@ namespace SoD
}
else if (sod_slot <= invbag::GENERAL_BAGS_END && sod_slot >= invbag::GENERAL_BAGS_BEGIN) {
- server_slot = sod_slot - 11;
+ server_slot = sod_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (sod_slot <= invbag::CURSOR_BAG_END && sod_slot >= invbag::CURSOR_BAG_BEGIN) {
- server_slot = sod_slot + 9;
+ server_slot = sod_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
}
else if (sod_slot <= invslot::TRIBUTE_END && sod_slot >= invslot::TRIBUTE_BEGIN) {
@@ -4073,7 +4073,7 @@ namespace SoD
}
else if (sod_slot <= invbag::BANK_BAGS_END && sod_slot >= invbag::BANK_BAGS_BEGIN) {
- server_slot = sod_slot - 1;
+ server_slot = sod_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (sod_slot <= invslot::SHARED_BANK_END && sod_slot >= invslot::SHARED_BANK_BEGIN) {
@@ -4081,7 +4081,7 @@ namespace SoD
}
else if (sod_slot <= invbag::SHARED_BANK_BAGS_END && sod_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
- server_slot = sod_slot - 1;
+ server_slot = sod_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (sod_slot <= invslot::TRADE_END && sod_slot >= invslot::TRADE_BEGIN) {
@@ -4089,7 +4089,7 @@ namespace SoD
}
else if (sod_slot <= invbag::TRADE_BAGS_END && sod_slot >= invbag::TRADE_BAGS_BEGIN) {
- server_slot = sod_slot;
+ server_slot = sod_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sod_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (sod_slot <= invslot::WORLD_END && sod_slot >= invslot::WORLD_BEGIN) {
diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp
index be18a78c7..444b33b35 100644
--- a/common/patches/sof.cpp
+++ b/common/patches/sof.cpp
@@ -71,7 +71,7 @@ namespace SoF
{
//create our opcode manager if we havent already
if (opcodes == nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
//load up the opcode manager.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@@ -110,7 +110,7 @@ namespace SoF
//we need to go to every stream and replace it's manager.
if (opcodes != nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;
@@ -3355,12 +3355,12 @@ namespace SoF
sof_slot = server_slot - 2;
}
- else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
- sof_slot = server_slot + 11;
+ else if (server_slot <= EQ::invbag::GENERAL_BAGS_END && server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
+ sof_slot = server_slot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));;
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
- sof_slot = server_slot - 9;
+ sof_slot = server_slot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
}
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
@@ -3380,7 +3380,7 @@ namespace SoF
}
else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
- sof_slot = server_slot + 1;
+ sof_slot = server_slot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
@@ -3388,7 +3388,7 @@ namespace SoF
}
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END && server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
- sof_slot = server_slot + 1;
+ sof_slot = server_slot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
@@ -3396,7 +3396,7 @@ namespace SoF
}
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
- sof_slot = server_slot;
+ sof_slot = server_slot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
@@ -3442,11 +3442,11 @@ namespace SoF
}
else if (sof_slot <= invbag::GENERAL_BAGS_END && sof_slot >= invbag::GENERAL_BAGS_BEGIN) {
- server_slot = sof_slot - 11;
+ server_slot = sof_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));;
}
else if (sof_slot <= invbag::CURSOR_BAG_END && sof_slot >= invbag::CURSOR_BAG_BEGIN) {
- server_slot = sof_slot + 9;
+ server_slot = sof_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
}
else if (sof_slot <= invslot::TRIBUTE_END && sof_slot >= invslot::TRIBUTE_BEGIN) {
@@ -3466,7 +3466,7 @@ namespace SoF
}
else if (sof_slot <= invbag::BANK_BAGS_END && sof_slot >= invbag::BANK_BAGS_BEGIN) {
- server_slot = sof_slot - 1;
+ server_slot = sof_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));;
}
else if (sof_slot <= invslot::SHARED_BANK_END && sof_slot >= invslot::SHARED_BANK_BEGIN) {
@@ -3474,7 +3474,7 @@ namespace SoF
}
else if (sof_slot <= invbag::SHARED_BANK_BAGS_END && sof_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
- server_slot = sof_slot - 1;
+ server_slot = sof_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));;
}
else if (sof_slot <= invslot::TRADE_END && sof_slot >= invslot::TRADE_BEGIN) {
@@ -3482,7 +3482,7 @@ namespace SoF
}
else if (sof_slot <= invbag::TRADE_BAGS_END && sof_slot >= invbag::TRADE_BAGS_BEGIN) {
- server_slot = sof_slot;
+ server_slot = sof_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((sof_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));;
}
else if (sof_slot <= invslot::WORLD_END && sof_slot >= invslot::WORLD_BEGIN) {
diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp
index e9cec60a6..19d93addb 100644
--- a/common/patches/titanium.cpp
+++ b/common/patches/titanium.cpp
@@ -73,7 +73,7 @@ namespace Titanium
auto Config = EQEmuConfig::get();
//create our opcode manager if we havent already
if (opcodes == nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
//load up the opcode manager.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@@ -114,7 +114,7 @@ namespace Titanium
//we need to go to every stream and replace it's manager.
if (opcodes != nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;
@@ -3596,12 +3596,12 @@ namespace Titanium
else if (server_slot == (EQ::invslot::POSSESSIONS_COUNT + EQ::invslot::slotAmmo)) {
titanium_slot = server_slot - 4;
}
- else if (server_slot <= EQ::invbag::GENERAL_BAGS_8_END &&
+ else if (server_slot <= EQ::invbag::GENERAL_BAGS_END &&
server_slot >= EQ::invbag::GENERAL_BAGS_BEGIN) {
- titanium_slot = server_slot;
+ titanium_slot = server_slot - (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::GENERAL_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invbag::CURSOR_BAG_END && server_slot >= EQ::invbag::CURSOR_BAG_BEGIN) {
- titanium_slot = server_slot - 20;
+ titanium_slot = server_slot - (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
}
else if (server_slot <= EQ::invslot::TRIBUTE_END && server_slot >= EQ::invslot::TRIBUTE_BEGIN) {
titanium_slot = server_slot;
@@ -3616,21 +3616,21 @@ namespace Titanium
else if (server_slot <= EQ::invslot::BANK_END && server_slot >= EQ::invslot::BANK_BEGIN) {
titanium_slot = server_slot;
}
- else if (server_slot <= EQ::invbag::BANK_BAGS_16_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
- titanium_slot = server_slot;
+ else if (server_slot <= EQ::invbag::BANK_BAGS_END && server_slot >= EQ::invbag::BANK_BAGS_BEGIN) {
+ titanium_slot = server_slot - (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invslot::SHARED_BANK_END && server_slot >= EQ::invslot::SHARED_BANK_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invbag::SHARED_BANK_BAGS_END &&
server_slot >= EQ::invbag::SHARED_BANK_BAGS_BEGIN) {
- titanium_slot = server_slot;
+ titanium_slot = server_slot - (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::SHARED_BANK_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invslot::TRADE_END && server_slot >= EQ::invslot::TRADE_BEGIN) {
titanium_slot = server_slot;
}
else if (server_slot <= EQ::invbag::TRADE_BAGS_END && server_slot >= EQ::invbag::TRADE_BAGS_BEGIN) {
- titanium_slot = server_slot;
+ titanium_slot = server_slot - (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) - ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((server_slot - EQ::invbag::TRADE_BAGS_BEGIN) / EQ::invbag::SLOT_COUNT));
}
else if (server_slot <= EQ::invslot::WORLD_END && server_slot >= EQ::invslot::WORLD_BEGIN) {
titanium_slot = server_slot;
@@ -3687,10 +3687,10 @@ namespace Titanium
server_slot = titanium_slot + 4;
}
else if (titanium_slot <= invbag::GENERAL_BAGS_END && titanium_slot >= invbag::GENERAL_BAGS_BEGIN) {
- server_slot = titanium_slot;
+ server_slot = titanium_slot + (EQ::invbag::GENERAL_BAGS_BEGIN - invbag::GENERAL_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::GENERAL_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (titanium_slot <= invbag::CURSOR_BAG_END && titanium_slot >= invbag::CURSOR_BAG_BEGIN) {
- server_slot = titanium_slot + 20;
+ server_slot = titanium_slot + (EQ::invbag::CURSOR_BAG_BEGIN - invbag::CURSOR_BAG_BEGIN);
}
else if (titanium_slot <= invslot::TRIBUTE_END && titanium_slot >= invslot::TRIBUTE_BEGIN) {
server_slot = titanium_slot;
@@ -3705,19 +3705,19 @@ namespace Titanium
server_slot = titanium_slot;
}
else if (titanium_slot <= invbag::BANK_BAGS_END && titanium_slot >= invbag::BANK_BAGS_BEGIN) {
- server_slot = titanium_slot;
+ server_slot = titanium_slot + (EQ::invbag::BANK_BAGS_BEGIN - invbag::BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (titanium_slot <= invslot::SHARED_BANK_END && titanium_slot >= invslot::SHARED_BANK_BEGIN) {
server_slot = titanium_slot;
}
else if (titanium_slot <= invbag::SHARED_BANK_BAGS_END && titanium_slot >= invbag::SHARED_BANK_BAGS_BEGIN) {
- server_slot = titanium_slot;
+ server_slot = titanium_slot + (EQ::invbag::SHARED_BANK_BAGS_BEGIN - invbag::SHARED_BANK_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::SHARED_BANK_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (titanium_slot <= invslot::TRADE_END && titanium_slot >= invslot::TRADE_BEGIN) {
server_slot = titanium_slot;
}
else if (titanium_slot <= invbag::TRADE_BAGS_END && titanium_slot >= invbag::TRADE_BAGS_BEGIN) {
- server_slot = titanium_slot;
+ server_slot = titanium_slot + (EQ::invbag::TRADE_BAGS_BEGIN - invbag::TRADE_BAGS_BEGIN) + ((EQ::invbag::SLOT_COUNT - invbag::SLOT_COUNT) * ((titanium_slot - invbag::TRADE_BAGS_BEGIN) / invbag::SLOT_COUNT));
}
else if (titanium_slot <= invslot::WORLD_END && titanium_slot >= invslot::WORLD_BEGIN) {
server_slot = titanium_slot;
diff --git a/common/patches/uf.cpp b/common/patches/uf.cpp
index 35452727b..6433621f5 100644
--- a/common/patches/uf.cpp
+++ b/common/patches/uf.cpp
@@ -76,7 +76,7 @@ namespace UF
{
//create our opcode manager if we havent already
if (opcodes == nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
//load up the opcode manager.
//TODO: figure out how to support shared memory with multiple patches...
opcodes = new RegularOpcodeManager();
@@ -117,7 +117,7 @@ namespace UF
//we need to go to every stream and replace it's manager.
if (opcodes != nullptr) {
- std::string opfile = fmt::format("{}/patch_{}.conf", path.GetPatchPath(), name);
+ std::string opfile = fmt::format("{}/patch_{}.conf", PathManager::Instance()->GetPatchPath(), name);
if (!opcodes->ReloadOpcodes(opfile.c_str())) {
LogNetcode("[OPCODES] Error reloading opcodes file [{}] for patch [{}]", opfile.c_str(), name);
return;
diff --git a/common/path_manager.cpp b/common/path_manager.cpp
index ed57f2f4a..c63835854 100644
--- a/common/path_manager.cpp
+++ b/common/path_manager.cpp
@@ -8,7 +8,7 @@
namespace fs = std::filesystem;
-void PathManager::LoadPaths()
+void PathManager::Init()
{
m_server_path = File::FindEqemuConfigPath();
diff --git a/common/path_manager.h b/common/path_manager.h
index 55cc1489c..67919511e 100644
--- a/common/path_manager.h
+++ b/common/path_manager.h
@@ -7,7 +7,13 @@
class PathManager {
public:
- void LoadPaths();
+ void Init();
+
+ static PathManager *Instance()
+ {
+ static PathManager instance;
+ return &instance;
+ }
[[nodiscard]] const std::string &GetLogPath() const;
[[nodiscard]] const std::string &GetLuaModsPath() const;
@@ -38,6 +44,4 @@ private:
std::string m_shared_memory_path;
};
-extern PathManager path;
-
#endif //EQEMU_PATH_MANAGER_H
diff --git a/common/pch/app-pch.h b/common/pch/app-pch.h
new file mode 100644
index 000000000..aa2244f13
--- /dev/null
+++ b/common/pch/app-pch.h
@@ -0,0 +1,9 @@
+#pragma once
+
+#include "../types.h"
+#include "../database.h"
+#include "../strings.h"
+#include "../eqemu_logsys.h"
+#include "../eqemu_logsys_log_aliases.h"
+#include "../features.h"
+#include "../global_define.h"
diff --git a/common/pch/pch.h b/common/pch/std-pch.h
similarity index 100%
rename from common/pch/pch.h
rename to common/pch/std-pch.h
diff --git a/common/process/process.cpp b/common/process/process.cpp
index badb0fe11..56bbeff2b 100644
--- a/common/process/process.cpp
+++ b/common/process/process.cpp
@@ -1,6 +1,7 @@
#include
#include
#include "process.h"
+#include
std::string Process::execute(const std::string &cmd)
{
diff --git a/common/random.h b/common/random.h
index 6d351121f..73b14369e 100644
--- a/common/random.h
+++ b/common/random.h
@@ -116,6 +116,12 @@ namespace EQ {
Reseed();
}
+ static Random* Instance()
+ {
+ static Random instance;
+ return &instance;
+ }
+
private:
#ifndef BIASED_INT_DIST
typedef std::uniform_int_distribution::param_type int_param_t;
diff --git a/common/repositories/base/base_player_event_log_settings_repository.h b/common/repositories/base/base_player_event_log_settings_repository.h
index 4a2457576..94a53b981 100644
--- a/common/repositories/base/base_player_event_log_settings_repository.h
+++ b/common/repositories/base/base_player_event_log_settings_repository.h
@@ -15,7 +15,7 @@
#include "../../database.h"
#include "../../strings.h"
#include
-
+#include
class BasePlayerEventLogSettingsRepository {
public:
struct PlayerEventLogSettings {
@@ -25,6 +25,20 @@ public:
int32_t retention_days;
int32_t discord_webhook_id;
uint8_t etl_enabled;
+
+ // cereal
+ template
+ void serialize(Archive &ar)
+ {
+ ar(
+ CEREAL_NVP(id),
+ CEREAL_NVP(event_name),
+ CEREAL_NVP(event_enabled),
+ CEREAL_NVP(retention_days),
+ CEREAL_NVP(discord_webhook_id),
+ CEREAL_NVP(etl_enabled)
+ );
+ }
};
static std::string PrimaryKey()
diff --git a/common/repositories/character_data_repository.h b/common/repositories/character_data_repository.h
index 74f884cf3..d95ac2fda 100644
--- a/common/repositories/character_data_repository.h
+++ b/common/repositories/character_data_repository.h
@@ -167,6 +167,30 @@ public:
return zone_player_counts;
}
+
+ static std::vector GetCharacterIDsByAccountID(
+ Database& db,
+ uint32_t account_id
+ )
+ {
+ std::vector character_ids;
+
+ auto query = fmt::format(
+ "SELECT id FROM character_data WHERE account_id = {} AND deleted_at IS NULL",
+ account_id
+ );
+
+ auto results = db.QueryDatabase(query);
+ if (results.Success()) {
+ for (auto row : results) {
+ if (row[0]) {
+ character_ids.push_back(static_cast(std::stoul(row[0])));
+ }
+ }
+ }
+
+ return character_ids;
+ }
};
#endif //EQEMU_CHARACTER_DATA_REPOSITORY_H
diff --git a/common/repositories/rule_values_repository.h b/common/repositories/rule_values_repository.h
index 072175d5f..d7eb1530e 100644
--- a/common/repositories/rule_values_repository.h
+++ b/common/repositories/rule_values_repository.h
@@ -43,6 +43,47 @@ public:
* method and encapsulate filters there
*/
+ template
+ static std::vector join_tuple(
+ const std::string &glue,
+ const std::pair &encapsulation,
+ const std::vector> &src
+ )
+ {
+ if (src.empty()) {
+ return {};
+ }
+
+ std::vector output;
+
+ for (const std::tuple &src_iter: src) {
+
+ output.emplace_back(
+
+ fmt::format(
+ "{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}",
+ encapsulation.first,
+ std::get<0>(src_iter),
+ encapsulation.second,
+ glue,
+ encapsulation.first,
+ std::get<1>(src_iter),
+ encapsulation.second,
+ glue,
+ encapsulation.first,
+ std::get<2>(src_iter),
+ encapsulation.second,
+ glue,
+ encapsulation.first,
+ std::get<3>(src_iter),
+ encapsulation.second
+ )
+ );
+ }
+
+ return output;
+ }
+
// Custom extended repository methods here
static std::vector GetRuleNames(Database &db, int rule_set_id)
{
@@ -87,12 +128,28 @@ public:
return v;
}
+ template
+ static std::string
+ ImplodePair(const std::string &glue, const std::pair &encapsulation, const std::vector &src)
+ {
+ if (src.empty()) {
+ return {};
+ }
+ std::ostringstream oss;
+ for (const T &src_iter: src) {
+ oss << encapsulation.first << src_iter << encapsulation.second << glue;
+ }
+ std::string output(oss.str());
+ output.resize(output.size() - glue.size());
+ return output;
+ }
+
static bool DeleteOrphanedRules(Database& db, std::vector& v)
{
const auto query = fmt::format(
"DELETE FROM {} WHERE rule_name IN ({})",
TableName(),
- Strings::ImplodePair(",", std::pair('\'', '\''), v)
+ ImplodePair(",", std::pair('\'', '\''), v)
);
return db.QueryDatabase(query).Success();
@@ -103,7 +160,7 @@ public:
const auto query = fmt::format(
"REPLACE INTO {} (`ruleset_id`, `rule_name`, `rule_value`, `notes`) VALUES {}",
TableName(),
- Strings::ImplodePair(
+ ImplodePair(
",",
std::pair('(', ')'),
join_tuple(",", std::pair('\'', '\''), v)
diff --git a/common/servertalk.h b/common/servertalk.h
index 3680ac76d..9985c875c 100644
--- a/common/servertalk.h
+++ b/common/servertalk.h
@@ -273,8 +273,9 @@
#define ServerOP_WWTaskUpdate 0x4758
// player events
-#define ServerOP_QSSendQuery 0x5000
+#define ServerOP_QSSendQuery 0x5000
#define ServerOP_PlayerEvent 0x5100
+#define ServerOP_SendPlayerEventSettings 0x5101
enum {
CZUpdateType_Character,
@@ -1778,6 +1779,7 @@ struct BazaarPurchaseMessaging_Struct {
uint32 id;
};
+
#pragma pack()
#endif
diff --git a/common/shareddb.cpp b/common/shareddb.cpp
index 1187d80bb..0880e1f2e 100644
--- a/common/shareddb.cpp
+++ b/common/shareddb.cpp
@@ -824,7 +824,7 @@ bool SharedDatabase::GetInventory(Client *c)
e.character_id = char_id;
e.item_id = item_id;
e.equipped = inst->GetEvolveEquipped();
- e.final_item_id = evolving_items_manager.GetFinalItemID(*inst);
+ e.final_item_id = EvolvingItemsManager::Instance()->GetFinalItemID(*inst);
auto r = CharacterEvolvingItemsRepository::InsertOne(*this, e);
e.id = r.id;
@@ -974,7 +974,7 @@ bool SharedDatabase::LoadItems(const std::string &prefix) {
const auto Config = EQEmuConfig::get();
EQ::IPCMutex mutex("items");
mutex.Lock();
- std::string file_name = fmt::format("{}/{}{}", path.GetSharedMemoryPath(), prefix, std::string("items"));
+ std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("items"));
items_mmf = std::make_unique(file_name);
items_hash = std::make_unique>(static_cast(items_mmf->Get()), items_mmf->Size());
mutex.Unlock();
@@ -1544,12 +1544,60 @@ bool SharedDatabase::GetCommandSettings(std::map
+inline std::vector join_pair(
+ const std::string &glue,
+ const std::pair &encapsulation,
+ const std::vector> &src
+)
+{
+ if (src.empty()) {
+ return {};
+ }
+
+ std::vector output;
+
+ for (const std::pair &src_iter: src) {
+ output.emplace_back(
+
+ fmt::format(
+ "{}{}{}{}{}{}{}",
+ encapsulation.first,
+ src_iter.first,
+ encapsulation.second,
+ glue,
+ encapsulation.first,
+ src_iter.second,
+ encapsulation.second
+ )
+ );
+ }
+
+ return output;
+}
+
+template
+inline std::string
+ImplodePair(const std::string &glue, const std::pair &encapsulation, const std::vector &src)
+{
+ if (src.empty()) {
+ return {};
+ }
+ std::ostringstream oss;
+ for (const T &src_iter: src) {
+ oss << encapsulation.first << src_iter << encapsulation.second << glue;
+ }
+ std::string output(oss.str());
+ output.resize(output.size() - glue.size());
+ return output;
+}
+
bool SharedDatabase::UpdateInjectedCommandSettings(const std::vector> &injected)
{
if (injected.size()) {
const std::string query = fmt::format(
"REPLACE INTO `command_settings`(`command`, `access`) VALUES {}",
- Strings::ImplodePair(
+ ImplodePair(
",",
std::pair('(', ')'),
join_pair(",", std::pair('\'', '\''), injected)
@@ -1576,7 +1624,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector('\'', '\''), orphaned)
+ ImplodePair(",", std::pair('\'', '\''), orphaned)
);
auto results = QueryDatabase(query);
@@ -1586,7 +1634,7 @@ bool SharedDatabase::UpdateOrphanedCommandSettings(const std::vector('\'', '\''), orphaned)
+ ImplodePair(",", std::pair('\'', '\''), orphaned)
);
auto results_two = QueryDatabase(query);
@@ -1665,7 +1713,7 @@ bool SharedDatabase::LoadSpells(const std::string &prefix, int32 *records, const
EQ::IPCMutex mutex("spells");
mutex.Lock();
- std::string file_name = fmt::format("{}/{}{}", path.GetSharedMemoryPath(), prefix, std::string("spells"));
+ std::string file_name = fmt::format("{}/{}{}", PathManager::Instance()->GetSharedMemoryPath(), prefix, std::string("spells"));
spells_mmf = std::make_unique(file_name);
LogInfo("Loading [{}]", file_name);
*records = *static_cast(spells_mmf->Get());
diff --git a/common/skill_caps.h b/common/skill_caps.h
index 9630ed7d7..6566a1104 100644
--- a/common/skill_caps.h
+++ b/common/skill_caps.h
@@ -16,12 +16,16 @@ public:
static int32_t GetSkillCapMaxLevel(uint8 class_id, EQ::skills::SkillType skill_id);
SkillCaps *SetContentDatabase(Database *db);
+
+ static SkillCaps* Instance()
+ {
+ static SkillCaps instance;
+ return &instance;
+ }
private:
Database *m_content_database{};
std::map m_skill_caps = {};
};
-extern SkillCaps skill_caps;
-
#endif //CODE_SKILL_CAPS_H
diff --git a/common/strings.cpp b/common/strings.cpp
index 58261388f..52990aa85 100644
--- a/common/strings.cpp
+++ b/common/strings.cpp
@@ -34,6 +34,7 @@
*/
#include "strings.h"
+#include
#include
#include
#include
@@ -41,6 +42,7 @@
#include
#include
#include
+#include
#include
#include
@@ -49,6 +51,12 @@
#include "strings_legacy.cpp" // legacy c functions
#include "strings_misc.cpp" // anything non "Strings" scoped
+#ifdef _WINDOWS
+#include
+#include
+#include
+#endif
+
std::string Strings::Random(size_t length)
{
static auto &chrs = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -701,6 +709,18 @@ std::string &Strings::Trim(std::string &str, const std::string &chars)
return LTrim(RTrim(str, chars), chars);
}
+const std::string NUM_TO_ENGLISH_X[] = {
+ "", "One ", "Two ", "Three ", "Four ",
+ "Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ",
+ "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ",
+ "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "
+};
+
+const std::string NUM_TO_ENGLISH_Y[] = {
+ "", "", "Twenty ", "Thirty ", "Forty ",
+ "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
+};
+
// Function to convert single digit or two digit number into words
std::string Strings::ConvertToDigit(int n, const std::string& suffix)
{
diff --git a/common/strings.h b/common/strings.h
index 5338949b5..8ae8fee25 100644
--- a/common/strings.h
+++ b/common/strings.h
@@ -36,53 +36,19 @@
#define _STRINGUTIL_H_
#include
-#include
-#include
+#include
#include
+#include
#include
#include
-#include
#include
-#include
-#include
-
-#ifndef _WIN32
-// this doesn't appear to affect linux-based systems..need feedback for _WIN64
-
-#endif
-
-#ifdef _WINDOWS
+#ifdef _WIN32
#include
-#include
-#include
#endif
#include "types.h"
-namespace detail {
- // template magic to check if std::from_chars floating point functions exist
- template
- struct has_from_chars_float : std::false_type { };
-
- // basically it "uses" this template if they do exist because reasons
- template
- struct has_from_chars_float < T,
- std::void_t(), std::declval(),
- std::declval()))>> : std::true_type { };
-}; // namespace detail
-
-namespace EQ {
-// lame -- older GCC's didn't define this, clang's libc++ however does, even though they lack FP support
-#if defined(__GNUC__) && (__GNUC__ < 11) && !defined(__clang__)
- enum class chars_format {
- scientific = 1, fixed = 2, hex = 4, general = fixed | scientific
- };
-#else
- using chars_format = std::chars_format;
-#endif
-}; // namespace EQ
-
class Strings {
public:
static bool Contains(std::vector container, const std::string& element);
@@ -133,61 +99,6 @@ public:
static bool BeginsWith(const std::string& subject, const std::string& search);
static bool EndsWith(const std::string& subject, const std::string& search);
static std::string ZoneTime(const uint8 hours, const uint8 minutes);
-
- template
- static std::string
- ImplodePair(const std::string &glue, const std::pair &encapsulation, const std::vector &src)
- {
- if (src.empty()) {
- return {};
- }
- std::ostringstream oss;
- for (const T &src_iter: src) {
- oss << encapsulation.first << src_iter << encapsulation.second << glue;
- }
- std::string output(oss.str());
- output.resize(output.size() - glue.size());
- return output;
- }
-
- // basic string_view overloads that just use std stuff since they work!
- template
- std::enable_if_t && detail::has_from_chars_float::value, std::from_chars_result>
- static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
- {
- return std::from_chars(str.data(), str.data() + str.size(), value, fmt);
- }
-
- template
- std::enable_if_t, std::from_chars_result>
- static from_chars(std::string_view str, T& value, int base = 10)
- {
- return std::from_chars(str.data(), str.data() + str.size(), value, base);
- }
-
- // fallback versions of floating point in case they're not implemented
- // TODO: add error handling ...
- // This does have to allocate since from_chars doesn't need a null terminated string and neither does string_view
- template
- std::enable_if_t && !detail::has_from_chars_float::value && std::is_same_v, std::from_chars_result>
- static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
- {
- std::from_chars_result res{};
- std::string tmp_str(str.data(), str.size());
- value = strtof(tmp_str.data(), nullptr);
- return res;
- }
-
- template
- std::enable_if_t && !detail::has_from_chars_float::value && std::is_same_v, std::from_chars_result>
- static from_chars(std::string_view str, T& value, EQ::chars_format fmt = EQ::chars_format::general)
- {
- std::from_chars_result res{};
- std::string tmp_str(str.data(), str.size());
- value = strtod(tmp_str.data(), nullptr);
- return res;
- }
-
static std::string Slugify(const std::string &input, const std::string &separator = "-");
static bool IsValidJson(const std::string& json);
};
@@ -199,93 +110,6 @@ const std::string vStringFormat(const char *format, va_list args);
// Used for grid nodes, as NPC names remove numerals.
// But general purpose
-const std::string NUM_TO_ENGLISH_X[] = {
- "", "One ", "Two ", "Three ", "Four ",
- "Five ", "Six ", "Seven ", "Eight ", "Nine ", "Ten ", "Eleven ",
- "Twelve ", "Thirteen ", "Fourteen ", "Fifteen ",
- "Sixteen ", "Seventeen ", "Eighteen ", "Nineteen "
-};
-
-const std::string NUM_TO_ENGLISH_Y[] = {
- "", "", "Twenty ", "Thirty ", "Forty ",
- "Fifty ", "Sixty ", "Seventy ", "Eighty ", "Ninety "
-};
-
-// _WIN32 builds require that #include be included in whatever code file the invocation is made from (no header files)
-template
-std::vector join_pair(
- const std::string &glue,
- const std::pair &encapsulation,
- const std::vector> &src
-)
-{
- if (src.empty()) {
- return {};
- }
-
- std::vector output;
-
- for (const std::pair &src_iter: src) {
- output.emplace_back(
-
- fmt::format(
- "{}{}{}{}{}{}{}",
- encapsulation.first,
- src_iter.first,
- encapsulation.second,
- glue,
- encapsulation.first,
- src_iter.second,
- encapsulation.second
- )
- );
- }
-
- return output;
-}
-
-// _WIN32 builds require that #include be included in whatever code file the invocation is made from (no header files)
-template
-std::vector join_tuple(
- const std::string &glue,
- const std::pair &encapsulation,
- const std::vector> &src
-)
-{
- if (src.empty()) {
- return {};
- }
-
- std::vector