Removed platform code, refactored logging to account for it and removed logging global var.

This commit is contained in:
KimLS 2020-01-06 18:15:55 -08:00
parent 4e8aec136e
commit a162313355
39 changed files with 343 additions and 645 deletions

View File

@ -22,21 +22,17 @@
#include "../../common/global_define.h" #include "../../common/global_define.h"
#include "../../common/shareddb.h" #include "../../common/shareddb.h"
#include "../../common/eqemu_config.h" #include "../../common/eqemu_config.h"
#include "../../common/platform.h"
#include "../../common/crash.h" #include "../../common/crash.h"
#include "../../common/rulesys.h" #include "../../common/rulesys.h"
#include "../../common/string_util.h" #include "../../common/string_util.h"
EQEmuLogSys LogSys;
void ExportSpells(SharedDatabase *db); void ExportSpells(SharedDatabase *db);
void ExportSkillCaps(SharedDatabase *db); void ExportSkillCaps(SharedDatabase *db);
void ExportBaseData(SharedDatabase *db); void ExportBaseData(SharedDatabase *db);
void ExportDBStrings(SharedDatabase *db); void ExportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) { int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientExport); EQEmuLogSys::Get()->LoadLogSettingsDefaults("client_export");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
LogInfo("Client Files Export Utility"); LogInfo("Client Files Export Utility");
@ -56,8 +52,8 @@ int main(int argc, char **argv) {
} }
/* Register Log System and Settings */ /* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
std::string arg_1; std::string arg_1;
@ -87,7 +83,7 @@ int main(int argc, char **argv) {
ExportBaseData(&database); ExportBaseData(&database);
ExportDBStrings(&database); ExportDBStrings(&database);
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
return 0; return 0;
} }

View File

@ -20,21 +20,17 @@
#include "../../common/global_define.h" #include "../../common/global_define.h"
#include "../../common/shareddb.h" #include "../../common/shareddb.h"
#include "../../common/eqemu_config.h" #include "../../common/eqemu_config.h"
#include "../../common/platform.h"
#include "../../common/crash.h" #include "../../common/crash.h"
#include "../../common/rulesys.h" #include "../../common/rulesys.h"
#include "../../common/string_util.h" #include "../../common/string_util.h"
EQEmuLogSys LogSys;
void ImportSpells(SharedDatabase *db); void ImportSpells(SharedDatabase *db);
void ImportSkillCaps(SharedDatabase *db); void ImportSkillCaps(SharedDatabase *db);
void ImportBaseData(SharedDatabase *db); void ImportBaseData(SharedDatabase *db);
void ImportDBStrings(SharedDatabase *db); void ImportDBStrings(SharedDatabase *db);
int main(int argc, char **argv) { int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformClientImport); EQEmuLogSys::Get()->LoadLogSettingsDefaults("client_import");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
LogInfo("Client Files Import Utility"); LogInfo("Client Files Import Utility");
@ -54,15 +50,15 @@ int main(int argc, char **argv) {
return 1; return 1;
} }
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
ImportSpells(&database); ImportSpells(&database);
ImportSkillCaps(&database); ImportSkillCaps(&database);
ImportBaseData(&database); ImportBaseData(&database);
ImportDBStrings(&database); ImportDBStrings(&database);
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
return 0; return 0;
} }

View File

@ -73,7 +73,6 @@ SET(common_sources
textures.cpp textures.cpp
timer.cpp timer.cpp
unix.cpp unix.cpp
platform.cpp
json/jsoncpp.cpp json/jsoncpp.cpp
net/console_server.cpp net/console_server.cpp
net/console_server_connection.cpp net/console_server_connection.cpp
@ -184,7 +183,6 @@ SET(common_headers
packet_dump.h packet_dump.h
packet_dump_file.h packet_dump_file.h
packet_functions.h packet_functions.h
platform.h
proc_launcher.h proc_launcher.h
profanity_manager.h profanity_manager.h
profiler.h profiler.h

View File

@ -21,7 +21,6 @@
#include <fmt/format.h> #include <fmt/format.h>
#include "eqemu_command_handler.h" #include "eqemu_command_handler.h"
#include "terminal_color.hpp" #include "terminal_color.hpp"
#include "../platform.h"
namespace EQEmuCommand { namespace EQEmuCommand {
@ -119,6 +118,7 @@ namespace EQEmuCommand {
std::string &description std::string &description
)> &in_function_map, )> &in_function_map,
argh::parser &cmd, argh::parser &cmd,
const std::string& platform,
int argc, int argc,
char **argv char **argv
) )
@ -137,7 +137,7 @@ namespace EQEmuCommand {
std::cout << std::cout <<
"> " << "> " <<
termcolor::yellow << termcolor::yellow <<
"EQEmulator [" + GetPlatformName() + "] CLI Menu" << "EQEmulator [" + platform + "] CLI Menu" <<
termcolor::reset termcolor::reset
<< std::endl << std::endl
<< std::endl; << std::endl;

View File

@ -66,6 +66,7 @@ namespace EQEmuCommand {
std::string &description std::string &description
)> &in_function_map, )> &in_function_map,
argh::parser &cmd, argh::parser &cmd,
const std::string &platform,
int argc, int argc,
char **argv char **argv
); );

View File

@ -2195,7 +2195,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings *log_settings)
* 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 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[log_category_id].log_to_file > 0) { if (log_settings[log_category_id].log_to_file > 0) {
LogSys.file_logs_enabled = true; EQEmuLogSys::Get()->file_logs_enabled = true;
} }
categories_in_database[log_category_id] = 1; categories_in_database[log_category_id] = 1;

View File

@ -117,7 +117,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
/* Implement Logging at the Root */ /* Implement Logging at the Root */
if (mysql_errno(&mysql) > 0 && strlen(query) > 0) { if (mysql_errno(&mysql) > 0 && strlen(query) > 0) {
if (LogSys.log_settings[Logs::MySQLError].is_category_enabled == 1) if (EQEmuLogSys::Get()->log_settings[Logs::MySQLError].is_category_enabled == 1)
Log(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query); Log(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query);
} }
@ -141,7 +141,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char *query, uint32 querylen, boo
(uint32) mysql_insert_id(&mysql) (uint32) mysql_insert_id(&mysql)
); );
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1) { if (EQEmuLogSys::Get()->log_settings[Logs::MySQLQuery].is_category_enabled == 1) {
if ((strncasecmp(query, "select", 6) == 0)) { if ((strncasecmp(query, "select", 6) == 0)) {
LogF( LogF(
Logs::General, Logs::General,

View File

@ -21,7 +21,6 @@
#include "eq_packet.h" #include "eq_packet.h"
#include "misc.h" #include "misc.h"
#include "op_codes.h" #include "op_codes.h"
#include "platform.h"
#include <iomanip> #include <iomanip>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
@ -154,52 +153,6 @@ void EQApplicationPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
#endif #endif
} }
void EQRawApplicationPacket::build_raw_header_dump(char *buffer, uint16 seq) const
{
BasePacket::build_raw_header_dump(buffer, seq);
buffer += strlen(buffer);
#ifdef STATIC_OPCODE
buffer += sprintf(buffer, "[OpCode 0x%04x (0x%04x) Size=%u]\n", emu_opcode, opcode,size);
#else
buffer += sprintf(buffer, "[OpCode %s (0x%04x) Size=%u]\n", OpcodeManager::EmuToName(emu_opcode), opcode,size);
#endif
}
void EQRawApplicationPacket::DumpRawHeader(uint16 seq, FILE *to) const
{
char buff[196];
build_raw_header_dump(buff, seq);
fprintf(to, "%s", buff);
}
void EQRawApplicationPacket::build_header_dump(char *buffer) const
{
#ifdef STATIC_OPCODE
sprintf(buffer, "[OpCode 0x%04x (0x%04x) Size=%u]\n", emu_opcode, opcode,size);
#else
sprintf(buffer, "[OpCode %s (0x%04x) Size=%u]", OpcodeManager::EmuToName(emu_opcode), opcode,size);
#endif
}
void EQRawApplicationPacket::DumpRawHeaderNoTime(uint16 seq, FILE *to) const
{
if (src_ip) {
std::string sIP,dIP;;
sIP=long2ip(src_ip);
dIP=long2ip(dst_ip);
fprintf(to, "[%s:%d->%s:%d] ",sIP.c_str(),src_port,dIP.c_str(),dst_port);
}
if (seq != 0xffff)
fprintf(to, "[Seq=%u] ",seq);
#ifdef STATIC_OPCODE
fprintf(to, "[OpCode 0x%04x (0x%04x) Size=%u]\n", emu_opcode, opcode,size);
#else
fprintf(to, "[OpCode %s (0x%04x) Size=%lu]\n", OpcodeManager::EmuToName(emu_opcode), opcode,(unsigned long)size);
#endif
}
uint32 EQProtocolPacket::serialize(unsigned char *dest) const uint32 EQProtocolPacket::serialize(unsigned char *dest) const
{ {
if (opcode>0xff) { if (opcode>0xff) {
@ -456,52 +409,6 @@ EQApplicationPacket *EQApplicationPacket::Copy() const {
return(new EQApplicationPacket(*this)); return(new EQApplicationPacket(*this));
} }
EQRawApplicationPacket *EQProtocolPacket::MakeAppPacket() const {
auto res = new EQRawApplicationPacket(opcode, pBuffer, size);
res->copyInfo(this);
return(res);
}
EQRawApplicationPacket::EQRawApplicationPacket(uint16 opcode, const unsigned char *buf, const uint32 len)
: EQApplicationPacket(OP_Unknown, buf, len),
opcode(opcode)
{
}
EQRawApplicationPacket::EQRawApplicationPacket(const unsigned char *buf, const uint32 len)
: EQApplicationPacket(OP_Unknown, buf+sizeof(uint16), len-sizeof(uint16))
{
if(GetExecutablePlatform() != ExePlatformUCS) {
opcode = *((const uint16 *) buf);
if(opcode == 0x0000)
{
if(len >= 3)
{
opcode = *((const uint16 *) (buf + 1));
const unsigned char *packet_start = (buf + 3);
const int32 packet_length = len - 3;
safe_delete_array(pBuffer);
if(packet_length >= 0)
{
size = packet_length;
pBuffer = new unsigned char[size];
memcpy(pBuffer, packet_start, size);
}
else
{
size = 0;
}
}
else
{
safe_delete_array(pBuffer);
size = 0;
}
}
} else {
opcode = *((const uint8 *) buf);
}
}
void DumpPacket(const EQApplicationPacket* app, bool iShowInfo) { void DumpPacket(const EQApplicationPacket* app, bool iShowInfo) {
if (iShowInfo) { if (iShowInfo) {
std::cout << "Dumping Applayer: 0x" << std::hex << std::setfill('0') << std::setw(4) << app->GetOpcode() << std::dec; std::cout << "Dumping Applayer: 0x" << std::hex << std::setfill('0') << std::setw(4) << app->GetOpcode() << std::dec;

View File

@ -19,7 +19,6 @@
#define _EQPACKET_H #define _EQPACKET_H
#include "base_packet.h" #include "base_packet.h"
#include "platform.h"
#include <iostream> #include <iostream>
#ifdef STATIC_OPCODE #ifdef STATIC_OPCODE
@ -57,8 +56,6 @@ protected:
}; };
class EQRawApplicationPacket;
class EQProtocolPacket : public BasePacket { class EQProtocolPacket : public BasePacket {
friend class EQStream; friend class EQStream;
friend class EQStreamPair; friend class EQStreamPair;
@ -68,7 +65,6 @@ public:
bool combine(const EQProtocolPacket *rhs); bool combine(const EQProtocolPacket *rhs);
uint32 serialize (unsigned char *dest) const; uint32 serialize (unsigned char *dest) const;
EQProtocolPacket *Copy() { return new EQProtocolPacket(opcode,pBuffer,size); } EQProtocolPacket *Copy() { return new EQProtocolPacket(opcode,pBuffer,size); }
EQRawApplicationPacket *MakeAppPacket() const;
bool acked; bool acked;
uint32 sent_time; uint32 sent_time;
@ -98,15 +94,15 @@ class EQApplicationPacket : public EQPacket {
friend class EQStream; friend class EQStream;
public: public:
EQApplicationPacket() : EQPacket(OP_Unknown, nullptr, 0), opcode_bypass(0) EQApplicationPacket() : EQPacket(OP_Unknown, nullptr, 0), opcode_bypass(0)
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } { app_opcode_size = 2; }
EQApplicationPacket(const EmuOpcode op) : EQPacket(op, nullptr, 0), opcode_bypass(0) EQApplicationPacket(const EmuOpcode op) : EQPacket(op, nullptr, 0), opcode_bypass(0)
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } { app_opcode_size = 2; }
EQApplicationPacket(const EmuOpcode op, const uint32 len) : EQPacket(op, nullptr, len), opcode_bypass(0) EQApplicationPacket(const EmuOpcode op, const uint32 len) : EQPacket(op, nullptr, len), opcode_bypass(0)
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } { app_opcode_size = 2; }
EQApplicationPacket(const EmuOpcode op, const unsigned char *buf, const uint32 len) : EQPacket(op, buf, len), opcode_bypass(0) EQApplicationPacket(const EmuOpcode op, const unsigned char *buf, const uint32 len) : EQPacket(op, buf, len), opcode_bypass(0)
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } { app_opcode_size = 2; }
EQApplicationPacket(const EmuOpcode op, SerializeBuffer &buf) : EQPacket(op, buf), opcode_bypass(0) EQApplicationPacket(const EmuOpcode op, SerializeBuffer &buf) : EQPacket(op, buf), opcode_bypass(0)
{ app_opcode_size = GetExecutablePlatform() == ExePlatformUCS ? 1 : 2; } { app_opcode_size = 2; }
bool combine(const EQApplicationPacket *rhs); bool combine(const EQApplicationPacket *rhs);
uint32 serialize (uint16 opcode, unsigned char *dest) const; uint32 serialize (uint16 opcode, unsigned char *dest) const;
uint32 Size() const { return size+app_opcode_size; } uint32 Size() const { return size+app_opcode_size; }
@ -134,25 +130,6 @@ private:
}; };
class EQRawApplicationPacket : public EQApplicationPacket {
friend class EQStream;
public:
EQRawApplicationPacket(uint16 opcode, const unsigned char *buf, const uint32 len);
uint16 GetRawOpcode() const { return(opcode); }
virtual void build_raw_header_dump(char *buffer, uint16 seq=0xffff) const;
virtual void build_header_dump(char *buffer) const;
virtual void DumpRawHeader(uint16 seq=0xffff, FILE *to = stdout) const;
virtual void DumpRawHeaderNoTime(uint16 seq=0xffff, FILE *to = stdout) const;
protected:
//the actual raw EQ opcode
uint16 opcode;
EQRawApplicationPacket(const unsigned char *buf, const uint32 len);
};
extern void DumpPacket(const EQApplicationPacket* app, bool iShowInfo = false); extern void DumpPacket(const EQApplicationPacket* app, bool iShowInfo = false);
extern std::string DumpPacketToString(const EQApplicationPacket* app); extern std::string DumpPacketToString(const EQApplicationPacket* app);

View File

@ -20,7 +20,6 @@
#include "eqemu_logsys.h" #include "eqemu_logsys.h"
#include "rulesys.h" #include "rulesys.h"
#include "platform.h"
#include "string_util.h" #include "string_util.h"
#include "database.h" #include "database.h"
#include "misc.h" #include "misc.h"
@ -96,13 +95,8 @@ EQEmuLogSys::EQEmuLogSys()
*/ */
EQEmuLogSys::~EQEmuLogSys() = default; EQEmuLogSys::~EQEmuLogSys() = default;
void EQEmuLogSys::LoadLogSettingsDefaults() void EQEmuLogSys::LoadLogSettingsDefaults(const std::string& platform)
{ {
/**
* Get Executable platform currently running this code (Zone/World/etc)
*/
log_platform = GetExecutablePlatformInt();
for (int log_category_id = Logs::AA; log_category_id != Logs::MaxCategoryID; log_category_id++) { for (int log_category_id = Logs::AA; log_category_id != Logs::MaxCategoryID; log_category_id++) {
log_settings[log_category_id].log_to_console = 0; log_settings[log_category_id].log_to_console = 0;
log_settings[log_category_id].log_to_file = 0; log_settings[log_category_id].log_to_file = 0;
@ -149,30 +143,7 @@ void EQEmuLogSys::LoadLogSettingsDefaults()
} }
} }
/** platform_file_name = platform;
* Declare process file names for log writing=
*/
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld) {
platform_file_name = "world";
}
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ) {
platform_file_name = "query_server";
}
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone) {
platform_file_name = "zone";
}
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformUCS) {
platform_file_name = "ucs";
}
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin) {
platform_file_name = "login";
}
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLaunch) {
platform_file_name = "launcher";
}
else if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformHC) {
platform_file_name = "hc";
}
} }
/** /**
@ -206,7 +177,7 @@ std::string EQEmuLogSys::FormatOutMessageString(
std::string return_string; std::string return_string;
if (IsRfc5424LogCategory(log_category)) { if (IsRfc5424LogCategory(log_category)) {
return_string = "[" + GetPlatformName() + "] "; return_string = "[" + platform_file_name + "] ";
} }
return return_string + "[" + Logs::LogCategoryName[log_category] + "] " + in_message; return return_string + "[" + Logs::LogCategoryName[log_category] + "] " + in_message;
@ -233,7 +204,7 @@ void EQEmuLogSys::ProcessGMSay(
/** /**
* Check to see if the process that actually ran this is zone * Check to see if the process that actually ran this is zone
*/ */
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone) { if (on_log_gmsay_hook) {
on_log_gmsay_hook(log_category, message); on_log_gmsay_hook(log_category, message);
} }
} }
@ -535,7 +506,7 @@ void EQEmuLogSys::StartFileLogs(const std::string &log_name)
/** /**
* Zone * Zone
*/ */
if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone) { if (platform_file_name == "zone") {
if (!log_name.empty()) { if (!log_name.empty()) {
platform_file_name = log_name; platform_file_name = log_name;
} }

View File

@ -192,15 +192,19 @@ namespace Logs {
class EQEmuLogSys { class EQEmuLogSys {
public: public:
EQEmuLogSys();
~EQEmuLogSys(); ~EQEmuLogSys();
static EQEmuLogSys* Get() {
static EQEmuLogSys inst;
return &inst;
}
/** /**
* Close File Logs wherever necessary, either at zone shutdown or entire process shutdown for everything else. * Close File Logs wherever necessary, either at zone shutdown or entire process shutdown for everything else.
* This should be handled on deconstructor but to be safe we use it anyways. * This should be handled on deconstructor but to be safe we use it anyways.
*/ */
void CloseFileLogs(); void CloseFileLogs();
void LoadLogSettingsDefaults(); void LoadLogSettingsDefaults(const std::string &platform);
/** /**
* @param directory_name * @param directory_name
@ -263,11 +267,6 @@ public:
bool file_logs_enabled = false; bool file_logs_enabled = false;
/**
* Sets Executable platform (Zone/World/UCS) etc.
*/
int log_platform = 0;
/** /**
* File name used in writing logs * File name used in writing logs
*/ */
@ -302,6 +301,9 @@ public:
void EnableConsoleLogging(); void EnableConsoleLogging();
private: private:
EQEmuLogSys();
EQEmuLogSys(const EQEmuLogSys&);
EQEmuLogSys& operator=(const EQEmuLogSys&);
/** /**
* Callback pointer to zone process for hooking logs to zone using GMSay * Callback pointer to zone process for hooking logs to zone using GMSay
@ -355,12 +357,10 @@ private:
bool IsRfc5424LogCategory(uint16 log_category); bool IsRfc5424LogCategory(uint16 log_category);
}; };
extern EQEmuLogSys LogSys;
/** /**
template<typename... Args> template<typename... Args>
void OutF( void OutF(
EQEmuLogSys &ls, EQEmuLogSys *ls,
Logs::DebugLevel debug_level, Logs::DebugLevel debug_level,
uint16 log_category, uint16 log_category,
const char *file, const char *file,
@ -377,7 +377,7 @@ void OutF(
#define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \ #define OutF(ls, debug_level, log_category, file, func, line, formatStr, ...) \
do { \ 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) } while(0)
#endif #endif

View File

@ -28,43 +28,43 @@
*/ */
#define LogEmergency(message, ...) do {\ #define LogEmergency(message, ...) do {\
if (LogSys.log_settings[Logs::Emergency].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Emergency].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Emergency, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Emergency, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAlert(message, ...) do {\ #define LogAlert(message, ...) do {\
if (LogSys.log_settings[Logs::Alert].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Alert].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Alert, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Alert, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCritical(message, ...) do {\ #define LogCritical(message, ...) do {\
if (LogSys.log_settings[Logs::Critical].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Critical].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Critical, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Critical, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogError(message, ...) do {\ #define LogError(message, ...) do {\
if (LogSys.log_settings[Logs::Error].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Error].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Error, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogWarning(message, ...) do {\ #define LogWarning(message, ...) do {\
if (LogSys.log_settings[Logs::Warning].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Warning].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Warning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Warning, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNotice(message, ...) do {\ #define LogNotice(message, ...) do {\
if (LogSys.log_settings[Logs::Notice].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Notice].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Notice, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Notice, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogInfo(message, ...) do {\ #define LogInfo(message, ...) do {\
if (LogSys.log_settings[Logs::Info].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Info].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Info, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Info, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogDebug(message, ...) do {\ #define LogDebug(message, ...) do {\
if (LogSys.log_settings[Logs::Debug].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Debug].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Debug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
/** /**
@ -72,493 +72,493 @@
*/ */
#define LogAA(message, ...) do {\ #define LogAA(message, ...) do {\
if (LogSys.log_settings[Logs::AA].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AA].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAADetail(message, ...) do {\ #define LogAADetail(message, ...) do {\
if (LogSys.log_settings[Logs::AA].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AA].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::AA, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAI(message, ...) do {\ #define LogAI(message, ...) do {\
if (LogSys.log_settings[Logs::AI].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AI].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAIDetail(message, ...) do {\ #define LogAIDetail(message, ...) do {\
if (LogSys.log_settings[Logs::AI].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AI].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::AI, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAggro(message, ...) do {\ #define LogAggro(message, ...) do {\
if (LogSys.log_settings[Logs::Aggro].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Aggro].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAggroDetail(message, ...) do {\ #define LogAggroDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Aggro].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Aggro].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Aggro, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAttack(message, ...) do {\ #define LogAttack(message, ...) do {\
if (LogSys.log_settings[Logs::Attack].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Attack].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAttackDetail(message, ...) do {\ #define LogAttackDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Attack].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Attack].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Attack, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogPacketClientServer(message, ...) do {\ #define LogPacketClientServer(message, ...) do {\
if (LogSys.log_settings[Logs::PacketClientServer].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::PacketClientServer].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogPacketClientServerDetail(message, ...) do {\ #define LogPacketClientServerDetail(message, ...) do {\
if (LogSys.log_settings[Logs::PacketClientServer].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::PacketClientServer].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::PacketClientServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCombat(message, ...) do {\ #define LogCombat(message, ...) do {\
if (LogSys.log_settings[Logs::Combat].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Combat].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCombatDetail(message, ...) do {\ #define LogCombatDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Combat].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Combat].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Combat, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCommands(message, ...) do {\ #define LogCommands(message, ...) do {\
if (LogSys.log_settings[Logs::Commands].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Commands].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCommandsDetail(message, ...) do {\ #define LogCommandsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Commands].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Commands].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Commands, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCrash(message, ...) do {\ #define LogCrash(message, ...) do {\
if (LogSys.log_settings[Logs::Crash].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Crash].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogCrashDetail(message, ...) do {\ #define LogCrashDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Crash].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Crash].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Crash, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogDoors(message, ...) do {\ #define LogDoors(message, ...) do {\
if (LogSys.log_settings[Logs::Doors].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Doors].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogDoorsDetail(message, ...) do {\ #define LogDoorsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Doors].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Doors].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Doors, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogGuilds(message, ...) do {\ #define LogGuilds(message, ...) do {\
if (LogSys.log_settings[Logs::Guilds].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Guilds].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogGuildsDetail(message, ...) do {\ #define LogGuildsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Guilds].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Guilds].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Guilds, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogInventory(message, ...) do {\ #define LogInventory(message, ...) do {\
if (LogSys.log_settings[Logs::Inventory].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Inventory].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogInventoryDetail(message, ...) do {\ #define LogInventoryDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Inventory].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Inventory].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Inventory, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogLauncher(message, ...) do {\ #define LogLauncher(message, ...) do {\
if (LogSys.log_settings[Logs::Launcher].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Launcher].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogLauncherDetail(message, ...) do {\ #define LogLauncherDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Launcher].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Launcher].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Launcher, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNetcode(message, ...) do {\ #define LogNetcode(message, ...) do {\
if (LogSys.log_settings[Logs::Netcode].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Netcode].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNetcodeDetail(message, ...) do {\ #define LogNetcodeDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Netcode].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Netcode].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Netcode, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNormal(message, ...) do {\ #define LogNormal(message, ...) do {\
if (LogSys.log_settings[Logs::Normal].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Normal].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNormalDetail(message, ...) do {\ #define LogNormalDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Normal].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Normal].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Normal, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogObject(message, ...) do {\ #define LogObject(message, ...) do {\
if (LogSys.log_settings[Logs::Object].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Object].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogObjectDetail(message, ...) do {\ #define LogObjectDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Object].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Object].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Object, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogPathing(message, ...) do {\ #define LogPathing(message, ...) do {\
if (LogSys.log_settings[Logs::Pathing].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Pathing].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogPathingDetail(message, ...) do {\ #define LogPathingDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Pathing].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Pathing].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Pathing, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogQSServer(message, ...) do {\ #define LogQSServer(message, ...) do {\
if (LogSys.log_settings[Logs::QSServer].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::QSServer].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::QSServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::QSServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogQSServerDetail(message, ...) do {\ #define LogQSServerDetail(message, ...) do {\
if (LogSys.log_settings[Logs::QSServer].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::QSServer].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::QSServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::QSServer, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogQuests(message, ...) do {\ #define LogQuests(message, ...) do {\
if (LogSys.log_settings[Logs::Quests].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Quests].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogQuestsDetail(message, ...) do {\ #define LogQuestsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Quests].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Quests].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Quests, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogRules(message, ...) do {\ #define LogRules(message, ...) do {\
if (LogSys.log_settings[Logs::Rules].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Rules].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogRulesDetail(message, ...) do {\ #define LogRulesDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Rules].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Rules].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Rules, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogSkills(message, ...) do {\ #define LogSkills(message, ...) do {\
if (LogSys.log_settings[Logs::Skills].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Skills].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogSkillsDetail(message, ...) do {\ #define LogSkillsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Skills].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Skills].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Skills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogSpawns(message, ...) do {\ #define LogSpawns(message, ...) do {\
if (LogSys.log_settings[Logs::Spawns].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Spawns].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogSpawnsDetail(message, ...) do {\ #define LogSpawnsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Spawns].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Spawns].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Spawns, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogSpells(message, ...) do {\ #define LogSpells(message, ...) do {\
if (LogSys.log_settings[Logs::Spells].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Spells].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogSpellsDetail(message, ...) do {\ #define LogSpellsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Spells].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Spells].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Spells, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTCPConnection(message, ...) do {\ #define LogTCPConnection(message, ...) do {\
if (LogSys.log_settings[Logs::TCPConnection].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::TCPConnection].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::TCPConnection, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::TCPConnection, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTCPConnectionDetail(message, ...) do {\ #define LogTCPConnectionDetail(message, ...) do {\
if (LogSys.log_settings[Logs::TCPConnection].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::TCPConnection].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::TCPConnection, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::TCPConnection, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTasks(message, ...) do {\ #define LogTasks(message, ...) do {\
if (LogSys.log_settings[Logs::Tasks].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Tasks].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTasksDetail(message, ...) do {\ #define LogTasksDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Tasks].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Tasks].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Tasks, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTradeskills(message, ...) do {\ #define LogTradeskills(message, ...) do {\
if (LogSys.log_settings[Logs::Tradeskills].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Tradeskills].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTradeskillsDetail(message, ...) do {\ #define LogTradeskillsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Tradeskills].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Tradeskills].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Tradeskills, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTrading(message, ...) do {\ #define LogTrading(message, ...) do {\
if (LogSys.log_settings[Logs::Trading].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Trading].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTradingDetail(message, ...) do {\ #define LogTradingDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Trading].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Trading].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Trading, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTribute(message, ...) do {\ #define LogTribute(message, ...) do {\
if (LogSys.log_settings[Logs::Tribute].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Tribute].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTributeDetail(message, ...) do {\ #define LogTributeDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Tribute].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Tribute].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Tribute, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMySQLError(message, ...) do {\ #define LogMySQLError(message, ...) do {\
if (LogSys.log_settings[Logs::MySQLError].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::MySQLError].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMySQLErrorDetail(message, ...) do {\ #define LogMySQLErrorDetail(message, ...) do {\
if (LogSys.log_settings[Logs::MySQLError].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::MySQLError].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::MySQLError, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMySQLQuery(message, ...) do {\ #define LogMySQLQuery(message, ...) do {\
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::MySQLQuery].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMySQLQueryDetail(message, ...) do {\ #define LogMySQLQueryDetail(message, ...) do {\
if (LogSys.log_settings[Logs::MySQLQuery].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::MySQLQuery].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::MySQLQuery, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMercenaries(message, ...) do {\ #define LogMercenaries(message, ...) do {\
if (LogSys.log_settings[Logs::Mercenaries].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Mercenaries].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMercenariesDetail(message, ...) do {\ #define LogMercenariesDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Mercenaries].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Mercenaries].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Mercenaries, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogQuestDebug(message, ...) do {\ #define LogQuestDebug(message, ...) do {\
if (LogSys.log_settings[Logs::QuestDebug].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::QuestDebug].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogQuestDebugDetail(message, ...) do {\ #define LogQuestDebugDetail(message, ...) do {\
if (LogSys.log_settings[Logs::QuestDebug].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::QuestDebug].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::QuestDebug, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogLoginserver(message, ...) do {\ #define LogLoginserver(message, ...) do {\
if (LogSys.log_settings[Logs::Loginserver].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Loginserver].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogLoginserverDetail(message, ...) do {\ #define LogLoginserverDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Loginserver].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Loginserver].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Loginserver, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogClientLogin(message, ...) do {\ #define LogClientLogin(message, ...) do {\
if (LogSys.log_settings[Logs::ClientLogin].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::ClientLogin].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogClientLoginDetail(message, ...) do {\ #define LogClientLoginDetail(message, ...) do {\
if (LogSys.log_settings[Logs::ClientLogin].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::ClientLogin].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::ClientLogin, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogHeadlessClient(message, ...) do {\ #define LogHeadlessClient(message, ...) do {\
if (LogSys.log_settings[Logs::HeadlessClient].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::HeadlessClient].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::HeadlessClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::HeadlessClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogHeadlessClientDetail(message, ...) do {\ #define LogHeadlessClientDetail(message, ...) do {\
if (LogSys.log_settings[Logs::HeadlessClient].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::HeadlessClient].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::HeadlessClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::HeadlessClient, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogHPUpdate(message, ...) do {\ #define LogHPUpdate(message, ...) do {\
if (LogSys.log_settings[Logs::HPUpdate].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::HPUpdate].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogHPUpdateDetail(message, ...) do {\ #define LogHPUpdateDetail(message, ...) do {\
if (LogSys.log_settings[Logs::HPUpdate].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::HPUpdate].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::HPUpdate, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogFixZ(message, ...) do {\ #define LogFixZ(message, ...) do {\
if (LogSys.log_settings[Logs::FixZ].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::FixZ].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogFixZDetail(message, ...) do {\ #define LogFixZDetail(message, ...) do {\
if (LogSys.log_settings[Logs::FixZ].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::FixZ].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::FixZ, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogFood(message, ...) do {\ #define LogFood(message, ...) do {\
if (LogSys.log_settings[Logs::Food].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Food].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogFoodDetail(message, ...) do {\ #define LogFoodDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Food].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Food].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Food, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTraps(message, ...) do {\ #define LogTraps(message, ...) do {\
if (LogSys.log_settings[Logs::Traps].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Traps].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogTrapsDetail(message, ...) do {\ #define LogTrapsDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Traps].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Traps].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Traps, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNPCRoamBox(message, ...) do {\ #define LogNPCRoamBox(message, ...) do {\
if (LogSys.log_settings[Logs::NPCRoamBox].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::NPCRoamBox].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNPCRoamBoxDetail(message, ...) do {\ #define LogNPCRoamBoxDetail(message, ...) do {\
if (LogSys.log_settings[Logs::NPCRoamBox].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::NPCRoamBox].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::NPCRoamBox, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNPCScaling(message, ...) do {\ #define LogNPCScaling(message, ...) do {\
if (LogSys.log_settings[Logs::NPCScaling].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::NPCScaling].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogNPCScalingDetail(message, ...) do {\ #define LogNPCScalingDetail(message, ...) do {\
if (LogSys.log_settings[Logs::NPCScaling].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::NPCScaling].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::NPCScaling, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMobAppearance(message, ...) do {\ #define LogMobAppearance(message, ...) do {\
if (LogSys.log_settings[Logs::MobAppearance].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::MobAppearance].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogMobAppearanceDetail(message, ...) do {\ #define LogMobAppearanceDetail(message, ...) do {\
if (LogSys.log_settings[Logs::MobAppearance].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::MobAppearance].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::MobAppearance, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogStatus(message, ...) do {\ #define LogStatus(message, ...) do {\
if (LogSys.log_settings[Logs::Status].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Status].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Status, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Status, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogStatusDetail(message, ...) do {\ #define LogStatusDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Status].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Status].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Status, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Status, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAIScanClose(message, ...) do {\ #define LogAIScanClose(message, ...) do {\
if (LogSys.log_settings[Logs::AIScanClose].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AIScanClose].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAIScanCloseDetail(message, ...) do {\ #define LogAIScanCloseDetail(message, ...) do {\
if (LogSys.log_settings[Logs::AIScanClose].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AIScanClose].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::AIScanClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAIYellForHelp(message, ...) do {\ #define LogAIYellForHelp(message, ...) do {\
if (LogSys.log_settings[Logs::AIYellForHelp].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AIYellForHelp].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAIYellForHelpDetail(message, ...) do {\ #define LogAIYellForHelpDetail(message, ...) do {\
if (LogSys.log_settings[Logs::AIYellForHelp].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AIYellForHelp].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::AIYellForHelp, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAICastBeneficialClose(message, ...) do {\ #define LogAICastBeneficialClose(message, ...) do {\
if (LogSys.log_settings[Logs::AICastBeneficialClose].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AICastBeneficialClose].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAICastBeneficialCloseDetail(message, ...) do {\ #define LogAICastBeneficialCloseDetail(message, ...) do {\
if (LogSys.log_settings[Logs::AICastBeneficialClose].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AICastBeneficialClose].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::AICastBeneficialClose, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAoeCast(message, ...) do {\ #define LogAoeCast(message, ...) do {\
if (LogSys.log_settings[Logs::AoeCast].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AoeCast].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogAoeCastDetail(message, ...) do {\ #define LogAoeCastDetail(message, ...) do {\
if (LogSys.log_settings[Logs::AoeCast].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::AoeCast].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::AoeCast, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogEntityManagement(message, ...) do {\ #define LogEntityManagement(message, ...) do {\
if (LogSys.log_settings[Logs::EntityManagement].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::EntityManagement].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogEntityManagementDetail(message, ...) do {\ #define LogEntityManagementDetail(message, ...) do {\
if (LogSys.log_settings[Logs::EntityManagement].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::EntityManagement].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::EntityManagement, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogFlee(message, ...) do {\ #define LogFlee(message, ...) do {\
if (LogSys.log_settings[Logs::Flee].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Flee].is_category_enabled == 1)\
OutF(LogSys, Logs::General, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::General, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogFleeDetail(message, ...) do {\ #define LogFleeDetail(message, ...) do {\
if (LogSys.log_settings[Logs::Flee].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[Logs::Flee].is_category_enabled == 1)\
OutF(LogSys, Logs::Detail, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), Logs::Detail, Logs::Flee, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define Log(debug_level, log_category, message, ...) do {\ #define Log(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[log_category].is_category_enabled == 1)\
LogSys.Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ EQEmuLogSys::Get()->Out(debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#define LogF(debug_level, log_category, message, ...) do {\ #define LogF(debug_level, log_category, message, ...) do {\
if (LogSys.log_settings[log_category].is_category_enabled == 1)\ if (EQEmuLogSys::Get()->log_settings[log_category].is_category_enabled == 1)\
OutF(LogSys, debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\ OutF(EQEmuLogSys::Get(), debug_level, log_category, __FILE__, __func__, __LINE__, message, ##__VA_ARGS__);\
} while (0) } while (0)
#else #else

View File

@ -1,73 +0,0 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY except by those people which sell it, which
* are required to give you total support for your newly bought product;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "platform.h"
EQEmuExePlatform exe_platform = ExePlatformNone;
void RegisterExecutablePlatform(EQEmuExePlatform p) {
exe_platform = p;
}
const EQEmuExePlatform& GetExecutablePlatform() {
return exe_platform;
}
/**
* @return
*/
int GetExecutablePlatformInt(){
return exe_platform;
}
/**
* Returns platform name by string
*
* @return
*/
std::string GetPlatformName()
{
switch (GetExecutablePlatformInt()) {
case EQEmuExePlatform::ExePlatformWorld:
return "WorldServer";
case EQEmuExePlatform::ExePlatformQueryServ:
return "QueryServer";
case EQEmuExePlatform::ExePlatformZone:
return "ZoneServer";
case EQEmuExePlatform::ExePlatformUCS:
return "UCS";
case EQEmuExePlatform::ExePlatformLogin:
return "LoginServer";
case EQEmuExePlatform::ExePlatformSocket_Server:
return "SocketServer";
case EQEmuExePlatform::ExePlatformSharedMemory:
return "SharedMemory";
case EQEmuExePlatform::ExePlatformClientImport:
return "ClientImport";
case EQEmuExePlatform::ExePlatformClientExport:
return "ClientExport";
case EQEmuExePlatform::ExePlatformLaunch:
return "Launch";
case EQEmuExePlatform::ExePlatformHC:
return "HC";
default:
return "";
}
}

View File

@ -1,47 +0,0 @@
/**
* EQEmulator: Everquest Server Emulator
* Copyright (C) 2001-2019 EQEmulator Development Team (https://github.com/EQEmu/Server)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY except by those people which sell it, which
* are required to give you total support for your newly bought product;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#ifndef EQEMU_PLATFORM_H
#define EQEMU_PLATFORM_H
#include "iostream"
enum EQEmuExePlatform
{
ExePlatformNone = 0,
ExePlatformZone,
ExePlatformWorld,
ExePlatformLogin,
ExePlatformQueryServ,
ExePlatformSocket_Server,
ExePlatformUCS,
ExePlatformLaunch,
ExePlatformSharedMemory,
ExePlatformClientImport,
ExePlatformClientExport,
ExePlatformHC
};
void RegisterExecutablePlatform(EQEmuExePlatform p);
const EQEmuExePlatform& GetExecutablePlatform();
int GetExecutablePlatformInt();
std::string GetPlatformName();
#endif

View File

@ -21,7 +21,6 @@
#include "../common/proc_launcher.h" #include "../common/proc_launcher.h"
#include "../common/eqemu_config.h" #include "../common/eqemu_config.h"
#include "../common/servertalk.h" #include "../common/servertalk.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/unix.h" #include "../common/unix.h"
#include "worldserver.h" #include "worldserver.h"
@ -32,15 +31,12 @@
#include <signal.h> #include <signal.h>
#include <time.h> #include <time.h>
EQEmuLogSys LogSys;
bool RunLoops = false; bool RunLoops = false;
void CatchSignal(int sig_num); void CatchSignal(int sig_num);
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
RegisterExecutablePlatform(ExePlatformLaunch); EQEmuLogSys::Get()->LoadLogSettingsDefaults("eqlaunch");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
std::string launcher_name; std::string launcher_name;
@ -157,7 +153,7 @@ int main(int argc, char *argv[]) {
delete zone->second; delete zone->second;
} }
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
return 0; return 0;
} }

View File

@ -28,7 +28,7 @@ EverQuest::EverQuest(const std::string &host, int port, const std::string &user,
EQ::Net::DNSLookup(m_host, port, false, [&](const std::string &addr) { EQ::Net::DNSLookup(m_host, port, false, [&](const std::string &addr) {
if (addr.empty()) { if (addr.empty()) {
Log.OutF(Logs::General, Logs::Headless_Client, "Could not resolve address: {0}", m_host); LogError("Could not resolve address: {0}", m_host);
return; return;
} }
else { else {
@ -51,18 +51,18 @@ EverQuest::~EverQuest()
void EverQuest::LoginOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void EverQuest::LoginOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection)
{ {
m_login_connection = connection; m_login_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting..."); LogInfo("Connecting...");
} }
void EverQuest::LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void EverQuest::LoginOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "Login connected."); LogInfo("Login connected.");
LoginSendSessionReady(); LoginSendSessionReady();
} }
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "Login connection lost before we got to world, reconnecting."); LogInfo("Login connection lost before we got to world, reconnecting.");
m_key.clear(); m_key.clear();
m_dbid = 0; m_dbid = 0;
m_login_connection.reset(); m_login_connection.reset();
@ -165,14 +165,14 @@ void EverQuest::LoginProcessLoginResponse(const EQ::Net::Packet & p)
auto response_error = sp.GetUInt16(1); auto response_error = sp.GetUInt16(1);
if (response_error > 101) { if (response_error > 101) {
Log.OutF(Logs::General, Logs::Headless_Client, "Error logging in response code: {0}", response_error); LogError("Error logging in response code: {0}", response_error);
LoginDisableReconnect(); LoginDisableReconnect();
} }
else { else {
m_key = sp.GetCString(12); m_key = sp.GetCString(12);
m_dbid = sp.GetUInt32(8); m_dbid = sp.GetUInt32(8);
Log.OutF(Logs::General, Logs::Headless_Client, "Logged in successfully with dbid {0} and key {1}", m_dbid, m_key); LogInfo("Logged in successfully with dbid {0} and key {1}", m_dbid, m_key);
LoginSendServerRequest(); LoginSendServerRequest();
} }
} }
@ -214,13 +214,13 @@ void EverQuest::LoginProcessServerPacketList(const EQ::Net::Packet & p)
for (auto server : m_world_servers) { for (auto server : m_world_servers) {
if (server.second.long_name.compare(m_server) == 0) { if (server.second.long_name.compare(m_server) == 0) {
Log.OutF(Logs::General, Logs::Headless_Client, "Found world server {0}, attempting to login.", m_server); LogInfo("Found world server {0}, attempting to login.", m_server);
LoginSendPlayRequest(server.first); LoginSendPlayRequest(server.first);
return; return;
} }
} }
Log.OutF(Logs::General, Logs::Headless_Client, "Got response from login server but could not find world server {0} disconnecting.", m_server); LogError("Got response from login server but could not find world server {0} disconnecting.", m_server);
LoginDisableReconnect(); LoginDisableReconnect();
} }
@ -238,7 +238,7 @@ void EverQuest::LoginProcessServerPlayResponse(const EQ::Net::Packet &p)
} }
else { else {
auto message = p.GetUInt16(13); auto message = p.GetUInt16(13);
Log.OutF(Logs::General, Logs::Headless_Client, "Failed to login to server with message {0}"); LogError("Failed to login to server with message {0}");
LoginDisableReconnect(); LoginDisableReconnect();
} }
} }
@ -261,18 +261,18 @@ void EverQuest::ConnectToWorld()
void EverQuest::WorldOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void EverQuest::WorldOnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection)
{ {
m_world_connection = connection; m_world_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to world..."); LogInfo("Connecting to world...");
} }
void EverQuest::WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void EverQuest::WorldOnStatusChangeReconnectEnabled(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "World connected."); LogInfo("World connected.");
WorldSendClientAuth(); WorldSendClientAuth();
} }
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "World connection lost, reconnecting."); LogInfo("World connection lost, reconnecting.");
m_world_connection.reset(); m_world_connection.reset();
m_world_connection_manager->Connect(m_host, 9000); m_world_connection_manager->Connect(m_host, 9000);
} }
@ -293,7 +293,7 @@ void EverQuest::WorldOnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> c
WorldProcessCharacterSelect(p); WorldProcessCharacterSelect(p);
break; break;
default: default:
Log.OutF(Logs::General, Logs::Headless_Client, "Unhandled opcode: {0:#x}", opcode); LogDebug("Unhandled opcode: {0:#x}", opcode);
break; break;
} }
} }
@ -339,12 +339,11 @@ void EverQuest::WorldProcessCharacterSelect(const EQ::Net::Packet &p)
idx += 274; idx += 274;
if (m_character.compare(name) == 0) { if (m_character.compare(name) == 0) {
Log.OutF(Logs::General, Logs::Headless_Client, "Found {0}, would attempt to login here.", m_character); LogDebug("Found {0}, would attempt to login here.", m_character);
WorldSendEnterWorld(m_character); WorldSendEnterWorld(m_character);
return; return;
} }
} }
Log.OutF(Logs::General, Logs::Headless_Client, "Could not find {0}, cannot continue to login.", m_character); LogError("Could not find {0}, cannot continue to login.", m_character);
} }

View File

@ -1,20 +1,16 @@
#include "../common/event/event_loop.h" #include "../common/event/event_loop.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/platform.h"
#include "../common/json_config.h" #include "../common/json_config.h"
#include <thread> #include <thread>
#include "eq.h" #include "eq.h"
EQEmuLogSys Log;
int main() { int main() {
RegisterExecutablePlatform(ExePlatformHC); EQEmuLogSys::Get()->LoadLogSettingsDefaults("headless_client");
Log.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
Log.OutF(Logs::General, Logs::Headless_Client, "Starting EQEmu Headless Client."); LogInfo("Starting EQEmu Headless Client.");
auto config = EQ::JsonConfigFile::Load("hc.json"); auto config = EQ::JsonConfigFile::Load("hc.json");
auto config_handle = config.RawHandle(); auto config_handle = config.RawHandle();
@ -32,13 +28,13 @@ int main() {
auto server = c["server"].asString(); auto server = c["server"].asString();
auto character = c["character"].asString(); auto character = c["character"].asString();
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to {0}:{1} as Account '{2}' to Server '{3}' under Character '{4}'", host, port, user, server, character); LogInfo("Connecting to {0}:{1} as Account '{2}' to Server '{3}' under Character '{4}'", host, port, user, server, character);
eq_list.push_back(std::unique_ptr<EverQuest>(new EverQuest(host, port, user, pass, server, character))); eq_list.push_back(std::unique_ptr<EverQuest>(new EverQuest(host, port, user, pass, server, character)));
} }
} }
catch (std::exception &ex) { catch (std::exception &ex) {
Log.OutF(Logs::General, Logs::Headless_Client, "Error parsing config file: {0}", ex.what()); LogError("Error parsing config file: {0}", ex.what());
return 0; return 0;
} }

View File

@ -21,18 +21,18 @@ WorldConnection::~WorldConnection() {
void WorldConnection::OnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection) void WorldConnection::OnNewConnection(std::shared_ptr<EQ::Net::DaybreakConnection> connection)
{ {
m_connection = connection; m_connection = connection;
Log.OutF(Logs::General, Logs::Headless_Client, "Connecting to world..."); LogInfo("Connecting to world...");
} }
void WorldConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to) void WorldConnection::OnStatusChangeActive(std::shared_ptr<EQ::Net::DaybreakConnection> conn, EQ::Net::DbProtocolStatus from, EQ::Net::DbProtocolStatus to)
{ {
if (to == EQ::Net::StatusConnected) { if (to == EQ::Net::StatusConnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "World connected."); LogInfo("World connected.");
SendClientAuth(); SendClientAuth();
} }
if (to == EQ::Net::StatusDisconnected) { if (to == EQ::Net::StatusDisconnected) {
Log.OutF(Logs::General, Logs::Headless_Client, "World connection lost, reconnecting."); LogInfo("World connection lost, reconnecting.");
m_connection.reset(); m_connection.reset();
m_connection_manager->Connect(m_host, 9000); m_connection_manager->Connect(m_host, 9000);
} }
@ -48,7 +48,7 @@ void WorldConnection::OnStatusChangeInactive(std::shared_ptr<EQ::Net::DaybreakCo
void WorldConnection::OnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p) void WorldConnection::OnPacketRecv(std::shared_ptr<EQ::Net::DaybreakConnection> conn, const EQ::Net::Packet &p)
{ {
auto opcode = p.GetUInt16(0); auto opcode = p.GetUInt16(0);
Log.OutF(Logs::General, Logs::Headless_Client, "Packet in:\n{0}", p.ToString()); LogDebug("Packet in:\n{0}", p.ToString());
} }
void WorldConnection::Kill() void WorldConnection::Kill()

View File

@ -103,7 +103,7 @@ bool Client::Process()
break; break;
} }
default: { default: {
if (LogSys.log_settings[Logs::PacketClientServerUnhandled].is_category_enabled == 1) { if (EQEmuLogSys::Get()->log_settings[Logs::PacketClientServerUnhandled].is_category_enabled == 1) {
char dump[64]; char dump[64];
app->build_header_dump(dump); app->build_header_dump(dump);
LogError("Recieved unhandled application packet from the client: [{}]", dump); LogError("Recieved unhandled application packet from the client: [{}]", dump);

View File

@ -647,7 +647,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings *log_settings)
* 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 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[log_category_id].log_to_file > 0) { if (log_settings[log_category_id].log_to_file > 0) {
LogSys.file_logs_enabled = true; EQEmuLogSys::Get()->file_logs_enabled = true;
} }
categories_in_database[log_category_id] = 1; categories_in_database[log_category_id] = 1;

View File

@ -59,7 +59,7 @@ namespace LoginserverCommandHandler {
function_map["world-admin:create"] = &LoginserverCommandHandler::CreateLoginserverWorldAdminAccount; function_map["world-admin:create"] = &LoginserverCommandHandler::CreateLoginserverWorldAdminAccount;
function_map["world-admin:update"] = &LoginserverCommandHandler::UpdateLoginserverWorldAdminAccountPassword; function_map["world-admin:update"] = &LoginserverCommandHandler::UpdateLoginserverWorldAdminAccountPassword;
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv); EQEmuCommand::HandleMenu(function_map, cmd, "loginserver", argc, argv);
} }
/** /**

View File

@ -23,7 +23,6 @@
#include "../common/opcodemgr.h" #include "../common/opcodemgr.h"
#include "../common/event/event_loop.h" #include "../common/event/event_loop.h"
#include "../common/timer.h" #include "../common/timer.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/eqemu_logsys.h" #include "../common/eqemu_logsys.h"
#include "../common/http/httplib.h" #include "../common/http/httplib.h"
@ -36,7 +35,6 @@
#include <sstream> #include <sstream>
LoginServer server; LoginServer server;
EQEmuLogSys LogSys;
bool run_server = true; bool run_server = true;
void CatchSignal(int sig_num) void CatchSignal(int sig_num)
@ -132,27 +130,26 @@ void LoadServerConfig()
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
RegisterExecutablePlatform(ExePlatformLogin);
set_exception_handler(); set_exception_handler();
LogInfo("Logging System Init"); LogInfo("Logging System Init");
if (argc == 1) { if (argc == 1) {
LogSys.LoadLogSettingsDefaults(); EQEmuLogSys::Get()->LoadLogSettingsDefaults("loginserver");
} }
/** /**
* Command handler * Command handler
*/ */
if (argc > 1) { if (argc > 1) {
LogSys.SilenceConsoleLogging(); EQEmuLogSys::Get()->SilenceConsoleLogging();
LoadServerConfig(); LoadServerConfig();
LoadDatabaseConnection(); LoadDatabaseConnection();
LogSys.LoadLogSettingsDefaults(); EQEmuLogSys::Get()->LoadLogSettingsDefaults("loginserver");
LogSys.log_settings[Logs::Debug].log_to_console = static_cast<uint8>(Logs::General); EQEmuLogSys::Get()->log_settings[Logs::Debug].log_to_console = static_cast<uint8>(Logs::General);
LogSys.log_settings[Logs::Debug].is_category_enabled = 1; EQEmuLogSys::Get()->log_settings[Logs::Debug].is_category_enabled = 1;
LoginserverCommandHandler::CommandHandler(argc, argv); LoginserverCommandHandler::CommandHandler(argc, argv);
} }
@ -165,8 +162,8 @@ int main(int argc, char **argv)
LoadDatabaseConnection(); LoadDatabaseConnection();
if (argc == 1) { if (argc == 1) {
server.db->LoadLogSettings(LogSys.log_settings); server.db->LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
} }
/** /**
@ -214,7 +211,7 @@ int main(int argc, char **argv)
#endif #endif
LogInfo("Server Started"); LogInfo("Server Started");
if (LogSys.log_settings[Logs::Loginserver].log_to_console == 1) { if (EQEmuLogSys::Get()->log_settings[Logs::Loginserver].log_to_console == 1) {
LogInfo("Loginserver logging set to level [1] for more debugging, enable detail [3]"); LogInfo("Loginserver logging set to level [1] for more debugging, enable detail [3]");
} }

View File

@ -495,7 +495,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings *log_settings)
* 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 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[log_category_id].log_to_file > 0) { if (log_settings[log_category_id].log_to_file > 0) {
LogSys.file_logs_enabled = true; EQEmuLogSys::Get()->file_logs_enabled = true;
} }
categories_in_database[log_category_id] = 1; categories_in_database[log_category_id] = 1;

View File

@ -22,7 +22,6 @@
#include "../common/opcodemgr.h" #include "../common/opcodemgr.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/servertalk.h" #include "../common/servertalk.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/event/event_loop.h" #include "../common/event/event_loop.h"
#include "../common/timer.h" #include "../common/timer.h"
@ -40,15 +39,13 @@ LFGuildManager lfguildmanager;
std::string WorldShortName; std::string WorldShortName;
const queryservconfig *Config; const queryservconfig *Config;
WorldServer *worldserver = 0; WorldServer *worldserver = 0;
EQEmuLogSys LogSys;
void CatchSignal(int sig_num) { void CatchSignal(int sig_num) {
RunLoops = false; RunLoops = false;
} }
int main() { int main() {
RegisterExecutablePlatform(ExePlatformQueryServ); EQEmuLogSys::Get()->LoadLogSettingsDefaults("queryserv");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
Timer LFGuildExpireTimer(60000); Timer LFGuildExpireTimer(60000);
@ -75,8 +72,8 @@ int main() {
} }
/* Register Log System and Settings */ /* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
if (signal(SIGINT, CatchSignal) == SIG_ERR) { if (signal(SIGINT, CatchSignal) == SIG_ERR) {
LogInfo("Could not set signal handler"); LogInfo("Could not set signal handler");
@ -102,7 +99,7 @@ int main() {
EQ::EventLoop::Get().Process(); EQ::EventLoop::Get().Process();
Sleep(5); Sleep(5);
} }
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
} }
void UpdateWindowTitle(char* iNewTitle) { void UpdateWindowTitle(char* iNewTitle) {

View File

@ -22,7 +22,6 @@
#include "../common/global_define.h" #include "../common/global_define.h"
#include "../common/shareddb.h" #include "../common/shareddb.h"
#include "../common/eqemu_config.h" #include "../common/eqemu_config.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/eqemu_exception.h" #include "../common/eqemu_exception.h"
@ -34,8 +33,6 @@
#include "spells.h" #include "spells.h"
#include "base_data.h" #include "base_data.h"
EQEmuLogSys LogSys;
#ifdef _WINDOWS #ifdef _WINDOWS
#include <direct.h> #include <direct.h>
#else #else
@ -70,8 +67,7 @@ inline bool MakeDirectory(const std::string &directory_name)
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
RegisterExecutablePlatform(ExePlatformSharedMemory); EQEmuLogSys::Get()->LoadLogSettingsDefaults("shared_memory");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
LogInfo("Shared Memory Loader Program"); LogInfo("Shared Memory Loader Program");
@ -91,8 +87,8 @@ int main(int argc, char **argv) {
} }
/* Register Log System and Settings */ /* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
std::string shared_mem_directory = Config->SharedMemDir; std::string shared_mem_directory = Config->SharedMemDir;
if (MakeDirectory(shared_mem_directory)) { if (MakeDirectory(shared_mem_directory)) {
@ -239,6 +235,6 @@ int main(int argc, char **argv) {
} }
} }
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
return 0; return 0;
} }

View File

@ -720,7 +720,7 @@ void Database::LoadLogSettings(EQEmuLogSys::LogSettings *log_settings)
* 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 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[log_category_id].log_to_file > 0) { if (log_settings[log_category_id].log_to_file > 0) {
LogSys.file_logs_enabled = true; EQEmuLogSys::Get()->file_logs_enabled = true;
} }
categories_in_database[log_category_id] = 1; categories_in_database[log_category_id] = 1;

View File

@ -23,7 +23,6 @@
#include "../common/opcodemgr.h" #include "../common/opcodemgr.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/servertalk.h" #include "../common/servertalk.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/event/event_loop.h" #include "../common/event/event_loop.h"
#include "database.h" #include "database.h"
@ -38,7 +37,6 @@
ChatChannelList *ChannelList; ChatChannelList *ChannelList;
Clientlist *g_Clientlist; Clientlist *g_Clientlist;
EQEmuLogSys LogSys;
Database database; Database database;
WorldServer *worldserver = nullptr; WorldServer *worldserver = nullptr;
@ -63,8 +61,7 @@ std::string GetMailPrefix() {
} }
int main() { int main() {
RegisterExecutablePlatform(ExePlatformUCS); EQEmuLogSys::Get()->LoadLogSettingsDefaults("ucs");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
// Check every minute for unused channels we can delete // Check every minute for unused channels we can delete
@ -97,8 +94,8 @@ int main() {
} }
/* Register Log System and Settings */ /* Register Log System and Settings */
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
char tmp[64]; char tmp[64];
@ -162,7 +159,7 @@ int main() {
g_Clientlist->CloseAllConnections(); g_Clientlist->CloseAllConnections();
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
} }

View File

@ -40,7 +40,6 @@
#include "../common/guilds.h" #include "../common/guilds.h"
#include "../common/eq_stream_ident.h" #include "../common/eq_stream_ident.h"
#include "../common/rulesys.h" #include "../common/rulesys.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "client.h" #include "client.h"
#include "worlddb.h" #include "worlddb.h"
@ -105,7 +104,6 @@ uint32 numclients = 0;
uint32 numzones = 0; uint32 numzones = 0;
bool holdzones = false; bool holdzones = false;
const WorldConfig *Config; const WorldConfig *Config;
EQEmuLogSys LogSys;
WebInterfaceList web_interface; WebInterfaceList web_interface;
void CatchSignal(int sig_num); void CatchSignal(int sig_num);
@ -206,8 +204,7 @@ void RegisterLoginservers()
* @return * @return
*/ */
int main(int argc, char** argv) { int main(int argc, char** argv) {
RegisterExecutablePlatform(ExePlatformWorld); EQEmuLogSys::Get()->LoadLogSettingsDefaults("world");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
/** /**
@ -226,7 +223,7 @@ int main(int argc, char** argv) {
* Command handler * Command handler
*/ */
if (argc > 1) { if (argc > 1) {
LogSys.SilenceConsoleLogging(); EQEmuLogSys::Get()->SilenceConsoleLogging();
/** /**
* Get Config * Get Config
@ -239,7 +236,7 @@ int main(int argc, char** argv) {
*/ */
LoadDatabaseConnections(); LoadDatabaseConnections();
LogSys.EnableConsoleLogging(); EQEmuLogSys::Get()->EnableConsoleLogging();
WorldserverCommandHandler::CommandHandler(argc, argv); WorldserverCommandHandler::CommandHandler(argc, argv);
} }
@ -276,8 +273,8 @@ int main(int argc, char** argv) {
/** /**
* Logging * Logging
*/ */
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
/** /**
* Parse simple CLI passes * Parse simple CLI passes
@ -601,7 +598,7 @@ int main(int argc, char** argv) {
zoneserver_list.KillAll(); zoneserver_list.KillAll();
LogInfo("Zone (TCP) listener stopped"); LogInfo("Zone (TCP) listener stopped");
LogInfo("Signaling HTTP service to stop"); LogInfo("Signaling HTTP service to stop");
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
return 0; return 0;
} }

View File

@ -52,7 +52,7 @@ namespace WorldserverCommandHandler {
function_map["database:set-account-status"] = &WorldserverCommandHandler::DatabaseSetAccountStatus; function_map["database:set-account-status"] = &WorldserverCommandHandler::DatabaseSetAccountStatus;
function_map["database:schema"] = &WorldserverCommandHandler::DatabaseGetSchema; function_map["database:schema"] = &WorldserverCommandHandler::DatabaseGetSchema;
EQEmuCommand::HandleMenu(function_map, cmd, argc, argv); EQEmuCommand::HandleMenu(function_map, cmd, "world", argc, argv);
} }
/** /**

View File

@ -809,7 +809,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
} }
case ServerOP_ReloadLogs: { case ServerOP_ReloadLogs: {
zoneserver_list.SendPacket(pack); zoneserver_list.SendPacket(pack);
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
break; break;
} }
case ServerOP_ReloadRules: { case ServerOP_ReloadRules: {

View File

@ -841,9 +841,9 @@ Json::Value ApiGetLogsysCategories(EQ::Net::WebsocketServerConnection *connectio
row["log_category_id"] = i; row["log_category_id"] = i;
row["log_category_description"] = Logs::LogCategoryName[i]; row["log_category_description"] = Logs::LogCategoryName[i];
row["log_to_console"] = LogSys.log_settings[i].log_to_console; row["log_to_console"] = EQEmuLogSys::Get()->log_settings[i].log_to_console;
row["log_to_file"] = LogSys.log_settings[i].log_to_file; row["log_to_file"] = EQEmuLogSys::Get()->log_settings[i].log_to_file;
row["log_to_gmsay"] = LogSys.log_settings[i].log_to_gmsay; row["log_to_gmsay"] = EQEmuLogSys::Get()->log_settings[i].log_to_gmsay;
response.append(row); response.append(row);
} }
@ -872,15 +872,15 @@ Json::Value ApiSetLoggingLevel(EQ::Net::WebsocketServerConnection *connection, J
if (logging_category < Logs::LogCategory::MaxCategoryID && if (logging_category < Logs::LogCategory::MaxCategoryID &&
logging_category > Logs::LogCategory::None logging_category > Logs::LogCategory::None
) { ) {
LogSys.log_settings[logging_category].log_to_console = logging_level; EQEmuLogSys::Get()->log_settings[logging_category].log_to_console = logging_level;
response["status"] = "Category log level updated"; response["status"] = "Category log level updated";
} }
if (logging_level > 0) { if (logging_level > 0) {
LogSys.log_settings[logging_category].is_category_enabled = 1; EQEmuLogSys::Get()->log_settings[logging_category].is_category_enabled = 1;
} }
else { else {
LogSys.log_settings[logging_category].is_category_enabled = 0; EQEmuLogSys::Get()->log_settings[logging_category].is_category_enabled = 0;
} }
return response; return response;
@ -888,7 +888,7 @@ Json::Value ApiSetLoggingLevel(EQ::Net::WebsocketServerConnection *connection, J
void RegisterApiLogEvent(std::unique_ptr<EQ::Net::WebsocketServer> &server) void RegisterApiLogEvent(std::unique_ptr<EQ::Net::WebsocketServer> &server)
{ {
LogSys.SetConsoleHandler( EQEmuLogSys::Get()->SetConsoleHandler(
[&](uint16 debug_level, uint16 log_category, const std::string &msg) { [&](uint16 debug_level, uint16 log_category, const std::string &msg) {
Json::Value data; Json::Value data;
data["debug_level"] = debug_level; data["debug_level"] = debug_level;

View File

@ -417,16 +417,16 @@ void ClearMappedOpcode(EmuOpcode op)
// client methods // client methods
int Client::HandlePacket(const EQApplicationPacket *app) int Client::HandlePacket(const EQApplicationPacket *app)
{ {
if (LogSys.log_settings[Logs::LogCategory::Netcode].is_category_enabled == 1) { if (EQEmuLogSys::Get()->log_settings[Logs::LogCategory::Netcode].is_category_enabled == 1) {
char buffer[64]; char buffer[64];
app->build_header_dump(buffer); app->build_header_dump(buffer);
Log(Logs::Detail, Logs::PacketClientServer, "Dispatch opcode: %s", buffer); Log(Logs::Detail, Logs::PacketClientServer, "Dispatch opcode: %s", buffer);
} }
if (LogSys.log_settings[Logs::PacketClientServer].is_category_enabled == 1) if (EQEmuLogSys::Get()->log_settings[Logs::PacketClientServer].is_category_enabled == 1)
Log(Logs::General, Logs::PacketClientServer, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size()); Log(Logs::General, Logs::PacketClientServer, "[%s - 0x%04x] [Size: %u]", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size());
if (LogSys.log_settings[Logs::PacketClientServerWithDump].is_category_enabled == 1) if (EQEmuLogSys::Get()->log_settings[Logs::PacketClientServerWithDump].is_category_enabled == 1)
Log(Logs::General, Logs::PacketClientServerWithDump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str()); Log(Logs::General, Logs::PacketClientServerWithDump, "[%s - 0x%04x] [Size: %u] %s", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode(), app->Size(), DumpPacketToString(app).c_str());
EmuOpcode opcode = app->GetOpcode(); EmuOpcode opcode = app->GetOpcode();
@ -470,7 +470,7 @@ int Client::HandlePacket(const EQApplicationPacket *app)
args.push_back(const_cast<EQApplicationPacket*>(app)); args.push_back(const_cast<EQApplicationPacket*>(app));
parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args);
if (LogSys.log_settings[Logs::PacketClientServerUnhandled].is_category_enabled == 1) { if (EQEmuLogSys::Get()->log_settings[Logs::PacketClientServerUnhandled].is_category_enabled == 1) {
char buffer[64]; char buffer[64];
app->build_header_dump(buffer); app->build_header_dump(buffer);
Log(Logs::General, Logs::PacketClientServerUnhandled, "%s %s", buffer, DumpPacketToString(app).c_str()); Log(Logs::General, Logs::PacketClientServerUnhandled, "%s %s", buffer, DumpPacketToString(app).c_str());
@ -5048,7 +5048,7 @@ void Client::Handle_OP_CrashDump(const EQApplicationPacket *app)
void Client::Handle_OP_CreateObject(const EQApplicationPacket *app) void Client::Handle_OP_CreateObject(const EQApplicationPacket *app)
{ {
if (LogSys.log_settings[Logs::Inventory].is_category_enabled) if (EQEmuLogSys::Get()->log_settings[Logs::Inventory].is_category_enabled)
LogInventory("Handle_OP_CreateObject() [psize: [{}]] [{}]", app->size, DumpPacketToString(app).c_str()); LogInventory("Handle_OP_CreateObject() [psize: [{}]] [{}]", app->size, DumpPacketToString(app).c_str());
DropItem(EQEmu::invslot::slotCursor); DropItem(EQEmu::invslot::slotCursor);

View File

@ -12524,9 +12524,9 @@ void command_logs(Client *c, const Seperator *sep){
StringFormat( StringFormat(
"--- %i | %u | %u | %u | %s", "--- %i | %u | %u | %u | %s",
i, i,
LogSys.log_settings[i].log_to_console, EQEmuLogSys::Get()->log_settings[i].log_to_console,
LogSys.log_settings[i].log_to_file, EQEmuLogSys::Get()->log_settings[i].log_to_file,
LogSys.log_settings[i].log_to_gmsay, EQEmuLogSys::Get()->log_settings[i].log_to_gmsay,
Logs::LogCategoryName[i] Logs::LogCategoryName[i]
).c_str()); ).c_str());
redisplay_columns++; redisplay_columns++;
@ -12535,15 +12535,15 @@ void command_logs(Client *c, const Seperator *sep){
/* #logs set */ /* #logs set */
if (strcasecmp(sep->arg[1], "set") == 0){ if (strcasecmp(sep->arg[1], "set") == 0){
if (strcasecmp(sep->arg[2], "console") == 0){ if (strcasecmp(sep->arg[2], "console") == 0){
LogSys.log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]); EQEmuLogSys::Get()->log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]);
logs_set = 1; logs_set = 1;
} }
else if (strcasecmp(sep->arg[2], "file") == 0){ else if (strcasecmp(sep->arg[2], "file") == 0){
LogSys.log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]); EQEmuLogSys::Get()->log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]);
logs_set = 1; logs_set = 1;
} }
else if (strcasecmp(sep->arg[2], "gmsay") == 0){ else if (strcasecmp(sep->arg[2], "gmsay") == 0){
LogSys.log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]); EQEmuLogSys::Get()->log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]);
logs_set = 1; logs_set = 1;
} }
else{ else{
@ -12558,10 +12558,10 @@ void command_logs(Client *c, const Seperator *sep){
This is used in hot places of code to check if its enabled in any way before triggering logs This is used in hot places of code to check if its enabled in any way before triggering logs
*/ */
if (atoi(sep->arg[4]) > 0){ if (atoi(sep->arg[4]) > 0){
LogSys.log_settings[atoi(sep->arg[3])].is_category_enabled = 1; EQEmuLogSys::Get()->log_settings[atoi(sep->arg[3])].is_category_enabled = 1;
} }
else{ else{
LogSys.log_settings[atoi(sep->arg[3])].is_category_enabled = 0; EQEmuLogSys::Get()->log_settings[atoi(sep->arg[3])].is_category_enabled = 0;
} }
} }
} }

View File

@ -593,7 +593,7 @@ void Client::DropItem(int16 slot_id, bool recurse)
LogInventory("Error in InventoryProfile::CheckNoDrop() - returned 'true' for empty slot"); LogInventory("Error in InventoryProfile::CheckNoDrop() - returned 'true' for empty slot");
} }
else { else {
if (LogSys.log_settings[Logs::Inventory].is_category_enabled) { if (EQEmuLogSys::Get()->log_settings[Logs::Inventory].is_category_enabled) {
LogInventory("DropItem() Hack detected - full item parse:"); LogInventory("DropItem() Hack detected - full item parse:");
LogInventory("depth: 0, Item: [{}] (id: [{}]), IsDroppable: [{}]", LogInventory("depth: 0, Item: [{}] (id: [{}]), IsDroppable: [{}]",
(invalid_drop->GetItem() ? invalid_drop->GetItem()->Name : "null data"), invalid_drop->GetID(), (invalid_drop->IsDroppable(false) ? "true" : "false")); (invalid_drop->GetItem() ? invalid_drop->GetItem()->Name : "null data"), invalid_drop->GetID(), (invalid_drop->IsDroppable(false) ? "true" : "false"));
@ -619,7 +619,7 @@ void Client::DropItem(int16 slot_id, bool recurse)
// Take control of item in client inventory // Take control of item in client inventory
EQEmu::ItemInstance *inst = m_inv.PopItem(slot_id); EQEmu::ItemInstance *inst = m_inv.PopItem(slot_id);
if(inst) { if(inst) {
if (LogSys.log_settings[Logs::Inventory].is_category_enabled) { if (EQEmuLogSys::Get()->log_settings[Logs::Inventory].is_category_enabled) {
LogInventory("DropItem() Processing - full item parse:"); LogInventory("DropItem() Processing - full item parse:");
LogInventory("depth: 0, Item: [{}] (id: [{}]), IsDroppable: [{}]", LogInventory("depth: 0, Item: [{}] (id: [{}]), IsDroppable: [{}]",
(inst->GetItem() ? inst->GetItem()->Name : "null data"), inst->GetID(), (inst->IsDroppable(false) ? "true" : "false")); (inst->GetItem() ? inst->GetItem()->Name : "null data"), inst->GetID(), (inst->IsDroppable(false) ? "true" : "false"));

View File

@ -35,7 +35,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#include "../common/profanity_manager.h" #include "../common/profanity_manager.h"
#include "../common/misc_functions.h" #include "../common/misc_functions.h"
#include "../common/string_util.h" #include "../common/string_util.h"
#include "../common/platform.h"
#include "../common/crash.h" #include "../common/crash.h"
#include "../common/ipc_mutex.h" #include "../common/ipc_mutex.h"
#include "../common/memory_mapped_file.h" #include "../common/memory_mapped_file.h"
@ -106,7 +105,6 @@ QueryServ *QServ = 0;
TaskManager *taskmanager = 0; TaskManager *taskmanager = 0;
NpcScaleManager *npc_scale_manager; NpcScaleManager *npc_scale_manager;
QuestParserCollection *parse = 0; QuestParserCollection *parse = 0;
EQEmuLogSys LogSys;
const SPDat_Spell_Struct* spells; const SPDat_Spell_Struct* spells;
int32 SPDAT_RECORDS = -1; int32 SPDAT_RECORDS = -1;
const ZoneConfig *Config; const ZoneConfig *Config;
@ -119,8 +117,7 @@ void CatchSignal(int sig_num);
extern void MapOpcodes(); extern void MapOpcodes();
int main(int argc, char** argv) { int main(int argc, char** argv) {
RegisterExecutablePlatform(ExePlatformZone); EQEmuLogSys::Get()->LoadLogSettingsDefaults("zone");
LogSys.LoadLogSettingsDefaults();
set_exception_handler(); set_exception_handler();
@ -238,9 +235,9 @@ int main(int argc, char** argv) {
} }
/* Register Log System and Settings */ /* Register Log System and Settings */
LogSys.SetGMSayHandler(&Zone::GMSayHookCallBackProcess); EQEmuLogSys::Get()->SetGMSayHandler(&Zone::GMSayHookCallBackProcess);
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
LogSys.StartFileLogs(); EQEmuLogSys::Get()->StartFileLogs();
/* Guilds */ /* Guilds */
guild_mgr.SetDatabase(&database); guild_mgr.SetDatabase(&database);
@ -573,7 +570,7 @@ int main(int argc, char** argv) {
#endif #endif
safe_delete(parse); safe_delete(parse);
LogInfo("Proper zone shutdown complete."); LogInfo("Proper zone shutdown complete.");
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
return 0; return 0;
} }
@ -589,7 +586,7 @@ void Shutdown()
Zone::Shutdown(true); Zone::Shutdown(true);
RunLoops = false; RunLoops = false;
LogInfo("Shutting down..."); LogInfo("Shutting down...");
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
} }
/* Update Window Title with relevant information */ /* Update Window Title with relevant information */

View File

@ -143,7 +143,7 @@ void NpcScaleManager::ScaleNPC(NPC *npc)
npc->ModifyNPCStat("special_abilities", scale_data.special_abilities.c_str()); npc->ModifyNPCStat("special_abilities", scale_data.special_abilities.c_str());
} }
if (LogSys.log_settings[Logs::NPCScaling].is_category_enabled == 1) { if (EQEmuLogSys::Get()->log_settings[Logs::NPCScaling].is_category_enabled == 1) {
std::string scale_log; std::string scale_log;
for (const auto &stat : scaling_stats) { for (const auto &stat : scaling_stats) {

View File

@ -1813,7 +1813,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
break; break;
} }
case ServerOP_ReloadLogs: { case ServerOP_ReloadLogs: {
database.LoadLogSettings(LogSys.log_settings); database.LoadLogSettings(EQEmuLogSys::Get()->log_settings);
break; break;
} }
case ServerOP_ReloadPerlExportSettings: { case ServerOP_ReloadPerlExportSettings: {

View File

@ -161,7 +161,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) {
/* /*
* Set Logging * Set Logging
*/ */
LogSys.StartFileLogs(StringFormat("%s_version_%u_inst_id_%u_port_%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); EQEmuLogSys::Get()->StartFileLogs(StringFormat("%s_version_%u_inst_id_%u_port_%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort));
return true; return true;
} }
@ -729,7 +729,7 @@ void Zone::Shutdown(bool quiet)
parse->ReloadQuests(true); parse->ReloadQuests(true);
UpdateWindowTitle(nullptr); UpdateWindowTitle(nullptr);
LogSys.CloseFileLogs(); EQEmuLogSys::Get()->CloseFileLogs();
if (RuleB(Zone, KillProcessOnDynamicShutdown)) { if (RuleB(Zone, KillProcessOnDynamicShutdown)) {
LogInfo("[KillProcessOnDynamicShutdown] Shutting down"); LogInfo("[KillProcessOnDynamicShutdown] Shutting down");

View File

@ -299,7 +299,7 @@ public:
entity_list.MessageStatus( entity_list.MessageStatus(
0, 0,
80, 80,
LogSys.GetGMSayColorFromCategory(log_category), EQEmuLogSys::Get()->GetGMSayColorFromCategory(log_category),
"%s", "%s",
message_split[0].c_str() message_split[0].c_str()
); );
@ -308,14 +308,14 @@ public:
entity_list.MessageStatus( entity_list.MessageStatus(
0, 0,
80, 80,
LogSys.GetGMSayColorFromCategory(log_category), EQEmuLogSys::Get()->GetGMSayColorFromCategory(log_category),
"--- %s", "--- %s",
message_split[iter].c_str() message_split[iter].c_str()
); );
} }
} }
else { else {
entity_list.MessageStatus(0, 80, LogSys.GetGMSayColorFromCategory(log_category), "%s", message.c_str()); entity_list.MessageStatus(0, 80, EQEmuLogSys::Get()->GetGMSayColorFromCategory(log_category), "%s", message.c_str());
} }
} }