From 80d11d4ca99ed7f27aec2a337e7972e75e201a84 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 03:43:44 -0600 Subject: [PATCH 001/707] Added eqemu_logsys.cpp/.h --- common/CMakeLists.txt | 2 + common/eqemu_logsys.cpp | 113 ++++++++++++++++++++++++++++++++++++++++ common/eqemu_logsys.h | 55 +++++++++++++++++++ 3 files changed, 170 insertions(+) create mode 100644 common/eqemu_logsys.cpp create mode 100644 common/eqemu_logsys.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index d547c4c88..2a98f5cfb 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -19,6 +19,7 @@ SET(common_sources eqemu_exception.cpp eqemu_config.cpp eqemu_error.cpp + eqemu_logsys.cpp eq_packet.cpp eq_stream.cpp eq_stream_factory.cpp @@ -121,6 +122,7 @@ SET(common_headers eqemu_config.h eqemu_config_elements.h eqemu_error.h + eqemu_logsys.h eq_packet.h eq_stream.h eq_stream_factory.h diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp new file mode 100644 index 000000000..8b72ea804 --- /dev/null +++ b/common/eqemu_logsys.cpp @@ -0,0 +1,113 @@ +/* EQEMu: Everquest Server Emulator + Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net) + + 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 "eqemu_logsys.h" +#include "string_util.h" +#include "rulesys.h" + +#include +#include +#include +#include +#include + +std::ofstream zone_general_log; + +static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash"}; + +#ifdef _WINDOWS +#include +#include +#include +#include +#endif + +namespace Console { + enum Color { + Black = 0, + Blue = 1, + Green = 2, + Cyan = 3, + Red = 4, + Magenta = 5, + Brown = 6, + LightGray = 7, + DarkGray = 8, + LightBlue = 9, + LightGreen = 10, + LightCyan = 11, + LightRed = 12, + LightMagenta = 13, + Yellow = 14, + White = 15, + }; +} + +EQEmuLogSys::EQEmuLogSys(){ +} + +EQEmuLogSys::~EQEmuLogSys(){ +} + +void EQEmuLogSys::StartZoneLogs(const std::string log_name) +{ + _mkdir("logs/zone"); + std::cout << "Starting Zone Logs..." << std::endl; + zone_general_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); +} + +void EQEmuLogSys::WriteZoneLog(uint16 log_type, const std::string message) +{ + auto t = std::time(nullptr); + auto tm = *std::localtime(&t); + EQEmuLogSys::ConsoleMessage(log_type, message); + zone_general_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << message << std::endl; +} + +void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message){ +#ifdef _WINDOWS + HANDLE console_handle; + console_handle = GetStdHandle(STD_OUTPUT_HANDLE); + + CONSOLE_FONT_INFOEX info = { 0 }; + info.cbSize = sizeof(info); + info.dwFontSize.Y = 12; // leave X as zero + info.FontWeight = FW_NORMAL; + wcscpy(info.FaceName, L"Lucida Console"); + SetCurrentConsoleFontEx(console_handle, NULL, &info); + + if (log_type == EQEmuLogSys::LogType::Status){ SetConsoleTextAttribute(console_handle, Console::Color::Yellow); } + if (log_type == EQEmuLogSys::LogType::Error){ SetConsoleTextAttribute(console_handle, Console::Color::LightRed); } + if (log_type == EQEmuLogSys::LogType::Normal){ SetConsoleTextAttribute(console_handle, Console::Color::LightGreen); } + if (log_type == EQEmuLogSys::LogType::Debug){ SetConsoleTextAttribute(console_handle, Console::Color::Yellow); } + if (log_type == EQEmuLogSys::LogType::Quest){ SetConsoleTextAttribute(console_handle, Console::Color::LightCyan); } + if (log_type == EQEmuLogSys::LogType::Commands){ SetConsoleTextAttribute(console_handle, Console::Color::LightMagenta); } + if (log_type == EQEmuLogSys::LogType::Crash){ SetConsoleTextAttribute(console_handle, Console::Color::LightRed); } +#endif + std::cout << "[" << TypeNames[log_type] << "] " << message << std::endl; +#ifdef _WINDOWS + /* Always set back to white*/ + SetConsoleTextAttribute(console_handle, Console::Color::White); +#endif +} + +void EQEmuLogSys::CloseZoneLogs(){ + std::cout << "Closing down zone logs..." << std::endl; + zone_general_log.close(); +} \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h new file mode 100644 index 000000000..2d3498f6e --- /dev/null +++ b/common/eqemu_logsys.h @@ -0,0 +1,55 @@ +/* EQEMu: Everquest Server Emulator + Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net) + + 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_LOGSYS_H +#define EQEMU_LOGSYS_H + +#include +#include +#include "types.h" + +class EQEmuLogSys { +public: + EQEmuLogSys(); + ~EQEmuLogSys(); + + enum LogType { + Status = 0, /* This must stay the first entry in this list */ + Normal, /* Normal Logs */ + Error, /* Error Logs */ + Debug, /* Debug Logs */ + Quest, /* Quest Logs */ + Commands, /* Issued Comamnds */ + Crash, /* Crash Logs */ + Save, /* Client Saves */ + MaxLogID /* Max, used in functions to get the max log ID */ + }; + + void StartZoneLogs(const std::string log_name); + void WriteZoneLog(uint16 log_type, const std::string message); + void CloseZoneLogs(); + void ConsoleMessage(uint16 log_type, const std::string message); + +private: + bool zone_general_init = false; + +}; + +extern EQEmuLogSys log_sys; + +#endif \ No newline at end of file From 2aacc7323e32e71a1beb777f82a97d2ca59ad2ec Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 03:44:49 -0600 Subject: [PATCH 002/707] Backport logging from debug.cpp EQEmuLog::write back to EQEmuLogSys::WriteZoneLog Logs being written to logs/zone/ currently --- common/debug.cpp | 78 ++++++------------------------------------------ zone/net.cpp | 8 +++++ zone/zone.cpp | 22 ++++++++++++-- 3 files changed, 37 insertions(+), 71 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index ce56ebcbb..c7360daf7 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -44,6 +44,10 @@ namespace ConsoleColor { #include "debug.h" #include "misc_functions.h" #include "platform.h" +#include "eqemu_logsys.h" +#include "string_util.h" + +EQEmuLogSys backport_log_sys; #ifndef va_copy #define va_copy(d,s) ((d) = (s)) @@ -145,6 +149,7 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) if (id >= MaxLogID) { return false; } + bool dofile = false; if (pLogStatus[id] & 1) { dofile = open(id); @@ -156,82 +161,17 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) if (!logFileValid) { return false; //check again for threading race reasons (to avoid two mutexes) } - time_t aclock; - struct tm *newtime; - time( &aclock ); /* Get time in seconds */ - newtime = localtime( &aclock ); /* Convert time to struct */ - if (dofile) - #ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); - #else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); - #endif + va_list argptr, tmpargptr; va_start(argptr, fmt); - if (dofile) { - va_copy(tmpargptr, argptr); - vfprintf( fp[id], fmt, tmpargptr ); - } + + backport_log_sys.WriteZoneLog(id, vStringFormat(fmt, argptr).c_str()); + if (logCallbackFmt[id]) { msgCallbackFmt p = logCallbackFmt[id]; va_copy(tmpargptr, argptr); p(id, fmt, tmpargptr ); } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "[%s] ", LogNames[id]); - vfprintf( stderr, fmt, argptr ); - } - /* This is what's outputted to console */ - else { - -#ifdef _WINDOWS - HANDLE console_handle; - console_handle = GetStdHandle(STD_OUTPUT_HANDLE); - - CONSOLE_FONT_INFOEX info = { 0 }; - info.cbSize = sizeof(info); - info.dwFontSize.Y = 12; // leave X as zero - info.FontWeight = FW_NORMAL; - wcscpy(info.FaceName, L"Lucida Console"); - SetCurrentConsoleFontEx(console_handle, NULL, &info); - - if (id == EQEmuLog::LogIDs::Status){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Error){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } - if (id == EQEmuLog::LogIDs::Normal){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightGreen); } - if (id == EQEmuLog::LogIDs::Debug){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Quest){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightCyan); } - if (id == EQEmuLog::LogIDs::Commands){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightMagenta); } - if (id == EQEmuLog::LogIDs::Crash){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } -#endif - - fprintf(stdout, "[%s] ", LogNames[id]); - vfprintf( stdout, fmt, argptr ); - -#ifdef _WINDOWS - /* Always set back to white*/ - SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::White); -#endif - } - } - va_end(argptr); - if (dofile) { - fprintf(fp[id], "\n"); - } - - /* Print Lind Endings */ - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "\n"); - fflush(stderr); - } else { - fprintf(stdout, "\n"); - fflush(stdout); - } - } - if (dofile) { - fflush(fp[id]); - } return true; } diff --git a/zone/net.cpp b/zone/net.cpp index 25c770f14..b728de18f 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -43,6 +43,8 @@ #include "../common/eqemu_exception.h" #include "../common/spdat.h" +#include "../common/eqemu_logsys.h" + #include "zone_config.h" #include "masterentity.h" #include "worldserver.h" @@ -69,6 +71,7 @@ #include #include #include +#include #ifdef _CRTDBG_MAP_ALLOC #undef new @@ -100,6 +103,7 @@ TitleManager title_manager; QueryServ *QServ = 0; TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; +EQEmuLogSys log_sys; const SPDat_Spell_Struct* spells; void LoadSpells(EQEmu::MemoryMappedFile **mmf); @@ -351,6 +355,10 @@ int main(int argc, char** argv) { if (!eqsf.IsOpen() && Config->ZonePort!=0) { _log(ZONE__INIT, "Starting EQ Network server on port %d",Config->ZonePort); + + // log_sys.CloseZoneLogs(); + // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + if (!eqsf.Open(Config->ZonePort)) { _log(ZONE__INIT_ERR, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); diff --git a/zone/zone.cpp b/zone/zone.cpp index fc134a735..330b7782f 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -35,6 +35,7 @@ #include "../common/rulesys.h" #include "../common/seperator.h" #include "../common/string_util.h" +#include "../common/eqemu_logsys.h" #include "client_logs.h" #include "guild_mgr.h" @@ -52,12 +53,18 @@ #include "zone.h" #include "zone_config.h" +#include +#include +#include + #ifdef _WINDOWS #define snprintf _snprintf #define strncasecmp _strnicmp #define strcasecmp _stricmp #endif + + extern bool staticzone; extern NetConnection net; extern PetitionList petition_list; @@ -124,7 +131,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { zone->tradevar = 0; zone->lootvar = 0; } - } + } ZoneLoaded = true; @@ -132,7 +139,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { if(iInstanceID != 0) { ServerPacket *pack = new ServerPacket(ServerOP_AdventureZoneData, sizeof(uint16)); - *((uint16*)pack->pBuffer) = iInstanceID; + *((uint16*)pack->pBuffer) = iInstanceID; worldserver.SendPacket(pack); delete pack; } @@ -143,6 +150,15 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { UpdateWindowTitle(); zone->GetTimeSync(); + /* Set Logging */ + + log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + + clock_t t = std::clock(); /* Function timer start */ + uint64 i = 0; + + log_sys.WriteZoneLog(1, "This is some serious shit"); + return true; } @@ -708,6 +724,8 @@ void Zone::Shutdown(bool quite) entity_list.ClearAreas(); parse->ReloadQuests(true); UpdateWindowTitle(); + + log_sys.CloseZoneLogs(); } void Zone::LoadZoneDoors(const char* zone, int16 version) From 5b4cf79b040a0d4b7ec80e77aac3210f157f3050 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 03:56:52 -0600 Subject: [PATCH 003/707] Create console colors type map from Console::Color LogColors --- common/eqemu_logsys.cpp | 48 ++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 12 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 8b72ea804..6e666e402 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -29,8 +29,6 @@ std::ofstream zone_general_log; -static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash"}; - #ifdef _WINDOWS #include #include @@ -59,6 +57,26 @@ namespace Console { }; } +static const char* TypeNames[EQEmuLogSys::MaxLogID] = { + "Status", + "Normal", + "Error", + "Debug", + "Quest", + "Command", + "Crash" +}; +static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { + Console::Color::Yellow, // "Status", + Console::Color::LightRed, // "Normal", + Console::Color::LightGreen, // "Error", + Console::Color::Yellow, // "Debug", + Console::Color::LightCyan, // "Quest", + Console::Color::LightMagenta, // "Command", + Console::Color::LightRed // "Crash" +}; + + EQEmuLogSys::EQEmuLogSys(){ } @@ -74,13 +92,24 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) void EQEmuLogSys::WriteZoneLog(uint16 log_type, const std::string message) { + if (log_type > EQEmuLogSys::MaxLogID){ + return; + } + auto t = std::time(nullptr); auto tm = *std::localtime(&t); EQEmuLogSys::ConsoleMessage(log_type, message); - zone_general_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << message << std::endl; + + if (zone_general_log){ + zone_general_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << message << std::endl; + } } -void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message){ +void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) +{ + if (log_type > EQEmuLogSys::MaxLogID){ + return; + } #ifdef _WINDOWS HANDLE console_handle; console_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -92,15 +121,10 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message){ wcscpy(info.FaceName, L"Lucida Console"); SetCurrentConsoleFontEx(console_handle, NULL, &info); - if (log_type == EQEmuLogSys::LogType::Status){ SetConsoleTextAttribute(console_handle, Console::Color::Yellow); } - if (log_type == EQEmuLogSys::LogType::Error){ SetConsoleTextAttribute(console_handle, Console::Color::LightRed); } - if (log_type == EQEmuLogSys::LogType::Normal){ SetConsoleTextAttribute(console_handle, Console::Color::LightGreen); } - if (log_type == EQEmuLogSys::LogType::Debug){ SetConsoleTextAttribute(console_handle, Console::Color::Yellow); } - if (log_type == EQEmuLogSys::LogType::Quest){ SetConsoleTextAttribute(console_handle, Console::Color::LightCyan); } - if (log_type == EQEmuLogSys::LogType::Commands){ SetConsoleTextAttribute(console_handle, Console::Color::LightMagenta); } - if (log_type == EQEmuLogSys::LogType::Crash){ SetConsoleTextAttribute(console_handle, Console::Color::LightRed); } + SetConsoleTextAttribute(console_handle, LogColors[log_type]); + #endif - std::cout << "[" << TypeNames[log_type] << "] " << message << std::endl; + std::cout << "[(N)" << TypeNames[log_type] << "] " << message << std::endl; #ifdef _WINDOWS /* Always set back to white*/ SetConsoleTextAttribute(console_handle, Console::Color::White); From f4e33f6faa8eb333752aca97ccaf0b31bb0a4b67 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 13:34:39 -0600 Subject: [PATCH 004/707] Changed some console colors --- common/eqemu_logsys.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 6e666e402..081182386 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -27,7 +27,7 @@ #include #include -std::ofstream zone_general_log; +std::ofstream process_log; #ifdef _WINDOWS #include @@ -68,9 +68,9 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { }; static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { Console::Color::Yellow, // "Status", - Console::Color::LightRed, // "Normal", - Console::Color::LightGreen, // "Error", - Console::Color::Yellow, // "Debug", + Console::Color::Yellow, // "Normal", + Console::Color::LightRed, // "Error", + Console::Color::LightGreen, // "Debug", Console::Color::LightCyan, // "Quest", Console::Color::LightMagenta, // "Command", Console::Color::LightRed // "Crash" @@ -87,10 +87,10 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) { _mkdir("logs/zone"); std::cout << "Starting Zone Logs..." << std::endl; - zone_general_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); + process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } -void EQEmuLogSys::WriteZoneLog(uint16 log_type, const std::string message) +void EQEmuLogSys::Log(uint16 log_type, const std::string message) { if (log_type > EQEmuLogSys::MaxLogID){ return; @@ -100,8 +100,11 @@ void EQEmuLogSys::WriteZoneLog(uint16 log_type, const std::string message) auto tm = *std::localtime(&t); EQEmuLogSys::ConsoleMessage(log_type, message); - if (zone_general_log){ - zone_general_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << message << std::endl; + if (process_log){ + process_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << StringFormat("[%s] ", TypeNames[log_type]).c_str() << message << std::endl; + } + else{ + std::cout << "[DEBUG] " << " :: There currently is no log file open for this process " << std::endl; } } @@ -110,6 +113,7 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) if (log_type > EQEmuLogSys::MaxLogID){ return; } + #ifdef _WINDOWS HANDLE console_handle; console_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -124,7 +128,9 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) SetConsoleTextAttribute(console_handle, LogColors[log_type]); #endif + std::cout << "[(N)" << TypeNames[log_type] << "] " << message << std::endl; + #ifdef _WINDOWS /* Always set back to white*/ SetConsoleTextAttribute(console_handle, Console::Color::White); @@ -133,5 +139,5 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) void EQEmuLogSys::CloseZoneLogs(){ std::cout << "Closing down zone logs..." << std::endl; - zone_general_log.close(); + process_log.close(); } \ No newline at end of file From 01ca81a177d103a51c77ec8a9f353f68266a56ed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 13:35:02 -0600 Subject: [PATCH 005/707] Remove debugging and generalize the Log function --- common/debug.cpp | 2 +- common/eqemu_logsys.h | 4 +++- zone/zone.cpp | 5 ----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index c7360daf7..9bbe9d304 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -165,7 +165,7 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) va_list argptr, tmpargptr; va_start(argptr, fmt); - backport_log_sys.WriteZoneLog(id, vStringFormat(fmt, argptr).c_str()); + backport_log_sys.Log(id, vStringFormat(fmt, argptr).c_str()); if (logCallbackFmt[id]) { msgCallbackFmt p = logCallbackFmt[id]; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 2d3498f6e..d2a6c4622 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -41,7 +41,7 @@ public: }; void StartZoneLogs(const std::string log_name); - void WriteZoneLog(uint16 log_type, const std::string message); + void Log(uint16 log_type, const std::string message); void CloseZoneLogs(); void ConsoleMessage(uint16 log_type, const std::string message); @@ -52,4 +52,6 @@ private: extern EQEmuLogSys log_sys; + + #endif \ No newline at end of file diff --git a/zone/zone.cpp b/zone/zone.cpp index 330b7782f..63b673cd1 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -154,11 +154,6 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); - clock_t t = std::clock(); /* Function timer start */ - uint64 i = 0; - - log_sys.WriteZoneLog(1, "This is some serious shit"); - return true; } From b8ed29c600e04c993bba91524627684b38ee5052 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 14:37:33 -0600 Subject: [PATCH 006/707] Add RULE_CATEGORY(Logging) RULE_BOOL(Logging, ConsoleLogCommands, false) /* Turns on or off console logs */ RULE_BOOL(Logging, LogFileCommands, false) RULE_CATEGORY_END() --- common/ruletypes.h | 6 ++++++ zone/command.cpp | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/common/ruletypes.h b/common/ruletypes.h index c5a4bb562..aa9a83c72 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -596,6 +596,12 @@ RULE_CATEGORY( Client ) RULE_BOOL( Client, UseLiveFactionMessage, false) // Allows players to see faction adjustments like Live RULE_CATEGORY_END() +RULE_CATEGORY(Logging) +RULE_BOOL(Logging, ConsoleLogCommands, false) /* Turns on or off console logs */ +RULE_BOOL(Logging, LogFileCommands, false) +RULE_CATEGORY_END() + + #undef RULE_CATEGORY #undef RULE_INT #undef RULE_REAL diff --git a/zone/command.cpp b/zone/command.cpp index a0b9ae642..0a6a1b551 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -50,6 +50,7 @@ #include "../common/rulesys.h" #include "../common/serverinfo.h" #include "../common/string_util.h" +#include "../common/eqemu_logsys.h" #include "client_logs.h" #include "command.h" @@ -444,9 +445,7 @@ int command_init(void) { if ((itr=command_settings.find(cur->first))!=command_settings.end()) { cur->second->access = itr->second; -#if EQDEBUG >=5 - LogFile->write(EQEmuLog::Debug, "command_init(): - Command '%s' set to access level %d." , cur->first.c_str(), itr->second); -#endif + logger.Log(EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); } else { From 84741e4cb1edf42478ccd4357c1d14804032c2b9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 14:40:47 -0600 Subject: [PATCH 007/707] log_sys to logger enum DebugLevel { General = 0, /* 0 - Low-Level general debugging, useful info on single line */ Moderate, /* 1 - Informational based, used in functions, when particular things load */ Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) --- common/eqemu_logsys.cpp | 32 ++++++++++++++++++++++---------- common/eqemu_logsys.h | 14 +++++++++++--- zone/net.cpp | 6 +++++- zone/zone.cpp | 4 ++-- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 081182386..498526d3b 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -90,21 +90,35 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } -void EQEmuLogSys::Log(uint16 log_type, const std::string message) +void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...){ + va_list args; + va_start(args, message); + std::string output_message = vStringFormat(message.c_str(), args); + va_end(args); + EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); +} + +void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { if (log_type > EQEmuLogSys::MaxLogID){ return; } + if (!RuleB(Logging, LogFileCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } + + va_list args; + va_start(args, message); + std::string output_message = vStringFormat(message.c_str(), args); + va_end(args); auto t = std::time(nullptr); auto tm = *std::localtime(&t); EQEmuLogSys::ConsoleMessage(log_type, message); if (process_log){ - process_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << StringFormat("[%s] ", TypeNames[log_type]).c_str() << message << std::endl; + process_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << StringFormat("[%s] ", TypeNames[log_type]).c_str() << output_message << std::endl; } else{ - std::cout << "[DEBUG] " << " :: There currently is no log file open for this process " << std::endl; + std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << std::endl; } } @@ -113,23 +127,21 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) if (log_type > EQEmuLogSys::MaxLogID){ return; } + if (!RuleB(Logging, ConsoleLogCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } #ifdef _WINDOWS HANDLE console_handle; - console_handle = GetStdHandle(STD_OUTPUT_HANDLE); - + console_handle = GetStdHandle(STD_OUTPUT_HANDLE); CONSOLE_FONT_INFOEX info = { 0 }; info.cbSize = sizeof(info); info.dwFontSize.Y = 12; // leave X as zero info.FontWeight = FW_NORMAL; wcscpy(info.FaceName, L"Lucida Console"); - SetCurrentConsoleFontEx(console_handle, NULL, &info); - - SetConsoleTextAttribute(console_handle, LogColors[log_type]); - + SetCurrentConsoleFontEx(console_handle, NULL, &info); + SetConsoleTextAttribute(console_handle, LogColors[log_type]); #endif - std::cout << "[(N)" << TypeNames[log_type] << "] " << message << std::endl; + std::cout << "[N::" << TypeNames[log_type] << "] " << message << std::endl; #ifdef _WINDOWS /* Always set back to white*/ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d2a6c4622..cfeea78ce 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -40,17 +40,25 @@ public: MaxLogID /* Max, used in functions to get the max log ID */ }; - void StartZoneLogs(const std::string log_name); - void Log(uint16 log_type, const std::string message); + enum DebugLevel { + General = 0, /* 0 - Low-Level general debugging, useful info on single line */ + Moderate, /* 1 - Informational based, used in functions, when particular things load */ + Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ + }; + void CloseZoneLogs(); void ConsoleMessage(uint16 log_type, const std::string message); + void LogDebug(DebugLevel debug_level, std::string message, ...); + void Log(uint16 log_type, const std::string message, ...); + void StartZoneLogs(const std::string log_name); + private: bool zone_general_init = false; }; -extern EQEmuLogSys log_sys; +extern EQEmuLogSys logger; diff --git a/zone/net.cpp b/zone/net.cpp index b728de18f..cfd00628a 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -103,7 +103,7 @@ TitleManager title_manager; QueryServ *QServ = 0; TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; -EQEmuLogSys log_sys; +EQEmuLogSys logger; const SPDat_Spell_Struct* spells; void LoadSpells(EQEmu::MemoryMappedFile **mmf); @@ -146,6 +146,8 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } + + _log(ZONE__INIT, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { _log(ZONE__INIT_ERR, "Loading server configuration failed."); @@ -174,6 +176,8 @@ int main(int argc, char** argv) { GuildBanks = nullptr; + logger.LogDebug(EQEmuLogSys::DebugLevel::General, "This is a crazy test message, database is %s and username is %s", Config->DatabaseDB.c_str(), Config->DatabaseUsername.c_str()); + #ifdef _EQDEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif diff --git a/zone/zone.cpp b/zone/zone.cpp index 63b673cd1..b56509ee8 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -152,7 +152,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { /* Set Logging */ - log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + logger.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); return true; } @@ -720,7 +720,7 @@ void Zone::Shutdown(bool quite) parse->ReloadQuests(true); UpdateWindowTitle(); - log_sys.CloseZoneLogs(); + logger.CloseZoneLogs(); } void Zone::LoadZoneDoors(const char* zone, int16 version) From 9e4ef74dd553a3dcaa7d4e7d6aef6f570548844c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 14:59:32 -0600 Subject: [PATCH 008/707] RULE_INT(Logging, DebugLogLevel, 0) /* Sets Debug Level, -1 = OFF, 0 = Low Level, 1 = Info, 2 = Extreme */ --- common/eqemu_logsys.cpp | 5 +++++ common/ruletypes.h | 4 ++-- zone/net.cpp | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 498526d3b..3806e49e4 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -91,10 +91,15 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...){ + if (RuleI(Logging, DebugLogLevel) < debug_level){ + return; + } + va_list args; va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); + EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); } diff --git a/common/ruletypes.h b/common/ruletypes.h index aa9a83c72..1d9286a69 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -599,6 +599,7 @@ RULE_CATEGORY_END() RULE_CATEGORY(Logging) RULE_BOOL(Logging, ConsoleLogCommands, false) /* Turns on or off console logs */ RULE_BOOL(Logging, LogFileCommands, false) +RULE_INT(Logging, DebugLogLevel, 0) /* Sets Debug Level, -1 = OFF, 0 = Low Level, 1 = Info, 2 = Extreme */ RULE_CATEGORY_END() @@ -606,5 +607,4 @@ RULE_CATEGORY_END() #undef RULE_INT #undef RULE_REAL #undef RULE_BOOL -#undef RULE_CATEGORY_END - +#undef RULE_CATEGORY_END \ No newline at end of file diff --git a/zone/net.cpp b/zone/net.cpp index cfd00628a..c9fd32a00 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -176,7 +176,11 @@ int main(int argc, char** argv) { GuildBanks = nullptr; - logger.LogDebug(EQEmuLogSys::DebugLevel::General, "This is a crazy test message, database is %s and username is %s", Config->DatabaseDB.c_str(), Config->DatabaseUsername.c_str()); + logger.LogDebug(EQEmuLogSys::General, "Test, Debug Log Level 0"); + logger.LogDebug(EQEmuLogSys::Moderate, "Test, Debug Log Level 1"); + logger.LogDebug(EQEmuLogSys::Detail, "Test, Debug Log Level 2"); + + logger.LogDebug(EQEmuLogSys::General, "This is a crazy test message, database is '%s' and port is %u", Config->DatabaseDB.c_str(), Config->DatabasePort); #ifdef _EQDEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); From ebb26596308f9d883ee4e59c6e891876928e26a2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:08:30 -0600 Subject: [PATCH 009/707] Line changes --- zone/client_packet.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 61f7813e1..ea012898c 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -13855,8 +13855,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - LogFile->write(EQEmuLog::Debug, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", - app->size, sizeof(VeteranClaimRequest)); + LogFile->write(EQEmuLog::Debug, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } From dadae1a71fc088abadaec80b31dcffedad7a64aa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:26:38 -0600 Subject: [PATCH 010/707] Replaced Debug messages: LogFile->write with logger.LogDebug --- zone/aggro.cpp | 11 +-- zone/attack.cpp | 8 +- zone/bot.cpp | 2 +- zone/client.cpp | 35 ++++----- zone/client_mods.cpp | 9 ++- zone/client_packet.cpp | 163 ++++++++++++++++++++-------------------- zone/client_process.cpp | 4 +- zone/command.cpp | 4 +- zone/corpse.cpp | 7 +- zone/doors.cpp | 9 ++- zone/groups.cpp | 9 ++- zone/inventory.cpp | 3 +- zone/loottables.cpp | 4 +- zone/merc.cpp | 5 +- zone/petitions.cpp | 3 +- zone/spawngroup.cpp | 2 +- zone/spell_effects.cpp | 7 +- zone/spells.cpp | 3 +- zone/trading.cpp | 11 +-- zone/zone.cpp | 16 ++-- zone/zonedb.cpp | 24 +++--- zone/zoning.cpp | 11 +-- 22 files changed, 183 insertions(+), 167 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index b2b3881bb..0fe174a65 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/faction.h" #include "../common/rulesys.h" #include "../common/spdat.h" @@ -344,7 +345,7 @@ bool Mob::CheckWillAggro(Mob *mob) { // Aggro #if EQDEBUG>=6 - LogFile->write(EQEmuLog::Debug, "Check aggro for %s target %s.", GetName(), mob->GetName()); + logger.LogDebug(EQEmuLogSys::General, "Check aggro for %s target %s.", GetName(), mob->GetName()); #endif return( mod_will_aggro(mob, this) ); } @@ -469,7 +470,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { //Father Nitwit: make sure we can see them. if(mob->CheckLosFN(sender)) { #if (EQDEBUG>=5) - LogFile->write(EQEmuLog::Debug, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", + logger.LogDebug(EQEmuLogSys::General, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); #endif mob->AddToHateList(attacker, 1, 0, false); @@ -696,7 +697,7 @@ type', in which case, the answer is yes. } while( reverse++ == 0 ); - LogFile->write(EQEmuLog::Debug, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); + logger.LogDebug(EQEmuLogSys::General, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); return false; } @@ -836,7 +837,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) } while( reverse++ == 0 ); - LogFile->write(EQEmuLog::Debug, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); + logger.LogDebug(EQEmuLogSys::General, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); return false; } @@ -948,7 +949,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; #if LOSDEBUG>=5 - LogFile->write(EQEmuLog::Debug, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); + logger.LogDebug(EQEmuLogSys::General, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); #endif return zone->zonemap->CheckLoS(myloc, oloc); } diff --git a/zone/attack.cpp b/zone/attack.cpp index 8b9196adc..29d46d76e 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -61,7 +61,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug, "Weapon skill:%i", item->ItemType); + logger.LogDebug(EQEmuLogSys::General, "Weapon skill:%i", item->ItemType); #endif switch (item->ItemType) { @@ -192,7 +192,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += RuleR(Combat, NPCBonusHitChance); #if ATTACK_DEBUG>=11 - LogFile->write(EQEmuLog::Debug, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + logger.LogDebug(EQEmuLogSys::General, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); #endif mlog(COMBAT__TOHIT,"CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); @@ -334,7 +334,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins #if EQDEBUG>=11 - LogFile->write(EQEmuLog::Debug, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + logger.LogDebug(EQEmuLogSys::General, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); #endif // @@ -2036,7 +2036,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack { zone->DelAggroMob(); #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug,"NPC::Death() Mobs currently Aggro %i", zone->MobsAggroCount()); + logger.LogDebug(EQEmuLogSys::General,"NPC::Death() Mobs currently Aggro %i", zone->MobsAggroCount()); #endif } SetHP(0); diff --git a/zone/bot.cpp b/zone/bot.cpp index bcc9a763c..4c88a4986 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8550,7 +8550,7 @@ int32 Bot::CalcMaxMana() { } default: { - LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } diff --git a/zone/client.cpp b/zone/client.cpp index d8c24d1ba..88b729105 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -34,6 +34,7 @@ extern volatile bool RunLoops; +#include "../common/eqemu_logsys.h" #include "../common/features.h" #include "../common/spdat.h" #include "../common/guilds.h" @@ -339,7 +340,7 @@ Client::~Client() { ToggleBuyerMode(false); if(conn_state != ClientConnectFinished) { - LogFile->write(EQEmuLog::Debug, "Client '%s' was destroyed before reaching the connected state:", GetName()); + logger.LogDebug(EQEmuLogSys::General, "Client '%s' was destroyed before reaching the connected state:", GetName()); ReportConnectingState(); } @@ -437,31 +438,31 @@ void Client::SendLogoutPackets() { void Client::ReportConnectingState() { switch(conn_state) { case NoPacketsReceived: //havent gotten anything - LogFile->write(EQEmuLog::Debug, "Client has not sent us an initial zone entry packet."); + logger.LogDebug(EQEmuLogSys::General, "Client has not sent us an initial zone entry packet."); break; case ReceivedZoneEntry: //got the first packet, loading up PP - LogFile->write(EQEmuLog::Debug, "Client sent initial zone packet, but we never got their player info from the database."); + logger.LogDebug(EQEmuLogSys::General, "Client sent initial zone packet, but we never got their player info from the database."); break; case PlayerProfileLoaded: //our DB work is done, sending it - LogFile->write(EQEmuLog::Debug, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); + logger.LogDebug(EQEmuLogSys::General, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); break; case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather - LogFile->write(EQEmuLog::Debug, "We successfully sent player info and spawns, waiting for client to request new zone."); + logger.LogDebug(EQEmuLogSys::General, "We successfully sent player info and spawns, waiting for client to request new zone."); break; case NewZoneRequested: //received and sent new zone request - LogFile->write(EQEmuLog::Debug, "We received client's new zone request, waiting for client spawn request."); + logger.LogDebug(EQEmuLogSys::General, "We received client's new zone request, waiting for client spawn request."); break; case ClientSpawnRequested: //client sent ReqClientSpawn - LogFile->write(EQEmuLog::Debug, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); + logger.LogDebug(EQEmuLogSys::General, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); break; case ZoneContentsSent: //objects, doors, zone points - LogFile->write(EQEmuLog::Debug, "The rest of the zone contents were successfully sent, waiting for client ready notification."); + logger.LogDebug(EQEmuLogSys::General, "The rest of the zone contents were successfully sent, waiting for client ready notification."); break; case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc - LogFile->write(EQEmuLog::Debug, "We received client ready notification, but never finished Client::CompleteConnect"); + logger.LogDebug(EQEmuLogSys::General, "We received client ready notification, but never finished Client::CompleteConnect"); break; case ClientConnectFinished: //client finally moved to finished state, were done here - LogFile->write(EQEmuLog::Debug, "Client is successfully connected."); + logger.LogDebug(EQEmuLogSys::General, "Client is successfully connected."); break; }; } @@ -701,7 +702,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug,"Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); + logger.LogDebug(EQEmuLogSys::General,"Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); #endif if (targetname == nullptr) { @@ -2111,7 +2112,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ SaveCurrency(); - LogFile->write(EQEmuLog::Debug, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); + logger.LogDebug(EQEmuLogSys::General, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); } void Client::EVENT_ITEM_ScriptStopReturn(){ @@ -2151,7 +2152,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat SaveCurrency(); #if (EQDEBUG>=5) - LogFile->write(EQEmuLog::Debug, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", + logger.LogDebug(EQEmuLogSys::General, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); #endif } @@ -4550,14 +4551,14 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetClass() != LDON_TREASURE) { - LogFile->write(EQEmuLog::Debug, "%s tried to open %s but %s was not a treasure chest.", + logger.LogDebug(EQEmuLogSys::General, "%s tried to open %s but %s was not a treasure chest.", GetName(), target->GetName(), target->GetName()); return; } if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) { - LogFile->write(EQEmuLog::Debug, "%s tried to open %s but %s was out of range", + logger.LogDebug(EQEmuLogSys::General, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); Message(13, "Treasure chest out of range."); return; @@ -8155,7 +8156,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - LogFile->write(EQEmuLog::Debug, "Eating from slot:%i", (int)slot); + logger.LogDebug(EQEmuLogSys::General, "Eating from slot:%i", (int)slot); #endif } else @@ -8172,7 +8173,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - LogFile->write(EQEmuLog::Debug, "Drinking from slot:%i", (int)slot); + logger.LogDebug(EQEmuLogSys::General, "Drinking from slot:%i", (int)slot); #endif } } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 1a05052ad..1353b6f99 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/logsys.h" #include "../common/rulesys.h" #include "../common/spdat.h" @@ -934,7 +935,7 @@ int32 Client::CalcMaxMana() break; } default: { - LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -955,7 +956,7 @@ int32 Client::CalcMaxMana() } #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + logger.LogDebug(EQEmuLogSys::General, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1045,14 +1046,14 @@ int32 Client::CalcBaseMana() break; } default: { - LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_m = 0; break; } } #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); + logger.LogDebug(EQEmuLogSys::General, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); #endif return max_m; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index ea012898c..3d2c76a05 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -16,6 +16,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include #include @@ -415,7 +416,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) #ifdef SOLAR if(0 && opcode != OP_ClientUpdate) { - LogFile->write(EQEmuLog::Debug,"HandlePacket() OPCODE debug enabled client %s", GetName()); + logger.LogDebug(EQEmuLogSys::General,"HandlePacket() OPCODE debug enabled client %s", GetName()); std::cerr << "OPCODE: " << std::hex << std::setw(4) << std::setfill('0') << opcode << std::dec << ", size: " << app->size << std::endl; DumpPacket(app); } @@ -482,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_LINKDEAD: break; default: - LogFile->write(EQEmuLog::Debug, "Unknown client_state: %d\n", client_state); + logger.LogDebug(EQEmuLogSys::General, "Unknown client_state: %d\n", client_state); break; } @@ -1316,7 +1317,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) ClientVersionBit = 0; bool siv = m_inv.SetInventoryVersion(ClientVersion); - LogFile->write(EQEmuLog::Debug, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); + logger.LogDebug(EQEmuLogSys::General, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); /* Antighost code tmp var is so the search doesnt find this object @@ -1940,7 +1941,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) { if (app->size != sizeof(AcceptNewTask_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AcceptNewTask expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AcceptNewTask expected %i got %i", sizeof(AcceptNewTask_Struct), app->size); DumpPacket(app); return; @@ -2280,7 +2281,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Sell_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", app->size, sizeof(Adventure_Sell_Struct)); DumpPacket(app); return; @@ -2994,7 +2995,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); - LogFile->write(EQEmuLog::Debug, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); + logger.LogDebug(EQEmuLogSys::General, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); } } @@ -3009,7 +3010,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); return; } @@ -3039,7 +3040,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); return; } QueuePacket(app); @@ -3052,7 +3053,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) if (app->size != sizeof(AugmentInfo_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AugmentInfo expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); DumpPacket(app); return; @@ -3295,7 +3296,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) { if (app->size != sizeof(bool)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); DumpPacket(app); return; } @@ -3311,7 +3312,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) // Although there are three different structs for OP_Bandolier, they are all the same size. // if (app->size != sizeof(BandolierCreate_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Bandolier expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Bandolier expected %i got %i", sizeof(BandolierCreate_Struct), app->size); DumpPacket(app); return; @@ -3330,7 +3331,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) SetBandolier(app); break; default: - LogFile->write(EQEmuLog::Debug, "Uknown Bandolier action %i", bs->action); + logger.LogDebug(EQEmuLogSys::General, "Uknown Bandolier action %i", bs->action); } } @@ -3339,7 +3340,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) { if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); DumpPacket(app); return; } @@ -3424,7 +3425,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) if (app->size < 4) { - LogFile->write(EQEmuLog::Debug, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); + logger.LogDebug(EQEmuLogSys::General, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); DumpPacket(app); return; } @@ -3730,7 +3731,7 @@ void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) LogFile->write(EQEmuLog::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { - LogFile->write(EQEmuLog::Debug, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); + logger.LogDebug(EQEmuLogSys::General, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } return; @@ -3743,7 +3744,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_BlockedBuffs expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_BlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -3941,7 +3942,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTask_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_CancelTask expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_CancelTask expected %i got %i", sizeof(CancelTask_Struct), app->size); DumpPacket(app); return; @@ -4006,16 +4007,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) targetring_z = castspell->z_pos; #ifdef _EQDEBUG - LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); - LogFile->write(EQEmuLog::Debug, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); #endif - LogFile->write(EQEmuLog::Debug, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + logger.LogDebug(EQEmuLogSys::General, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; @@ -4047,7 +4048,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) //discipline, using the item spell slot if (castspell->inventoryslot == INVALID_INDEX) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { - LogFile->write(EQEmuLog::Debug, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); + logger.LogDebug(EQEmuLogSys::General, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); InterruptSpell(castspell->spell_id); } return; @@ -4190,7 +4191,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app) if (app->size != 1) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); DumpPacket(app); @@ -4212,7 +4213,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app) if (app->size != 0) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", app->size); DumpPacket(app); @@ -4718,7 +4719,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4812,7 +4813,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -5137,7 +5138,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app) if (app->size != sizeof(DelegateAbility_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_DelegateAbility expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_DelegateAbility expected %i got %i", sizeof(DelegateAbility_Struct), app->size); DumpPacket(app); @@ -5312,7 +5313,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", sizeof(DoGroupLeadershipAbility_Struct), app->size); DumpPacket(app); @@ -5364,7 +5365,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) } default: - LogFile->write(EQEmuLog::Debug, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", + logger.LogDebug(EQEmuLogSys::General, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", dglas->Ability, dglas->Parameter); break; } @@ -5930,7 +5931,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainEnd_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); DumpPacket(app); return; } @@ -6180,7 +6181,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) if (app->size < sizeof(GMSearchCorpse_Struct)) { - LogFile->write(EQEmuLog::Debug, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", + logger.LogDebug(EQEmuLogSys::General, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", app->size, sizeof(GMSearchCorpse_Struct)); DumpPacket(app); return; @@ -6303,7 +6304,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainee_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); DumpPacket(app); return; } @@ -6314,7 +6315,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) { if (app->size != sizeof(GMSkillChange_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); DumpPacket(app); return; } @@ -6448,7 +6449,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) return; } - LogFile->write(EQEmuLog::Debug, "Member Disband Request from %s\n", GetName()); + logger.LogDebug(EQEmuLogSys::General, "Member Disband Request from %s\n", GetName()); GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; @@ -6728,7 +6729,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) if (g->IsLeader(this)) g->ChangeLeader(NewLeader); else { - LogFile->write(EQEmuLog::Debug, "Group /makeleader request originated from non-leader member: %s", GetName()); + logger.LogDebug(EQEmuLogSys::General, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6819,7 +6820,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(GroupUpdate_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch on OP_GroupUpdate: got %u expected %u", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch on OP_GroupUpdate: got %u expected %u", app->size, sizeof(GroupUpdate_Struct)); DumpPacket(app); return; @@ -6838,7 +6839,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) if (group->IsLeader(this)) group->ChangeLeader(newleader); else { - LogFile->write(EQEmuLog::Debug, "Group /makeleader request originated from non-leader member: %s", GetName()); + logger.LogDebug(EQEmuLogSys::General, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6847,7 +6848,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) default: { - LogFile->write(EQEmuLog::Debug, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); + logger.LogDebug(EQEmuLogSys::General, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); DumpPacket(app); return; } @@ -7797,7 +7798,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) { if (app->size != sizeof(GuildStatus_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GuildStatus expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GuildStatus expected %i got %i", sizeof(GuildStatus_Struct), app->size); DumpPacket(app); @@ -7854,7 +7855,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) { if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", sizeof(GuildUpdateURLAndChannel_Struct), app->size); DumpPacket(app); @@ -7959,7 +7960,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app) // if (app->size != sizeof(HideCorpse_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_HideCorpse expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_HideCorpse expected %i got %i", sizeof(HideCorpse_Struct), app->size); DumpPacket(app); @@ -8465,7 +8466,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (slot_id < 0) { - LogFile->write(EQEmuLog::Debug, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); + logger.LogDebug(EQEmuLogSys::General, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); return; } @@ -8508,7 +8509,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) return; } - LogFile->write(EQEmuLog::Debug, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); + logger.LogDebug(EQEmuLogSys::General, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check { @@ -8546,7 +8547,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) { - LogFile->write(EQEmuLog::Debug, "Item with no effect right clicked by %s", GetName()); + logger.LogDebug(EQEmuLogSys::General, "Item with no effect right clicked by %s", GetName()); } else if (inst->IsType(ItemClassCommon)) { @@ -8619,7 +8620,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) { - LogFile->write(EQEmuLog::Debug, "Error: unknown item->Click.Type (%i)", item->Click.Type); + logger.LogDebug(EQEmuLogSys::General, "Error: unknown item->Click.Type (%i)", item->Click.Type); } else { @@ -8635,7 +8636,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) else if (item->ItemType == ItemTypeAlcohol) { #if EQDEBUG >= 1 - LogFile->write(EQEmuLog::Debug, "Drinking Alcohol from slot:%i", slot_id); + logger.LogDebug(EQEmuLogSys::General, "Drinking Alcohol from slot:%i", slot_id); #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); @@ -8662,7 +8663,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - LogFile->write(EQEmuLog::Debug, "Error: unknown item->Click.Type (%i)", item->Click.Type); + logger.LogDebug(EQEmuLogSys::General, "Error: unknown item->Click.Type (%i)", item->Click.Type); } } } @@ -8803,7 +8804,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) { if (app->size != 1) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -9345,7 +9346,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) if (app->size != sizeof(MercenaryCommand_Struct)) { Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; } @@ -9402,7 +9403,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); DumpPacket(app); @@ -9537,7 +9538,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app if (app->size != 0) { Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9557,7 +9558,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9582,7 +9583,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID) if (app->size != sizeof(MercenaryMerchantRequest_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); DumpPacket(app); @@ -9654,7 +9655,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) if (app->size != sizeof(SuspendMercenary_Struct)) { Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; } @@ -9678,7 +9679,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -10534,7 +10535,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) { if (app->size != sizeof(PopupResponse_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PopupResponse expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PopupResponse expected %i got %i", sizeof(PopupResponse_Struct), app->size); DumpPacket(app); return; @@ -10569,7 +10570,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) { if (app->size != sizeof(MovePotionToBelt_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PotionBelt expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PotionBelt expected %i got %i", sizeof(MovePotionToBelt_Struct), app->size); DumpPacket(app); return; @@ -10577,7 +10578,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { - LogFile->write(EQEmuLog::Debug, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); + logger.LogDebug(EQEmuLogSys::General, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); return; } @@ -10600,7 +10601,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -10690,7 +10691,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a // if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); DumpPacket(app); @@ -10717,7 +10718,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) // if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", sizeof(PVPLeaderBoardRequest_Struct), app->size); DumpPacket(app); @@ -11403,7 +11404,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; - LogFile->write(EQEmuLog::Debug, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); + logger.LogDebug(EQEmuLogSys::General, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); // results show that object_type is combiner type // some_id = 0 if world combiner, item number otherwise @@ -11464,7 +11465,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) rss->query[55] = '\0'; //just to be sure. - LogFile->write(EQEmuLog::Debug, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); + logger.LogDebug(EQEmuLogSys::General, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); // make where clause segment for container(s) char containers[30]; @@ -11524,7 +11525,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -11687,7 +11688,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) // if (app->size != 4) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_RespawnWindow expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_RespawnWindow expected %i got %i", 4, app->size); DumpPacket(app); return; @@ -11738,7 +11739,7 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) { if (app->size != sizeof(Sacrifice_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); DumpPacket(app); return; } @@ -11988,7 +11989,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) { if (app->size != sizeof(SetTitle_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); DumpPacket(app); return; } @@ -12117,7 +12118,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) t1.start(); Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; #if EQDEBUG >= 5 - LogFile->write(EQEmuLog::Debug, "%s, purchase item..", GetName()); + logger.LogDebug(EQEmuLogSys::General, "%s, purchase item..", GetName()); DumpPacket(app); #endif @@ -12853,7 +12854,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) { if (app->size != sizeof(Surname_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); return; } @@ -13168,7 +13169,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TaskHistoryRequest_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", sizeof(TaskHistoryRequest_Struct), app->size); DumpPacket(app); return; @@ -13710,7 +13711,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if (app->size != sizeof(Translocate_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); DumpPacket(app); return; } @@ -13855,7 +13856,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - LogFile->write(EQEmuLog::Debug, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); + logger.LogDebug(EQEmuLogSys::General, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } @@ -13895,7 +13896,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app) if (app->size != sizeof(VoiceMacroIn_Struct)) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_VoiceMacroIn expected %i got %i", + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_VoiceMacroIn expected %i got %i", sizeof(VoiceMacroIn_Struct), app->size); DumpPacket(app); @@ -13946,7 +13947,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app) { if (app->size != 1) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); DumpPacket(app); return; } @@ -13958,7 +13959,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) { if (app->size < 12) { - LogFile->write(EQEmuLog::Debug, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); + logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); DumpPacket(app); return; } @@ -14181,7 +14182,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) } default: - LogFile->write(EQEmuLog::Debug, "Unhandled XTarget Type %i", Type); + logger.LogDebug(EQEmuLogSys::General, "Unhandled XTarget Type %i", Type); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 6e21ecd36..e42c939b5 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -18,6 +18,8 @@ client_process.cpp: Handles client login sequence and packets sent from client to zone */ + +#include "../common/eqemu_logsys.h" #include "../common/debug.h" #include #include @@ -1035,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { // Account for merchant lists with gaps. if (ml.slot >= i) { if (ml.slot > i) - LogFile->write(EQEmuLog::Debug, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); + logger.LogDebug(EQEmuLogSys::General, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); i = ml.slot + 1; } } diff --git a/zone/command.cpp b/zone/command.cpp index 0a6a1b551..73bd705a5 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -2464,7 +2464,7 @@ void command_spawn(Client *c, const Seperator *sep) } } #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug,"#spawn Spawning:"); + logger.LogDebug(EQEmuLogSys::General,"#spawn Spawning:"); #endif NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c); @@ -4449,7 +4449,7 @@ void command_time(Client *c, const Seperator *sep) ); c->Message(13, "It is now %s.", timeMessage); #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug,"Recieved timeMessage:%s", timeMessage); + logger.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage); #endif } } diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 433fc9a66..dacc0aba1 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -29,6 +29,7 @@ Child of the Mob class. #endif #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/rulesys.h" #include "../common/string_util.h" @@ -841,7 +842,7 @@ bool Corpse::Process() { spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); - LogFile->write(EQEmuLog::Debug, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); + logger.LogDebug(EQEmuLogSys::General, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); corpse_db_id = 0; } @@ -871,7 +872,7 @@ bool Corpse::Process() { Save(); player_corpse_depop = true; corpse_db_id = 0; - LogFile->write(EQEmuLog::Debug, "Tagged %s player corpse has burried.", this->GetName()); + logger.LogDebug(EQEmuLogSys::General, "Tagged %s player corpse has burried.", this->GetName()); } else { LogFile->write(EQEmuLog::Error, "Unable to bury %s player corpse.", this->GetName()); @@ -1082,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); - LogFile->write(EQEmuLog::Debug, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); + logger.LogDebug(EQEmuLogSys::General, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); client->Message(0, "Inaccessable Corpse Item: %s", item->Name); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index a745265cf..229bb3e4c 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/string_util.h" #include "client.h" @@ -302,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); #if EQDEBUG>=5 - LogFile->write(EQEmuLog::Debug, "Client has lockpicks: skill=%f", modskill); + logger.LogDebug(EQEmuLogSys::General, "Client has lockpicks: skill=%f", modskill); #endif if(GetLockpick() <= modskill) @@ -559,13 +560,13 @@ void Doors::ToggleState(Mob *sender) } void Doors::DumpDoor(){ - LogFile->write(EQEmuLog::Debug, + logger.LogDebug(EQEmuLogSys::General, "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); - LogFile->write(EQEmuLog::Debug, + logger.LogDebug(EQEmuLogSys::General, "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); - LogFile->write(EQEmuLog::Debug, + logger.LogDebug(EQEmuLogSys::General, "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", dest_zone, dest_x, dest_y, dest_z, dest_heading); } diff --git a/zone/groups.cpp b/zone/groups.cpp index 6adc6735a..6f4ca88c2 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "masterentity.h" #include "npc_ai.h" #include "../common/packet_functions.h" @@ -1097,7 +1098,7 @@ void Group::VerifyGroup() { for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (membername[i][0] == '\0') { #if EQDEBUG >= 7 - LogFile->write(EQEmuLog::Debug, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); + logger.LogDebug(EQEmuLogSys::General, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif members[i] = nullptr; continue; @@ -1106,7 +1107,7 @@ void Group::VerifyGroup() { Mob *them = entity_list.GetMob(membername[i]); if(them == nullptr && members[i] != nullptr) { //they aren't in zone #if EQDEBUG >= 6 - LogFile->write(EQEmuLog::Debug, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); + logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; members[i] = nullptr; @@ -1115,13 +1116,13 @@ void Group::VerifyGroup() { if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 - LogFile->write(EQEmuLog::Debug, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); + logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif members[i] = them; continue; } #if EQDEBUG >= 8 - LogFile->write(EQEmuLog::Debug, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); + logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); #endif } } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 42a05e175..002883aa9 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/logsys.h" #include "../common/string_util.h" #include "quest_parser_collection.h" @@ -699,7 +700,7 @@ void Client::SendCursorBuffer() { // Remove item from inventory void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { #if (EQDEBUG >= 5) - LogFile->write(EQEmuLog::Debug, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); + logger.LogDebug(EQEmuLogSys::General, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); #endif // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. diff --git a/zone/loottables.cpp b/zone/loottables.cpp index f652cdbe0..74f347f69 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml drop_chance = zone->random.Real(0.0, 100.0); #if EQDEBUG>=11 - LogFile->write(EQEmuLog::Debug, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); + logger.LogDebug(EQEmuLogSys::General, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); #endif if (thischance == 100.0 || drop_chance < thischance) { @@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge ServerLootItem_Struct* item = new ServerLootItem_Struct; #if EQDEBUG>=11 - LogFile->write(EQEmuLog::Debug, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); + logger.LogDebug(EQEmuLogSys::General, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif EQApplicationPacket* outapp = nullptr; diff --git a/zone/merc.cpp b/zone/merc.cpp index b73c4fa0e..0ee4950ac 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -6,6 +6,7 @@ #include "groups.h" #include "mob.h" +#include "../common/eqemu_logsys.h" #include "../common/eq_packet_structs.h" #include "../common/eq_constants.h" #include "../common/skills.h" @@ -884,7 +885,7 @@ int32 Merc::CalcMaxMana() break; } default: { - LogFile->write(EQEmuLog::Debug, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -905,7 +906,7 @@ int32 Merc::CalcMaxMana() } #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Debug, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + logger.LogDebug(EQEmuLogSys::General, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 0329675d7..5843c2351 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -16,6 +16,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #ifdef _WINDOWS #include @@ -258,7 +259,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) } #if EQDEBUG >= 5 - LogFile->write(EQEmuLog::Debug, "New petition created"); + logger.LogDebug(EQEmuLogSys::General, "New petition created"); #endif } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index bb9cb8abf..d6745ed6b 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa uint32 SpawnGroup::GetNPCType() { #if EQDEBUG >= 10 - LogFile->write(EQEmuLog::Debug, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); + logger.LogDebug(EQEmuLogSys::General, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); #endif int npcType = 0; int totalchance = 0; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 70a7d3981..692856078 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "../common/eqemu_logsys.h" #include "../common/bodytypes.h" #include "../common/classes.h" #include "../common/debug.h" @@ -475,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(!target_zone) { #ifdef SPELL_EFFECT_SPAM - LogFile->write(EQEmuLog::Debug, "Succor/Evacuation Spell In Same Zone."); + logger.LogDebug(EQEmuLogSys::General, "Succor/Evacuation Spell In Same Zone."); #endif if(IsClient()) CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); @@ -484,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { #ifdef SPELL_EFFECT_SPAM - LogFile->write(EQEmuLog::Debug, "Succor/Evacuation Spell To Another Zone."); + logger.LogDebug(EQEmuLogSys::General, "Succor/Evacuation Spell To Another Zone."); #endif if(IsClient()) CastToClient()->MovePC(target_zone, x, y, z, heading); @@ -3325,7 +3326,7 @@ snare has both of them negative, yet their range should work the same: result = ubase * (caster_level * (formula - 2000) + 1); } else - LogFile->write(EQEmuLog::Debug, "Unknown spell effect value forumula %d", formula); + logger.LogDebug(EQEmuLogSys::General, "Unknown spell effect value forumula %d", formula); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index f749f062d..9db7ca8a2 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -69,6 +69,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/bodytypes.h" #include "../common/classes.h" #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/item.h" #include "../common/rulesys.h" #include "../common/skills.h" @@ -2672,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) return duration ? duration : 3600; default: - LogFile->write(EQEmuLog::Debug, "CalcBuffDuration_formula: unknown formula %d", formula); + logger.LogDebug(EQEmuLogSys::General, "CalcBuffDuration_formula: unknown formula %d", formula); return 0; } } diff --git a/zone/trading.cpp b/zone/trading.cpp index d8c67588f..b591beaec 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/rulesys.h" #include "../common/string_util.h" @@ -85,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (!owner || !owner->IsClient()) { // This should never happen - LogFile->write(EQEmuLog::Debug, "Programming error: NPC's should not call Trade::AddEntity()"); + logger.LogDebug(EQEmuLogSys::General, "Programming error: NPC's should not call Trade::AddEntity()"); return; } @@ -295,7 +296,7 @@ void Trade::LogTrade() void Trade::DumpTrade() { Mob* with = With(); - LogFile->write(EQEmuLog::Debug, "Dumping trade data: '%s' in TradeState %i with '%s'", + logger.LogDebug(EQEmuLogSys::General, "Dumping trade data: '%s' in TradeState %i with '%s'", this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) @@ -306,7 +307,7 @@ void Trade::DumpTrade() const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { - LogFile->write(EQEmuLog::Debug, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", + logger.LogDebug(EQEmuLogSys::General, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", inst->GetItem()->ID, inst->GetCharges(), i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); @@ -314,7 +315,7 @@ void Trade::DumpTrade() for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { - LogFile->write(EQEmuLog::Debug, "\tBagItem %i (Charges=%i, Slot=%i)", + logger.LogDebug(EQEmuLogSys::General, "\tBagItem %i (Charges=%i, Slot=%i)", inst->GetItem()->ID, inst->GetCharges(), Inventory::CalcSlotId(i, j)); } @@ -323,7 +324,7 @@ void Trade::DumpTrade() } } - LogFile->write(EQEmuLog::Debug, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); + logger.LogDebug(EQEmuLogSys::General, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); } #endif diff --git a/zone/zone.cpp b/zone/zone.cpp index b56509ee8..77622f7dd 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() { std::map >::iterator cur; uint32 npcid = 0; if (results.RowCount() == 0) { - LogFile->write(EQEmuLog::Debug, "No Merchant Data found for %s.", GetShortName()); + logger.LogDebug(EQEmuLogSys::General, "No Merchant Data found for %s.", GetShortName()); return; } for (auto row = results.begin(); row != results.end(); ++row) { @@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){ } if(MERC_DEBUG > 0) - LogFile->write(EQEmuLog::Debug, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); + logger.LogDebug(EQEmuLogSys::General, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); } @@ -801,10 +801,10 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); if(graveyard_id() > 0) { - LogFile->write(EQEmuLog::Debug, "Graveyard ID is %i.", graveyard_id()); + logger.LogDebug(EQEmuLogSys::General, "Graveyard ID is %i.", graveyard_id()); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); if(GraveYardLoaded) - LogFile->write(EQEmuLog::Debug, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); + logger.LogDebug(EQEmuLogSys::General, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else LogFile->write(EQEmuLog::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } @@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); Weather_Timer = new Timer(60000); Weather_Timer->Start(); - LogFile->write(EQEmuLog::Debug, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); + logger.LogDebug(EQEmuLogSys::General, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); zone_weather = 0; weather_intensity = 0; blocked_spells = nullptr; @@ -1403,11 +1403,11 @@ void Zone::ChangeWeather() weathertimer = weatherTimerRule*1000; Weather_Timer->Start(weathertimer); } - LogFile->write(EQEmuLog::Debug, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); + logger.LogDebug(EQEmuLogSys::General, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); } else { - LogFile->write(EQEmuLog::Debug, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); + logger.LogDebug(EQEmuLogSys::General, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); this->weatherSend(); } } @@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) { quest_manager.ClearAllTimers(); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) - LogFile->write(EQEmuLog::Debug, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); + logger.LogDebug(EQEmuLogSys::General, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); initgrids_timer.Start(); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index a1fdb1a76..30f570b20 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1,5 +1,5 @@ - +#include "../common/eqemu_logsys.h" #include "../common/extprofile.h" #include "../common/item.h" #include "../common/rulesys.h" @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); return true; } @@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u /* Save Home Bind Point */ std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - LogFile->write(EQEmuLog::Debug, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); + logger.LogDebug(EQEmuLogSys::General, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } @@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i uint8 blue = (color & 0x000000FF); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); return true; } bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); return true; } bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); auto results = QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); return true; } @@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); } } return true; @@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } @@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla m_epp->expended_aa ); auto results = database.QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); return true; } @@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru pp->currentEbonCrystals, pp->careerEbonCrystals); auto results = database.QueryDatabase(query); - LogFile->write(EQEmuLog::Debug, "Saving Currency for character ID: %i, done", character_id); + logger.LogDebug(EQEmuLogSys::General, "Saving Currency for character ID: %i, done", character_id); return true; } @@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur " VALUES (%u, %u, %u)", character_id, aa_id, current_level); auto results = QueryDatabase(rquery); - LogFile->write(EQEmuLog::Debug, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); + logger.LogDebug(EQEmuLogSys::General, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 9566a9a5c..1591bf0b6 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/rulesys.h" #include "../common/string_util.h" @@ -43,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { zoning = true; if (app->size != sizeof(ZoneChange_Struct)) { - LogFile->write(EQEmuLog::Debug, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); + logger.LogDebug(EQEmuLogSys::General, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); return; } #if EQDEBUG >= 5 - LogFile->write(EQEmuLog::Debug, "Zone request from %s", GetName()); + logger.LogDebug(EQEmuLogSys::General, "Zone request from %s", GetName()); DumpPacket(app); #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; @@ -192,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { switch(zone_mode) { case EvacToSafeCoords: case ZoneToSafeCoords: - LogFile->write(EQEmuLog::Debug, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); + logger.LogDebug(EQEmuLogSys::General, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); dest_x = safe_x; dest_y = safe_y; dest_z = safe_z; @@ -533,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z heading = m_pp.binds[0].heading; zonesummon_ignorerestrictions = 1; - LogFile->write(EQEmuLog::Debug, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); + logger.LogDebug(EQEmuLogSys::General, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); break; case SummonPC: zonesummon_x = x_pos = x; @@ -542,7 +543,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; case Rewind: - LogFile->write(EQEmuLog::Debug, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); + logger.LogDebug(EQEmuLogSys::General, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); zonesummon_x = x_pos = x; zonesummon_y = y_pos = y; zonesummon_z = z_pos = z; From 6844645dfb047fb38cee828d92349cd80e123b08 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:44:35 -0600 Subject: [PATCH 011/707] Replace LogFile->write(EQEmuLog::Error, with logger.logevents(EQEmuLogSys::Error --- common/database.h | 1 + zone/aa.cpp | 33 +++---- zone/attack.cpp | 10 +- zone/bot.cpp | 18 ++-- zone/client.cpp | 12 +-- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 208 ++++++++++++++++++++--------------------- zone/command.cpp | 4 +- zone/corpse.cpp | 2 +- zone/effects.cpp | 3 +- zone/embparser_api.cpp | 2 +- zone/embxs.cpp | 3 +- zone/entity.cpp | 8 +- zone/forage.cpp | 7 +- zone/groups.cpp | 24 ++--- zone/guild.cpp | 4 +- zone/horse.cpp | 7 +- zone/inventory.cpp | 6 +- zone/merc.cpp | 6 +- zone/net.cpp | 2 +- zone/npc.cpp | 18 ++-- zone/object.cpp | 8 +- zone/pathing.cpp | 10 +- zone/petitions.cpp | 8 +- zone/pets.cpp | 16 ++-- zone/questmgr.cpp | 4 +- zone/raids.cpp | 18 ++-- zone/spawn2.cpp | 22 ++--- zone/spell_effects.cpp | 2 +- zone/spells.cpp | 14 +-- zone/tasks.cpp | 66 ++++++------- zone/titles.cpp | 12 +-- zone/tradeskills.cpp | 64 ++++++------- zone/trading.cpp | 2 +- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 46 ++++----- zone/zone.cpp | 62 ++++++------ zone/zonedb.cpp | 54 +++++------ zone/zoning.cpp | 24 ++--- 40 files changed, 415 insertions(+), 409 deletions(-) diff --git a/common/database.h b/common/database.h index 5be342482..f45b83600 100644 --- a/common/database.h +++ b/common/database.h @@ -22,6 +22,7 @@ #define INVALID_ID 0xFFFFFFFF #include "debug.h" +#include "eqemu_logsys.h" #include "types.h" #include "dbcore.h" #include "linked_list.h" diff --git a/zone/aa.cpp b/zone/aa.cpp index 9aba83bbd..b3f626b93 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -18,6 +18,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) #include "../common/classes.h" #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/eq_packet_structs.h" #include "../common/races.h" #include "../common/spdat.h" @@ -444,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - LogFile->write(EQEmuLog::Error, "Unknown AA nonspell action type %d", caa->action); + logger.Log(EQEmuLogSys::Error,"Unknown AA nonspell action type %d", caa->action); return; } @@ -500,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - LogFile->write(EQEmuLog::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); + logger.Log(EQEmuLogSys::Error,"Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -527,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - LogFile->write(EQEmuLog::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); + logger.Log(EQEmuLogSys::Error,"Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -624,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - LogFile->write(EQEmuLog::Error, "Unknown npc type for swarm pet type id: %d", typesid); + logger.Log(EQEmuLogSys::Error,"Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -1431,7 +1432,7 @@ void Zone::LoadAAs() { LogFile->write(EQEmuLog::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - LogFile->write(EQEmuLog::Error, "Failed to load AAs!"); + logger.Log(EQEmuLogSys::Error,"Failed to load AAs!"); aas = nullptr; return; } @@ -1450,7 +1451,7 @@ void Zone::LoadAAs() { if (database.LoadAAEffects2()) LogFile->write(EQEmuLog::Status, "Loaded %d AA Effects.", aa_effects.size()); else - LogFile->write(EQEmuLog::Error, "Failed to load AA Effects!"); + logger.Log(EQEmuLogSys::Error,"Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1459,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - LogFile->write(EQEmuLog::Error, "Error loading AA Effects, none found in the database."); + logger.Log(EQEmuLogSys::Error,"Error loading AA Effects, none found in the database."); return false; } @@ -1801,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1840,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1894,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1911,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1944,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1969,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1989,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/attack.cpp b/zone/attack.cpp index 29d46d76e..59cc0216b 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1135,7 +1135,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Client::Attack() for evaluation!"); return false; } @@ -1699,7 +1699,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -3896,7 +3896,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3927,7 +3927,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } @@ -4476,7 +4476,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 4c88a4986..e0cf89601 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + logger.Log(EQEmuLogSys::Error,"Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Bot::LoadAAs()"); + logger.Log(EQEmuLogSys::Error,"Error in Bot::LoadAAs()"); return; } @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - LogFile->write(EQEmuLog::Error, "Error in Bot::LoadStance()"); + logger.Log(EQEmuLogSys::Error,"Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in Bot::SaveStance()"); + logger.Log(EQEmuLogSys::Error,"Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Bot::LoadTimers()"); + logger.Log(EQEmuLogSys::Error,"Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - LogFile->write(EQEmuLog::Error, "Error in Bot::SaveTimers()"); + logger.Log(EQEmuLogSys::Error,"Error in Bot::SaveTimers()"); } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - LogFile->write(EQEmuLog::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + logger.Log(EQEmuLogSys::Error,"Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - LogFile->write(EQEmuLog::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + logger.Log(EQEmuLogSys::Error,"Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -6017,7 +6017,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Bot::Attack for evaluation!"); return false; } diff --git a/zone/client.cpp b/zone/client.cpp index 88b729105..41c2a6134 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5301,7 +5301,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5369,7 +5369,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5396,7 +5396,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5404,7 +5404,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6218,7 +6218,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - LogFile->write(EQEmuLog::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); + logger.Log(EQEmuLogSys::Error,"Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6232,7 +6232,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - LogFile->write(EQEmuLog::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); + logger.Log(EQEmuLogSys::Error,"Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 1353b6f99..a2cd7eefb 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - LogFile->write(EQEmuLog::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + logger.Log(EQEmuLogSys::Error,"Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 3d2c76a05..721e7e836 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - LogFile->write(EQEmuLog::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + logger.Log(EQEmuLogSys::Error,"HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - LogFile->write(EQEmuLog::Error, "Client error: %s", error->character_name); - LogFile->write(EQEmuLog::Error, "Error message: %s", error->message); + logger.Log(EQEmuLogSys::Error,"Client error: %s", error->character_name); + logger.Log(EQEmuLogSys::Error,"Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized OP_SetServerFilter"); + logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - LogFile->write(EQEmuLog::Error, "Invalid size on OP_TGB: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1324,7 +1324,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - LogFile->write(EQEmuLog::Error, "GetAuth() returned false kicking client"); + logger.Log(EQEmuLogSys::Error,"GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - LogFile->write(EQEmuLog::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + logger.Log(EQEmuLogSys::Error,"Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1956,7 +1956,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - LogFile->write(EQEmuLog::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); + logger.Log(EQEmuLogSys::Error,"Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2011,7 +2011,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2191,7 +2191,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2413,7 +2413,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "Handle_OP_AdventureRequest had a packet that was too small."); + logger.Log(EQEmuLogSys::Error,"Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2939,7 +2939,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized " + logger.Log(EQEmuLogSys::Error,"Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2958,7 +2958,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -3072,7 +3072,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3229,7 +3229,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3581,7 +3581,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3637,7 +3637,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) } else { _log(TRADING__CLIENT, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - LogFile->write(EQEmuLog::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); + logger.Log(EQEmuLogSys::Error,"Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3722,13 +3722,13 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - LogFile->write(EQEmuLog::Error, "Size mismatch for Bind wound packet"); + logger.Log(EQEmuLogSys::Error,"Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - LogFile->write(EQEmuLog::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); + logger.Log(EQEmuLogSys::Error,"Bindwound on non-exsistant mob from %s", this->GetName()); } else { logger.LogDebug(EQEmuLogSys::General, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); @@ -3839,7 +3839,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - LogFile->write(EQEmuLog::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + logger.Log(EQEmuLogSys::Error,"Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3860,7 +3860,7 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - LogFile->write(EQEmuLog::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } @@ -3956,7 +3956,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4235,7 +4235,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4260,7 +4260,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4311,7 +4311,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4324,11 +4324,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - LogFile->write(EQEmuLog::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); + logger.Log(EQEmuLogSys::Error,"Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - LogFile->write(EQEmuLog::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); + logger.Log(EQEmuLogSys::Error,"Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4345,8 +4345,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - LogFile->write(EQEmuLog::Error, "Client error: %s", error->character_name); - LogFile->write(EQEmuLog::Error, "Error message:%s", error->message); + logger.Log(EQEmuLogSys::Error,"Client error: %s", error->character_name); + logger.Log(EQEmuLogSys::Error,"Error message:%s", error->message); return; } @@ -4367,7 +4367,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4873,7 +4873,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4910,7 +4910,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - LogFile->write(EQEmuLog::Error, "Consuming from empty slot %d", pcs->slot); + logger.Log(EQEmuLogSys::Error,"Consuming from empty slot %d", pcs->slot); return; } @@ -4922,7 +4922,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - LogFile->write(EQEmuLog::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); + logger.Log(EQEmuLogSys::Error,"OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4943,7 +4943,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5099,7 +5099,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, + logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5447,7 +5447,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized " + logger.Log(EQEmuLogSys::Error,"Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5538,7 +5538,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5593,7 +5593,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5862,7 +5862,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5914,7 +5914,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5947,7 +5947,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6012,7 +6012,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6062,7 +6062,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6129,7 +6129,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6383,7 +6383,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6400,7 +6400,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6444,7 +6444,7 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6591,7 +6591,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - LogFile->write(EQEmuLog::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + logger.Log(EQEmuLogSys::Error,"Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6611,7 +6611,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6660,7 +6660,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6738,7 +6738,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6774,7 +6774,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6868,7 +6868,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -7989,7 +7989,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, + logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8019,7 +8019,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8074,7 +8074,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8088,7 +8088,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8125,7 +8125,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - LogFile->write(EQEmuLog::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8225,7 +8225,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8240,7 +8240,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8438,7 +8438,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8891,7 +8891,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9051,7 +9051,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9088,7 +9088,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - LogFile->write(EQEmuLog::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); + logger.Log(EQEmuLogSys::Error,"Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9113,7 +9113,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9169,7 +9169,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9717,7 +9717,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - LogFile->write(EQEmuLog::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9733,7 +9733,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9875,7 +9875,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9888,7 +9888,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10351,7 +10351,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10395,7 +10395,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10465,7 +10465,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - LogFile->write(EQEmuLog::Error, "Size mismatch for Pick Pocket packet"); + logger.Log(EQEmuLogSys::Error,"Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10739,7 +10739,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11324,7 +11324,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11353,7 +11353,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11369,7 +11369,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11383,7 +11383,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - LogFile->write(EQEmuLog::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11397,7 +11397,7 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } @@ -11456,7 +11456,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11746,7 +11746,7 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - LogFile->write(EQEmuLog::Error, "Unexpected OP_Sacrifice reply"); + logger.Log(EQEmuLogSys::Error,"Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11790,7 +11790,7 @@ void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - LogFile->write(EQEmuLog::Error, "Invalid size on OP_SelectTribute packet"); + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - LogFile->write(EQEmuLog::Error, "Received invalid sized " + logger.Log(EQEmuLogSys::Error,"Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11924,7 +11924,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11938,7 +11938,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "No valid start zones found for /setstartcity"); + logger.Log(EQEmuLogSys::Error,"No valid start zones found for /setstartcity"); return; } @@ -12013,7 +12013,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12110,7 +12110,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12278,7 +12278,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - LogFile->write(EQEmuLog::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + logger.Log(EQEmuLogSys::Error,"OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12368,7 +12368,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12524,7 +12524,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12817,7 +12817,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12944,7 +12944,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - LogFile->write(EQEmuLog::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + logger.Log(EQEmuLogSys::Error,"OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13222,7 +13222,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - LogFile->write(EQEmuLog::Error, "Unable to generate OP_Track packet requested by client."); + logger.Log(EQEmuLogSys::Error,"Unable to generate OP_Track packet requested by client."); return; } @@ -13236,7 +13236,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13389,7 +13389,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13535,7 +13535,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) _log(TRADING__CLIENT, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - LogFile->write(EQEmuLog::Error, "Unknown TraderStruct code of: %i\n", ints->Code); + logger.Log(EQEmuLogSys::Error,"Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13545,7 +13545,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } else { _log(TRADING__CLIENT, "Unknown size for OP_Trader: %i\n", app->size); - LogFile->write(EQEmuLog::Error, "Unknown size for OP_Trader: %i\n", app->size); + logger.Log(EQEmuLogSys::Error,"Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13583,7 +13583,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13619,7 +13619,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - LogFile->write(EQEmuLog::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + logger.Log(EQEmuLogSys::Error,"Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13690,7 +13690,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - LogFile->write(EQEmuLog::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error,"Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13829,7 +13829,7 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - LogFile->write(EQEmuLog::Error, "Invalid size on OP_TributeToggle packet"); + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13844,7 +13844,7 @@ void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - LogFile->write(EQEmuLog::Error, "Invalid size on OP_TributeUpdate packet"); + logger.Log(EQEmuLogSys::Error,"Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); diff --git a/zone/command.cpp b/zone/command.cpp index 73bd705a5..f5b4419a0 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -496,7 +496,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - LogFile->write(EQEmuLog::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + logger.Log(EQEmuLogSys::Error,"command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -575,7 +575,7 @@ int command_realdispatch(Client *c, const char *message) #endif if(cur->function == nullptr) { - LogFile->write(EQEmuLog::Error, "Command '%s' has a null function\n", cstr.c_str()); + logger.Log(EQEmuLogSys::Error,"Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command diff --git a/zone/corpse.cpp b/zone/corpse.cpp index dacc0aba1..f6a193bc9 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -875,7 +875,7 @@ bool Corpse::Process() { logger.LogDebug(EQEmuLogSys::General, "Tagged %s player corpse has burried.", this->GetName()); } else { - LogFile->write(EQEmuLog::Error, "Unable to bury %s player corpse.", this->GetName()); + logger.Log(EQEmuLogSys::Error,"Unable to bury %s player corpse.", this->GetName()); return true; } } diff --git a/zone/effects.cpp b/zone/effects.cpp index ec463bddf..bd1fa7a54 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/spdat.h" #include "client.h" @@ -460,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - LogFile->write(EQEmuLog::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); + logger.Log(EQEmuLogSys::Error,"Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index e75575b7c..1a51ede27 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - LogFile->write(EQEmuLog::Error, "boot_quest does not take any arguments."); + logger.Log(EQEmuLogSys::Error,"boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 11b444ef0..33cc53377 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -18,6 +18,7 @@ #ifdef EMBPERL #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "masterentity.h" #include "command.h" @@ -63,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - LogFile->write(EQEmuLog::Error, "boot_qc does not take any arguments."); + logger.Log(EQEmuLogSys::Error,"boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/entity.cpp b/zone/entity.cpp index d5e5774ca..c2d19d11a 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - LogFile->write(EQEmuLog::Error, "nullptr group, %s:%i", fname, fline); + logger.Log(EQEmuLogSys::Error,"nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - LogFile->write(EQEmuLog::Error, "About to delete a client still in a group."); + logger.Log(EQEmuLogSys::Error,"About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - LogFile->write(EQEmuLog::Error, "About to delete a client still in a raid."); + logger.Log(EQEmuLogSys::Error,"About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - LogFile->write(EQEmuLog::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + logger.Log(EQEmuLogSys::Error,"Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); diff --git a/zone/forage.cpp b/zone/forage.cpp index 6704e9b45..64318ec48 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/misc_functions.h" #include "../common/rulesys.h" #include "../common/string_util.h" @@ -58,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -69,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - LogFile->write(EQEmuLog::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); + logger.Log(EQEmuLogSys::Error,"Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -388,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - LogFile->write(EQEmuLog::Error, "nullptr returned from database.GetItem in ClientForageItem"); + logger.Log(EQEmuLogSys::Error,"nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index 6f4ca88c2..dfd36602b 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - LogFile->write(EQEmuLog::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index 39785f3dd..fcc57bc86 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -413,7 +413,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -433,7 +433,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/horse.cpp b/zone/horse.cpp index 044c64e15..98b9ab91e 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/linked_list.h" #include "../common/string_util.h" @@ -72,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - LogFile->write(EQEmuLog::Error, "No Database entry for mount: %s, check the horses table", fileName); + logger.Log(EQEmuLogSys::Error,"No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -120,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - LogFile->write(EQEmuLog::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + logger.Log(EQEmuLogSys::Error,"%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 002883aa9..a934a56ae 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - LogFile->write(EQEmuLog::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.Log(EQEmuLogSys::Error,"Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - LogFile->write(EQEmuLog::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + logger.Log(EQEmuLogSys::Error,"Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - LogFile->write(EQEmuLog::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + logger.Log(EQEmuLogSys::Error,"Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } diff --git a/zone/merc.cpp b/zone/merc.cpp index 0ee4950ac..a6143c83c 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - LogFile->write(EQEmuLog::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); + logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in NPC::LoadMercTypes()"); + logger.Log(EQEmuLogSys::Error,"Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in NPC::LoadMercTypes()"); + logger.Log(EQEmuLogSys::Error,"Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/net.cpp b/zone/net.cpp index c9fd32a00..d451521df 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -625,7 +625,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "Error loading spells: %s", ex.what()); + logger.Log(EQEmuLogSys::Error,"Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 479a3d5a7..516d5b3d6 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - LogFile->write(EQEmuLog::Error, "Database error, invalid item"); + logger.Log(EQEmuLogSys::Error,"Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/object.cpp b/zone/object.cpp index c8bde8f1f..9545caf19 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - LogFile->write(EQEmuLog::Error, "Object::PutItem: Invalid index specified (%i)", index); + logger.Log(EQEmuLogSys::Error,"Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index ed969b0ff..f5e1603e8 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -66,14 +66,14 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) } else { - LogFile->write(EQEmuLog::Error, "Path File %s failed to load.", ZonePathFileName); + logger.Log(EQEmuLogSys::Error,"Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - LogFile->write(EQEmuLog::Error, "Path File %s not found.", ZonePathFileName); + logger.Log(EQEmuLogSys::Error,"Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,7 +103,7 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - LogFile->write(EQEmuLog::Error, "Bad Magic String in .path file."); + logger.Log(EQEmuLogSys::Error,"Bad Magic String in .path file."); return false; } @@ -114,7 +114,7 @@ bool PathManager::loadPaths(FILE *PathFile) if(Head.version != 2) { - LogFile->write(EQEmuLog::Error, "Unsupported path file version."); + logger.Log(EQEmuLogSys::Error,"Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - LogFile->write(EQEmuLog::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + logger.Log(EQEmuLogSys::Error,"Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 5843c2351..b0932bccb 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,7 +254,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index eb120d619..b75670ad0 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - LogFile->write(EQEmuLog::Error, "Unable to find data for pet %s, check pets table.", pettype); + logger.Log(EQEmuLogSys::Error,"Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - LogFile->write(EQEmuLog::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + logger.Log(EQEmuLogSys::Error,"Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - LogFile->write(EQEmuLog::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - LogFile->write(EQEmuLog::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + logger.Log(EQEmuLogSys::Error,"Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - LogFile->write(EQEmuLog::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); + logger.Log(EQEmuLogSys::Error,"Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 1dd219032..09fce9c70 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - LogFile->write(EQEmuLog::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } diff --git a/zone/raids.cpp b/zone/raids.cpp index b01d169fd..17b000ff4 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - LogFile->write(EQEmuLog::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - LogFile->write(EQEmuLog::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index f96c9872a..e5f955e95 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - LogFile->write(EQEmuLog::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - LogFile->write(EQEmuLog::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); + logger.Log(EQEmuLogSys::Error,"Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 692856078..2203b1be4 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - LogFile->write(EQEmuLog::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + logger.Log(EQEmuLogSys::Error,"%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index 9db7ca8a2..5b6c88551 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - LogFile->write(EQEmuLog::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + logger.Log(EQEmuLogSys::Error,"HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - LogFile->write(EQEmuLog::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + logger.Log(EQEmuLogSys::Error,"HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - LogFile->write(EQEmuLog::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + logger.Log(EQEmuLogSys::Error,"HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + logger.Log(EQEmuLogSys::Error,"Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - LogFile->write(EQEmuLog::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + logger.Log(EQEmuLogSys::Error,"Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - LogFile->write(EQEmuLog::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + logger.Log(EQEmuLogSys::Error,"Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index d6f285de6..15ae8666e 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - LogFile->write(EQEmuLog::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - LogFile->write(EQEmuLog::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " + logger.Log(EQEmuLogSys::Error,"[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - LogFile->write(EQEmuLog::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - LogFile->write(EQEmuLog::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -323,7 +323,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -362,7 +362,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -466,7 +466,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - LogFile->write(EQEmuLog::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - LogFile->write(EQEmuLog::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); + logger.Log(EQEmuLogSys::Error,"[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - LogFile->write(EQEmuLog::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - LogFile->write(EQEmuLog::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - LogFile->write(EQEmuLog::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - LogFile->write(EQEmuLog::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - LogFile->write(EQEmuLog::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - LogFile->write(EQEmuLog::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - LogFile->write(EQEmuLog::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,7 +634,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - LogFile->write(EQEmuLog::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + logger.Log(EQEmuLogSys::Error,"[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - LogFile->write(EQEmuLog::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " + logger.Log(EQEmuLogSys::Error,"[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -725,7 +725,7 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { _log(TASKS__UPDATE, "Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -774,7 +774,7 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) { _log(TASKS__UPDATE, "Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } bool ClientTaskState::IsTaskEnabled(int TaskID) { @@ -1280,7 +1280,7 @@ static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2938,7 +2938,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } _log(TASKS__UPDATE, "CancelTask: %s", query.c_str()); @@ -2947,7 +2947,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); _log(TASKS__UPDATE, "CancelTask: %s", query.c_str()); @@ -3088,7 +3088,7 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/titles.cpp b/zone/titles.cpp index 109a793b3..389e7f6ca 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + logger.Log(EQEmuLogSys::Error,"Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index e1cbbafc3..c56a070b0 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - LogFile->write(EQEmuLog::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + logger.Log(EQEmuLogSys::Error,"Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - LogFile->write(EQEmuLog::Error, "Player tried to augment an item without a container set."); + logger.Log(EQEmuLogSys::Error,"Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - LogFile->write(EQEmuLog::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); + logger.Log(EQEmuLogSys::Error,"Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - LogFile->write(EQEmuLog::Error, "Replace container combine executed in a world container."); + logger.Log(EQEmuLogSys::Error,"Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - LogFile->write(EQEmuLog::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + logger.Log(EQEmuLogSys::Error,"Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - LogFile->write(EQEmuLog::Error, "Error in HandleAutoCombine: no components returned"); + logger.Log(EQEmuLogSys::Error,"Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - LogFile->write(EQEmuLog::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + logger.Log(EQEmuLogSys::Error,"Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - LogFile->write(EQEmuLog::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + logger.Log(EQEmuLogSys::Error,"Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - LogFile->write(EQEmuLog::Error, "Error in SendTradeskillDetails: no components returned"); + logger.Log(EQEmuLogSys::Error,"Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - LogFile->write(EQEmuLog::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + logger.Log(EQEmuLogSys::Error,"Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe search, query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - LogFile->write(EQEmuLog::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + logger.Log(EQEmuLogSys::Error,"GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, re-query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, re-query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - LogFile->write(EQEmuLog::Error, "Combine error: Incorrect container is being used!"); + logger.Log(EQEmuLogSys::Error,"Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - LogFile->write(EQEmuLog::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + logger.Log(EQEmuLogSys::Error,"Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - LogFile->write(EQEmuLog::Error, "Error in GetTradeRecept success: no success items returned"); + logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,7 +1477,7 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index b591beaec..4a8450204 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1539,7 +1539,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - LogFile->write(EQEmuLog::Error, "Bazaar: Zero price transaction between %s and %s aborted." + logger.Log(EQEmuLogSys::Error,"Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); diff --git a/zone/trap.cpp b/zone/trap.cpp index e48f9edf4..42995265f 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 9fc6638e1..961be18f9 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - LogFile->write(EQEmuLog::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); + logger.Log(EQEmuLogSys::Error,"Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - LogFile->write(EQEmuLog::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + logger.Log(EQEmuLogSys::Error,"Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - LogFile->write(EQEmuLog::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + logger.Log(EQEmuLogSys::Error,"Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 9a9192397..82d0893a5 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -116,7 +116,7 @@ void NPC::ResumeWandering() } else { - LogFile->write(EQEmuLog::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + logger.Log(EQEmuLogSys::Error,"NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - LogFile->write(EQEmuLog::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + logger.Log(EQEmuLogSys::Error,"NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - LogFile->write(EQEmuLog::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + logger.Log(EQEmuLogSys::Error,"NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - LogFile->write(EQEmuLog::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - LogFile->write(EQEmuLog::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/zone.cpp b/zone/zone.cpp index 77622f7dd..d7c8ff822 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -167,7 +167,7 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadMercSpells()"); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadMercSpells()"); return; } @@ -737,7 +737,7 @@ void Zone::LoadZoneDoors(const char* zone, int16 version) Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - LogFile->write(EQEmuLog::Error, "... Failed to load doors."); + logger.Log(EQEmuLogSys::Error,"... Failed to load doors."); delete[] dlist; return; } @@ -806,7 +806,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) if(GraveYardLoaded) logger.LogDebug(EQEmuLogSys::General, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - LogFile->write(EQEmuLog::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + logger.Log(EQEmuLogSys::Error,"Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -901,38 +901,38 @@ bool Zone::Init(bool iStaticZone) { LogFile->write(EQEmuLog::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - LogFile->write(EQEmuLog::Error, "Loading spawn conditions failed, continuing without them."); + logger.Log(EQEmuLogSys::Error,"Loading spawn conditions failed, continuing without them."); } LogFile->write(EQEmuLog::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - LogFile->write(EQEmuLog::Error, "Loading static zone points failed."); + logger.Log(EQEmuLogSys::Error,"Loading static zone points failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - LogFile->write(EQEmuLog::Error, "Loading spawn groups failed."); + logger.Log(EQEmuLogSys::Error,"Loading spawn groups failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - LogFile->write(EQEmuLog::Error, "Loading spawn2 points failed."); + logger.Log(EQEmuLogSys::Error,"Loading spawn2 points failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - LogFile->write(EQEmuLog::Error, "Loading player corpses failed."); + logger.Log(EQEmuLogSys::Error,"Loading player corpses failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - LogFile->write(EQEmuLog::Error, "Loading traps failed."); + logger.Log(EQEmuLogSys::Error,"Loading traps failed."); return false; } @@ -942,13 +942,13 @@ bool Zone::Init(bool iStaticZone) { LogFile->write(EQEmuLog::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - LogFile->write(EQEmuLog::Error, "Loading ground spawns failed. continuing."); + logger.Log(EQEmuLogSys::Error,"Loading ground spawns failed. continuing."); } LogFile->write(EQEmuLog::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - LogFile->write(EQEmuLog::Error, "Loading World Objects failed. continuing."); + logger.Log(EQEmuLogSys::Error,"Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1024,27 +1024,27 @@ void Zone::ReloadStaticData() { LogFile->write(EQEmuLog::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - LogFile->write(EQEmuLog::Error, "Loading static zone points failed."); + logger.Log(EQEmuLogSys::Error,"Loading static zone points failed."); } LogFile->write(EQEmuLog::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - LogFile->write(EQEmuLog::Error, "Reloading traps failed."); + logger.Log(EQEmuLogSys::Error,"Reloading traps failed."); } LogFile->write(EQEmuLog::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - LogFile->write(EQEmuLog::Error, "Reloading ground spawns failed. continuing."); + logger.Log(EQEmuLogSys::Error,"Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); LogFile->write(EQEmuLog::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - LogFile->write(EQEmuLog::Error, "Reloading World Objects failed. continuing."); + logger.Log(EQEmuLogSys::Error,"Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - LogFile->write(EQEmuLog::Error, "Error loading the Zone Config."); + logger.Log(EQEmuLogSys::Error,"Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - LogFile->write(EQEmuLog::Error, "Error loading the Zone Config."); + logger.Log(EQEmuLogSys::Error,"Error loading the Zone Config."); return false; } } @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - LogFile->write(EQEmuLog::Error, "... Failed to load blocked spells."); + logger.Log(EQEmuLogSys::Error,"... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 30f570b20..579213d87 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - LogFile->write(EQEmuLog::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); + logger.Log(EQEmuLogSys::Error,"Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapwrite(EQEmuLog::Error, "Error in LoadAltCurrencyValues query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadAltCurrencyValues query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2866,7 +2866,7 @@ void ZoneDatabase::SaveBuffs(Client *client) { buffs[index].ExtraDIChance); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in SaveBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in SaveBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -2885,7 +2885,7 @@ void ZoneDatabase::LoadBuffs(Client *client) { "FROM `character_buffs` WHERE `character_id` = '%u'", client->CharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - LogFile->write(EQEmuLog::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); + logger.Log(EQEmuLogSys::Error,"Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - LogFile->write(EQEmuLog::Error, "Unable to construct a player corpse for character id %u.", char_id); + logger.Log(EQEmuLogSys::Error,"Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 1591bf0b6..d404cf468 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - LogFile->write(EQEmuLog::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + logger.Log(EQEmuLogSys::Error,"Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - LogFile->write(EQEmuLog::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + logger.Log(EQEmuLogSys::Error,"Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - LogFile->write(EQEmuLog::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + logger.Log(EQEmuLogSys::Error,"Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - LogFile->write(EQEmuLog::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + logger.Log(EQEmuLogSys::Error,"Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - LogFile->write(EQEmuLog::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + logger.Log(EQEmuLogSys::Error,"Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - LogFile->write(EQEmuLog::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + logger.Log(EQEmuLogSys::Error,"Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - LogFile->write(EQEmuLog::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + logger.Log(EQEmuLogSys::Error,"Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - LogFile->write(EQEmuLog::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + logger.Log(EQEmuLogSys::Error,"Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -550,7 +550,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; default: - LogFile->write(EQEmuLog::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + logger.Log(EQEmuLogSys::Error,"Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } From b76e179d758be28206e8c77baa306ac018c0e825 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:47:36 -0600 Subject: [PATCH 012/707] Fix spacing --- zone/aa.cpp | 32 +++---- zone/attack.cpp | 10 +- zone/bot.cpp | 18 ++-- zone/client.cpp | 12 +-- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 208 ++++++++++++++++++++--------------------- zone/command.cpp | 4 +- zone/corpse.cpp | 2 +- zone/effects.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embxs.cpp | 2 +- zone/entity.cpp | 8 +- zone/forage.cpp | 6 +- zone/groups.cpp | 24 ++--- zone/guild.cpp | 4 +- zone/horse.cpp | 6 +- zone/inventory.cpp | 6 +- zone/merc.cpp | 6 +- zone/net.cpp | 2 +- zone/npc.cpp | 18 ++-- zone/object.cpp | 8 +- zone/pathing.cpp | 10 +- zone/petitions.cpp | 8 +- zone/pets.cpp | 16 ++-- zone/questmgr.cpp | 4 +- zone/raids.cpp | 18 ++-- zone/spawn2.cpp | 22 ++--- zone/spell_effects.cpp | 2 +- zone/spells.cpp | 14 +-- zone/tasks.cpp | 66 ++++++------- zone/titles.cpp | 12 +-- zone/tradeskills.cpp | 64 ++++++------- zone/trading.cpp | 2 +- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 46 ++++----- zone/zone.cpp | 62 ++++++------ zone/zonedb.cpp | 54 +++++------ zone/zoning.cpp | 24 ++--- 39 files changed, 409 insertions(+), 409 deletions(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index b3f626b93..6ee33ee1c 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - logger.Log(EQEmuLogSys::Error,"Unknown AA nonspell action type %d", caa->action); + logger.Log(EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); return; } @@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - logger.Log(EQEmuLogSys::Error,"Unknown swarm pet spell id: %d, check pets table", spell_id); + logger.Log(EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - logger.Log(EQEmuLogSys::Error,"Unknown npc type for swarm pet spell id: %d", spell_id); + logger.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - logger.Log(EQEmuLogSys::Error,"Unknown npc type for swarm pet type id: %d", typesid); + logger.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -1432,7 +1432,7 @@ void Zone::LoadAAs() { LogFile->write(EQEmuLog::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - logger.Log(EQEmuLogSys::Error,"Failed to load AAs!"); + logger.Log(EQEmuLogSys::Error, "Failed to load AAs!"); aas = nullptr; return; } @@ -1451,7 +1451,7 @@ void Zone::LoadAAs() { if (database.LoadAAEffects2()) LogFile->write(EQEmuLog::Status, "Loaded %d AA Effects.", aa_effects.size()); else - logger.Log(EQEmuLogSys::Error,"Failed to load AA Effects!"); + logger.Log(EQEmuLogSys::Error, "Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - logger.Log(EQEmuLogSys::Error,"Error loading AA Effects, none found in the database."); + logger.Log(EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); return false; } @@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/attack.cpp b/zone/attack.cpp index 59cc0216b..70ac972eb 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1135,7 +1135,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Client::Attack() for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } @@ -1699,7 +1699,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to NPC::Attack() for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -3896,7 +3896,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3927,7 +3927,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } @@ -4476,7 +4476,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } diff --git a/zone/bot.cpp b/zone/bot.cpp index e0cf89601..3b860ab92 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - logger.Log(EQEmuLogSys::Error,"Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + logger.Log(EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Bot::LoadAAs()"); + logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); return; } @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error,"Error in Bot::LoadStance()"); + logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in Bot::SaveStance()"); + logger.Log(EQEmuLogSys::Error, "Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Bot::LoadTimers()"); + logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - logger.Log(EQEmuLogSys::Error,"Error in Bot::SaveTimers()"); + logger.Log(EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - logger.Log(EQEmuLogSys::Error,"Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + logger.Log(EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - logger.Log(EQEmuLogSys::Error,"Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -6017,7 +6017,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Bot::Attack for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } diff --git a/zone/client.cpp b/zone/client.cpp index 41c2a6134..319b076c9 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5301,7 +5301,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5369,7 +5369,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5396,7 +5396,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5404,7 +5404,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6218,7 +6218,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - logger.Log(EQEmuLogSys::Error,"Unknown doppelganger spell id: %d, check pets table", spell_id); + logger.Log(EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6232,7 +6232,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - logger.Log(EQEmuLogSys::Error,"Unknown npc type for doppelganger spell id: %d", spell_id); + logger.Log(EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index a2cd7eefb..f7a73c4cf 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - logger.Log(EQEmuLogSys::Error,"Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + logger.Log(EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 721e7e836..aaffb8687 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - logger.Log(EQEmuLogSys::Error,"HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + logger.Log(EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ApproveZone: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ClientError: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - logger.Log(EQEmuLogSys::Error,"Client error: %s", error->character_name); - logger.Log(EQEmuLogSys::Error,"Error message: %s", error->message); + logger.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); + logger.Log(EQEmuLogSys::Error, "Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_SetServerFilter"); + logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_TGB: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1324,7 +1324,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - logger.Log(EQEmuLogSys::Error,"GetAuth() returned false kicking client"); + logger.Log(EQEmuLogSys::Error, "GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - logger.Log(EQEmuLogSys::Error,"Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + logger.Log(EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1956,7 +1956,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - logger.Log(EQEmuLogSys::Error,"Handle_OP_AdventureInfoRequest had a packet that was too small."); + logger.Log(EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2011,7 +2011,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2191,7 +2191,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2413,7 +2413,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"Handle_OP_AdventureRequest had a packet that was too small."); + logger.Log(EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2939,7 +2939,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized " + logger.Log(EQEmuLogSys::Error, "Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2958,7 +2958,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -3072,7 +3072,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3229,7 +3229,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_AutoAttack expected:4 got:%i", app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3581,7 +3581,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3637,7 +3637,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) } else { _log(TRADING__CLIENT, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - logger.Log(EQEmuLogSys::Error,"Malformed BazaarSearch_Struct packet received, ignoring...\n"); + logger.Log(EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3722,13 +3722,13 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - logger.Log(EQEmuLogSys::Error,"Size mismatch for Bind wound packet"); + logger.Log(EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - logger.Log(EQEmuLogSys::Error,"Bindwound on non-exsistant mob from %s", this->GetName()); + logger.Log(EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { logger.LogDebug(EQEmuLogSys::General, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); @@ -3839,7 +3839,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - logger.Log(EQEmuLogSys::Error,"Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + logger.Log(EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3860,7 +3860,7 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - logger.Log(EQEmuLogSys::Error,"Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } @@ -3956,7 +3956,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4235,7 +4235,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4260,7 +4260,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on ClickObject_Struct: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4311,7 +4311,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4324,11 +4324,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - logger.Log(EQEmuLogSys::Error,"Unsupported action %d in OP_ClickObjectAction", oos->open); + logger.Log(EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - logger.Log(EQEmuLogSys::Error,"Invalid object %d in OP_ClickObjectAction", oos->drop_id); + logger.Log(EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4345,8 +4345,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - logger.Log(EQEmuLogSys::Error,"Client error: %s", error->character_name); - logger.Log(EQEmuLogSys::Error,"Error message:%s", error->message); + logger.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); + logger.Log(EQEmuLogSys::Error, "Error message:%s", error->message); return; } @@ -4367,7 +4367,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4873,7 +4873,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4910,7 +4910,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - logger.Log(EQEmuLogSys::Error,"Consuming from empty slot %d", pcs->slot); + logger.Log(EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -4922,7 +4922,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - logger.Log(EQEmuLogSys::Error,"OP_Consume: unknown type, type:%i", (int)pcs->type); + logger.Log(EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4943,7 +4943,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5099,7 +5099,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_Damage: got %d, expected %d", app->size, + logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5447,7 +5447,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized " + logger.Log(EQEmuLogSys::Error, "Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5538,7 +5538,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5593,7 +5593,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for OP_FaceChange: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5862,7 +5862,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5914,7 +5914,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5947,7 +5947,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6012,7 +6012,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6062,7 +6062,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6129,7 +6129,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6383,7 +6383,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6400,7 +6400,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6444,7 +6444,7 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6591,7 +6591,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - logger.Log(EQEmuLogSys::Error,"Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + logger.Log(EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6611,7 +6611,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6660,7 +6660,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6738,7 +6738,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6774,7 +6774,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6868,7 +6868,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -7989,7 +7989,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized OP_Illusion: got %d, expected %d", app->size, + logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8019,7 +8019,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8074,7 +8074,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8088,7 +8088,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8125,7 +8125,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - logger.Log(EQEmuLogSys::Error,"Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8225,7 +8225,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8240,7 +8240,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8438,7 +8438,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8891,7 +8891,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9051,7 +9051,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9088,7 +9088,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - logger.Log(EQEmuLogSys::Error,"Client sent LFP on for character %s who is grouped but not leader.", GetName()); + logger.Log(EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9113,7 +9113,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9169,7 +9169,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9717,7 +9717,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - logger.Log(EQEmuLogSys::Error,"Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9733,7 +9733,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9875,7 +9875,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9888,7 +9888,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10351,7 +10351,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10395,7 +10395,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10465,7 +10465,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - logger.Log(EQEmuLogSys::Error,"Size mismatch for Pick Pocket packet"); + logger.Log(EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10739,7 +10739,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11324,7 +11324,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11353,7 +11353,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11369,7 +11369,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11383,7 +11383,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11397,7 +11397,7 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } @@ -11456,7 +11456,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11746,7 +11746,7 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - logger.Log(EQEmuLogSys::Error,"Unexpected OP_Sacrifice reply"); + logger.Log(EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11790,7 +11790,7 @@ void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_SelectTribute packet"); + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - logger.Log(EQEmuLogSys::Error,"Received invalid sized " + logger.Log(EQEmuLogSys::Error, "Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11924,7 +11924,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11938,7 +11938,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"No valid start zones found for /setstartcity"); + logger.Log(EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); return; } @@ -12013,7 +12013,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12110,7 +12110,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12278,7 +12278,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - logger.Log(EQEmuLogSys::Error,"OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + logger.Log(EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12368,7 +12368,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12524,7 +12524,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12817,7 +12817,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12944,7 +12944,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - logger.Log(EQEmuLogSys::Error,"OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + logger.Log(EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13222,7 +13222,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - logger.Log(EQEmuLogSys::Error,"Unable to generate OP_Track packet requested by client."); + logger.Log(EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); return; } @@ -13236,7 +13236,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13389,7 +13389,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13535,7 +13535,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) _log(TRADING__CLIENT, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - logger.Log(EQEmuLogSys::Error,"Unknown TraderStruct code of: %i\n", ints->Code); + logger.Log(EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13545,7 +13545,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } else { _log(TRADING__CLIENT, "Unknown size for OP_Trader: %i\n", app->size); - logger.Log(EQEmuLogSys::Error,"Unknown size for OP_Trader: %i\n", app->size); + logger.Log(EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13583,7 +13583,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13619,7 +13619,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - logger.Log(EQEmuLogSys::Error,"Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13690,7 +13690,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - logger.Log(EQEmuLogSys::Error,"Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + logger.Log(EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13829,7 +13829,7 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_TributeToggle packet"); + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13844,7 +13844,7 @@ void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - logger.Log(EQEmuLogSys::Error,"Invalid size on OP_TributeUpdate packet"); + logger.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); diff --git a/zone/command.cpp b/zone/command.cpp index f5b4419a0..5fc9e2a9f 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -496,7 +496,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - logger.Log(EQEmuLogSys::Error,"command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + logger.Log(EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -575,7 +575,7 @@ int command_realdispatch(Client *c, const char *message) #endif if(cur->function == nullptr) { - logger.Log(EQEmuLogSys::Error,"Command '%s' has a null function\n", cstr.c_str()); + logger.Log(EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command diff --git a/zone/corpse.cpp b/zone/corpse.cpp index f6a193bc9..ec4503476 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -875,7 +875,7 @@ bool Corpse::Process() { logger.LogDebug(EQEmuLogSys::General, "Tagged %s player corpse has burried.", this->GetName()); } else { - logger.Log(EQEmuLogSys::Error,"Unable to bury %s player corpse.", this->GetName()); + logger.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); return true; } } diff --git a/zone/effects.cpp b/zone/effects.cpp index bd1fa7a54..861d6bd14 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - logger.Log(EQEmuLogSys::Error,"Unable to find turned in tome id %lu\n", (unsigned long)itemid); + logger.Log(EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 1a51ede27..e44fcf6a0 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - logger.Log(EQEmuLogSys::Error,"boot_quest does not take any arguments."); + logger.Log(EQEmuLogSys::Error, "boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 33cc53377..784f8b1ba 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - logger.Log(EQEmuLogSys::Error,"boot_qc does not take any arguments."); + logger.Log(EQEmuLogSys::Error, "boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/entity.cpp b/zone/entity.cpp index c2d19d11a..0712d252b 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - logger.Log(EQEmuLogSys::Error,"nullptr group, %s:%i", fname, fline); + logger.Log(EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - logger.Log(EQEmuLogSys::Error,"About to delete a client still in a group."); + logger.Log(EQEmuLogSys::Error, "About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - logger.Log(EQEmuLogSys::Error,"About to delete a client still in a raid."); + logger.Log(EQEmuLogSys::Error, "About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - logger.Log(EQEmuLogSys::Error,"Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + logger.Log(EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); diff --git a/zone/forage.cpp b/zone/forage.cpp index 64318ec48..e30dd7b0a 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - logger.Log(EQEmuLogSys::Error,"Possible Forage: %d with a %d chance", item[index], chance[index]); + logger.Log(EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - logger.Log(EQEmuLogSys::Error,"nullptr returned from database.GetItem in ClientForageItem"); + logger.Log(EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index dfd36602b..eca2884e5 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error,"Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index fcc57bc86..392ac8e48 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -413,7 +413,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -433,7 +433,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/horse.cpp b/zone/horse.cpp index 98b9ab91e..f5574f8ea 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Error,"No Database entry for mount: %s, check the horses table", fileName); + logger.Log(EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - logger.Log(EQEmuLogSys::Error,"%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + logger.Log(EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index a934a56ae..d1b3d3ba0 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - logger.Log(EQEmuLogSys::Error,"Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.Log(EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - logger.Log(EQEmuLogSys::Error,"Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + logger.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - logger.Log(EQEmuLogSys::Error,"Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + logger.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } diff --git a/zone/merc.cpp b/zone/merc.cpp index a6143c83c..0d9a225f2 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error,"A null Mob object was passed to Merc::Attack() for evaluation!"); + logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in NPC::LoadMercTypes()"); + logger.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in NPC::LoadMercTypes()"); + logger.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/net.cpp b/zone/net.cpp index d451521df..c339e393f 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -625,7 +625,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error,"Error loading spells: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 516d5b3d6..c95f4e417 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - logger.Log(EQEmuLogSys::Error,"Database error, invalid item"); + logger.Log(EQEmuLogSys::Error, "Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/object.cpp b/zone/object.cpp index 9545caf19..b2632bc2c 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - logger.Log(EQEmuLogSys::Error,"Object::PutItem: Invalid index specified (%i)", index); + logger.Log(EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Unable to insert object: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Unable to update object: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Unable to delete object: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index f5e1603e8..c5cd26e68 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -66,14 +66,14 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) } else { - logger.Log(EQEmuLogSys::Error,"Path File %s failed to load.", ZonePathFileName); + logger.Log(EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - logger.Log(EQEmuLogSys::Error,"Path File %s not found.", ZonePathFileName); + logger.Log(EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,7 +103,7 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - logger.Log(EQEmuLogSys::Error,"Bad Magic String in .path file."); + logger.Log(EQEmuLogSys::Error, "Bad Magic String in .path file."); return false; } @@ -114,7 +114,7 @@ bool PathManager::loadPaths(FILE *PathFile) if(Head.version != 2) { - logger.Log(EQEmuLogSys::Error,"Unsupported path file version."); + logger.Log(EQEmuLogSys::Error, "Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - logger.Log(EQEmuLogSys::Error,"Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + logger.Log(EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } diff --git a/zone/petitions.cpp b/zone/petitions.cpp index b0932bccb..1ef3c85b0 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,7 +254,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index b75670ad0..5cc236176 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - logger.Log(EQEmuLogSys::Error,"Unable to find data for pet %s, check pets table.", pettype); + logger.Log(EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - logger.Log(EQEmuLogSys::Error,"Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + logger.Log(EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - logger.Log(EQEmuLogSys::Error,"Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - logger.Log(EQEmuLogSys::Error,"Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + logger.Log(EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - logger.Log(EQEmuLogSys::Error,"Error in GetBasePetItems equipment set '%d' does not exist", curset); + logger.Log(EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 09fce9c70..cca186924 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in saylink phrase queries", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - logger.Log(EQEmuLogSys::Error,"Error in saylink phrase queries", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 17b000ff4..3f68f2270 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error inserting into raid members: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error,"Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error,"Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index e5f955e95..5a4f9b998 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Error,"Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - logger.Log(EQEmuLogSys::Error,"Refusing to load spawn event #%d because it has a period of 0\n", event.id); + logger.Log(EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 2203b1be4..a6dd26cbc 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - logger.Log(EQEmuLogSys::Error,"%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + logger.Log(EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index 5b6c88551..3f7d622b8 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - logger.Log(EQEmuLogSys::Error,"HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + logger.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - logger.Log(EQEmuLogSys::Error,"HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + logger.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - logger.Log(EQEmuLogSys::Error,"HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + logger.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + logger.Log(EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Error,"Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + logger.Log(EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - logger.Log(EQEmuLogSys::Error,"Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + logger.Log(EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 15ae8666e..3433842b2 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading tasks from database", taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - logger.Log(EQEmuLogSys::Error,"[TASKS]Task or Activity ID (%i, %i) out of range while loading " + logger.Log(EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -323,7 +323,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -362,7 +362,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -466,7 +466,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - logger.Log(EQEmuLogSys::Error,"[TASKS] Slot %i out of range while loading character tasks from database", slot); + logger.Log(EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - logger.Log(EQEmuLogSys::Error,"[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading character activities from database", taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,7 +634,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - logger.Log(EQEmuLogSys::Error,"[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + logger.Log(EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - logger.Log(EQEmuLogSys::Error,"[TASKS]Fatal error in character %i task state. Activity %i for " + logger.Log(EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -725,7 +725,7 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { _log(TASKS__UPDATE, "Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -774,7 +774,7 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) { _log(TASKS__UPDATE, "Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } bool ClientTaskState::IsTaskEnabled(int TaskID) { @@ -1280,7 +1280,7 @@ static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2938,7 +2938,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } _log(TASKS__UPDATE, "CancelTask: %s", query.c_str()); @@ -2947,7 +2947,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); _log(TASKS__UPDATE, "CancelTask: %s", query.c_str()); @@ -3088,7 +3088,7 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/titles.cpp b/zone/titles.cpp index 389e7f6ca..d90c63f6e 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + logger.Log(EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index c56a070b0..399935dd1 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - logger.Log(EQEmuLogSys::Error,"Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + logger.Log(EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - logger.Log(EQEmuLogSys::Error,"Player tried to augment an item without a container set."); + logger.Log(EQEmuLogSys::Error, "Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - logger.Log(EQEmuLogSys::Error,"Client or NewCombine_Struct not set in Object::HandleCombine"); + logger.Log(EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - logger.Log(EQEmuLogSys::Error,"Replace container combine executed in a world container."); + logger.Log(EQEmuLogSys::Error, "Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - logger.Log(EQEmuLogSys::Error,"Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + logger.Log(EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - logger.Log(EQEmuLogSys::Error,"Error in HandleAutoCombine: no components returned"); + logger.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - logger.Log(EQEmuLogSys::Error,"Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + logger.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - logger.Log(EQEmuLogSys::Error,"Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - logger.Log(EQEmuLogSys::Error,"Error in SendTradeskillDetails: no components returned"); + logger.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - logger.Log(EQEmuLogSys::Error,"Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + logger.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe search, query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - logger.Log(EQEmuLogSys::Error,"GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + logger.Log(EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, re-query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, re-query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - logger.Log(EQEmuLogSys::Error,"Combine error: Incorrect container is being used!"); + logger.Log(EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - logger.Log(EQEmuLogSys::Error,"Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + logger.Log(EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - logger.Log(EQEmuLogSys::Error,"Error in GetTradeRecept success: no success items returned"); + logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,7 +1477,7 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index 4a8450204..fa3c8783f 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1539,7 +1539,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - logger.Log(EQEmuLogSys::Error,"Bazaar: Zero price transaction between %s and %s aborted." + logger.Log(EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); diff --git a/zone/trap.cpp b/zone/trap.cpp index 42995265f..6f8132c3c 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 961be18f9..c9d5877c2 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - logger.Log(EQEmuLogSys::Error,"Details request for invalid tribute %lu", (unsigned long)tribute_id); + logger.Log(EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - logger.Log(EQEmuLogSys::Error,"Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + logger.Log(EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - logger.Log(EQEmuLogSys::Error,"Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + logger.Log(EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 82d0893a5..203deacfa 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -116,7 +116,7 @@ void NPC::ResumeWandering() } else { - logger.Log(EQEmuLogSys::Error,"NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + logger.Log(EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - logger.Log(EQEmuLogSys::Error,"NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + logger.Log(EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - logger.Log(EQEmuLogSys::Error,"NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + logger.Log(EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - logger.Log(EQEmuLogSys::Error,"Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - logger.Log(EQEmuLogSys::Error,"Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/zone.cpp b/zone/zone.cpp index d7c8ff822..50c857309 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -167,7 +167,7 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadMercTemplates()"); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadMercTemplates()"); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::LoadEXPLevelMods()"); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadMercSpells()"); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); return; } @@ -737,7 +737,7 @@ void Zone::LoadZoneDoors(const char* zone, int16 version) Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - logger.Log(EQEmuLogSys::Error,"... Failed to load doors."); + logger.Log(EQEmuLogSys::Error, "... Failed to load doors."); delete[] dlist; return; } @@ -806,7 +806,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) if(GraveYardLoaded) logger.LogDebug(EQEmuLogSys::General, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - logger.Log(EQEmuLogSys::Error,"Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + logger.Log(EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -901,38 +901,38 @@ bool Zone::Init(bool iStaticZone) { LogFile->write(EQEmuLog::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - logger.Log(EQEmuLogSys::Error,"Loading spawn conditions failed, continuing without them."); + logger.Log(EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } LogFile->write(EQEmuLog::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error,"Loading static zone points failed."); + logger.Log(EQEmuLogSys::Error, "Loading static zone points failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - logger.Log(EQEmuLogSys::Error,"Loading spawn groups failed."); + logger.Log(EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error,"Loading spawn2 points failed."); + logger.Log(EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - logger.Log(EQEmuLogSys::Error,"Loading player corpses failed."); + logger.Log(EQEmuLogSys::Error, "Loading player corpses failed."); return false; } LogFile->write(EQEmuLog::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error,"Loading traps failed."); + logger.Log(EQEmuLogSys::Error, "Loading traps failed."); return false; } @@ -942,13 +942,13 @@ bool Zone::Init(bool iStaticZone) { LogFile->write(EQEmuLog::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - logger.Log(EQEmuLogSys::Error,"Loading ground spawns failed. continuing."); + logger.Log(EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } LogFile->write(EQEmuLog::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - logger.Log(EQEmuLogSys::Error,"Loading World Objects failed. continuing."); + logger.Log(EQEmuLogSys::Error, "Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1024,27 +1024,27 @@ void Zone::ReloadStaticData() { LogFile->write(EQEmuLog::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error,"Loading static zone points failed."); + logger.Log(EQEmuLogSys::Error, "Loading static zone points failed."); } LogFile->write(EQEmuLog::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error,"Reloading traps failed."); + logger.Log(EQEmuLogSys::Error, "Reloading traps failed."); } LogFile->write(EQEmuLog::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - logger.Log(EQEmuLogSys::Error,"Reloading ground spawns failed. continuing."); + logger.Log(EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); LogFile->write(EQEmuLog::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - logger.Log(EQEmuLogSys::Error,"Reloading World Objects failed. continuing."); + logger.Log(EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - logger.Log(EQEmuLogSys::Error,"Error loading the Zone Config."); + logger.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - logger.Log(EQEmuLogSys::Error,"Error loading the Zone Config."); + logger.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - logger.Log(EQEmuLogSys::Error,"... Failed to load blocked spells."); + logger.Log(EQEmuLogSys::Error, "... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 579213d87..1b3f9cec3 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - logger.Log(EQEmuLogSys::Error,"Programming error: LoadWorldContainer passed nullptr pointer"); + logger.Log(EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error Deleting Merc: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapCharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - logger.Log(EQEmuLogSys::Error,"Unable to unbury a summoned player corpse for character id %u.", char_id); + logger.Log(EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - logger.Log(EQEmuLogSys::Error,"Unable to construct a player corpse for character id %u.", char_id); + logger.Log(EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index d404cf468..1d50ed51d 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - logger.Log(EQEmuLogSys::Error,"Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + logger.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - logger.Log(EQEmuLogSys::Error,"Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + logger.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - logger.Log(EQEmuLogSys::Error,"Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + logger.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - logger.Log(EQEmuLogSys::Error,"Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + logger.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - logger.Log(EQEmuLogSys::Error,"Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + logger.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - logger.Log(EQEmuLogSys::Error,"Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + logger.Log(EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - logger.Log(EQEmuLogSys::Error,"Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + logger.Log(EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - logger.Log(EQEmuLogSys::Error,"Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + logger.Log(EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -550,7 +550,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; default: - logger.Log(EQEmuLogSys::Error,"Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + logger.Log(EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error,"MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } From fdbd76e4ad1408fa5882cd446192b1c98f159614 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:54:37 -0600 Subject: [PATCH 013/707] Replaced Status log calls --- zone/aa.cpp | 6 ++--- zone/embparser.cpp | 2 +- zone/pathing.cpp | 4 +-- zone/zone.cpp | 66 +++++++++++++++++++++++----------------------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 6ee33ee1c..0e6e0aad0 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1429,7 +1429,7 @@ SendAA_Struct* Zone::FindAA(uint32 id) { } void Zone::LoadAAs() { - LogFile->write(EQEmuLog::Status, "Loading AA information..."); + logger.Log(EQEmuLogSys::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { logger.Log(EQEmuLogSys::Error, "Failed to load AAs!"); @@ -1447,9 +1447,9 @@ void Zone::LoadAAs() { } //load AA Effects into aa_effects - LogFile->write(EQEmuLog::Status, "Loading AA Effects..."); + logger.Log(EQEmuLogSys::Status, "Loading AA Effects..."); if (database.LoadAAEffects2()) - LogFile->write(EQEmuLog::Status, "Loaded %d AA Effects.", aa_effects.size()); + logger.Log(EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); else logger.Log(EQEmuLogSys::Error, "Failed to load AA Effects!"); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index c39426953..50df10905 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - LogFile->write(EQEmuLog::Status, "Error re-initializing perlembed: %s", e.what()); + logger.Log(EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index c5cd26e68..0d201bc6b 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -61,7 +61,7 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) if(Ret->loadPaths(PathFile)) { - LogFile->write(EQEmuLog::Status, "Path File %s loaded.", ZonePathFileName); + logger.Log(EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); } else @@ -109,7 +109,7 @@ bool PathManager::loadPaths(FILE *PathFile) fread(&Head, sizeof(Head), 1, PathFile); - LogFile->write(EQEmuLog::Status, "Path File Header: Version %ld, PathNodes %ld", + logger.Log(EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", (long)Head.version, (long)Head.PathNodeCount); if(Head.version != 2) diff --git a/zone/zone.cpp b/zone/zone.cpp index 50c857309..a8a030cf9 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -90,7 +90,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - LogFile->write(EQEmuLog::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + logger.Log(EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - LogFile->write(EQEmuLog::Status, "General logging level: %i", zone->loglevelvar); + logger.Log(EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); zone->merchantvar = log_levels[1]; - LogFile->write(EQEmuLog::Status, "Merchant logging level: %i", zone->merchantvar); + logger.Log(EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); zone->tradevar = log_levels[2]; - LogFile->write(EQEmuLog::Status, "Trade logging level: %i", zone->tradevar); + logger.Log(EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); zone->lootvar = log_levels[3]; - LogFile->write(EQEmuLog::Status, "Loot logging level: %i", zone->lootvar); + logger.Log(EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); } else { zone->loglevelvar = uint8(atoi(tmp)); //continue supporting only command logging (for now) @@ -145,7 +145,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { } LogFile->write(EQEmuLog::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - LogFile->write(EQEmuLog::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + logger.Log(EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); @@ -171,7 +171,7 @@ bool Zone::LoadZoneObjects() { return false; } - LogFile->write(EQEmuLog::Status, "Loading Objects from DB..."); + logger.Log(EQEmuLogSys::Status, "Loading Objects from DB..."); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { @@ -288,7 +288,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - LogFile->write(EQEmuLog::Status, "Loading Ground Spawns from DB..."); + logger.Log(EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name=0; @@ -402,7 +402,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - LogFile->write(EQEmuLog::Status, "Loading Temporary Merchant Lists..."); + logger.Log(EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -474,7 +474,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - LogFile->write(EQEmuLog::Status, "Loading Merchant Lists..."); + logger.Log(EQEmuLogSys::Status, "Loading Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -707,7 +707,7 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - LogFile->write(EQEmuLog::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + logger.Log(EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) @@ -725,12 +725,12 @@ void Zone::Shutdown(bool quite) void Zone::LoadZoneDoors(const char* zone, int16 version) { - LogFile->write(EQEmuLog::Status, "Loading doors for %s ...", zone); + logger.Log(EQEmuLogSys::Status, "Loading doors for %s ...", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - LogFile->write(EQEmuLog::Status, "... No doors loaded."); + logger.Log(EQEmuLogSys::Status, "... No doors loaded."); return; } @@ -899,53 +899,53 @@ Zone::~Zone() { bool Zone::Init(bool iStaticZone) { SetStaticZone(iStaticZone); - LogFile->write(EQEmuLog::Status, "Loading spawn conditions..."); + logger.Log(EQEmuLogSys::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { logger.Log(EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } - LogFile->write(EQEmuLog::Status, "Loading static zone points..."); + logger.Log(EQEmuLogSys::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { logger.Log(EQEmuLogSys::Error, "Loading static zone points failed."); return false; } - LogFile->write(EQEmuLog::Status, "Loading spawn groups..."); + logger.Log(EQEmuLogSys::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { logger.Log(EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } - LogFile->write(EQEmuLog::Status, "Loading spawn2 points..."); + logger.Log(EQEmuLogSys::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { logger.Log(EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } - LogFile->write(EQEmuLog::Status, "Loading player corpses..."); + logger.Log(EQEmuLogSys::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { logger.Log(EQEmuLogSys::Error, "Loading player corpses failed."); return false; } - LogFile->write(EQEmuLog::Status, "Loading traps..."); + logger.Log(EQEmuLogSys::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { logger.Log(EQEmuLogSys::Error, "Loading traps failed."); return false; } - LogFile->write(EQEmuLog::Status, "Loading adventure flavor text..."); + logger.Log(EQEmuLogSys::Status, "Loading adventure flavor text..."); LoadAdventureFlavor(); - LogFile->write(EQEmuLog::Status, "Loading ground spawns..."); + logger.Log(EQEmuLogSys::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { logger.Log(EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } - LogFile->write(EQEmuLog::Status, "Loading World Objects from DB..."); + logger.Log(EQEmuLogSys::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { logger.Log(EQEmuLogSys::Error, "Loading World Objects failed. continuing."); @@ -1005,10 +1005,10 @@ bool Zone::Init(bool iStaticZone) { } } - LogFile->write(EQEmuLog::Status, "Loading timezone data..."); + logger.Log(EQEmuLogSys::Status, "Loading timezone data..."); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - LogFile->write(EQEmuLog::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + logger.Log(EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1019,29 +1019,29 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - LogFile->write(EQEmuLog::Status, "Reloading Zone Static Data..."); + logger.Log(EQEmuLogSys::Status, "Reloading Zone Static Data..."); - LogFile->write(EQEmuLog::Status, "Reloading static zone points..."); + logger.Log(EQEmuLogSys::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { logger.Log(EQEmuLogSys::Error, "Loading static zone points failed."); } - LogFile->write(EQEmuLog::Status, "Reloading traps..."); + logger.Log(EQEmuLogSys::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { logger.Log(EQEmuLogSys::Error, "Reloading traps failed."); } - LogFile->write(EQEmuLog::Status, "Reloading ground spawns..."); + logger.Log(EQEmuLogSys::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { logger.Log(EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); - LogFile->write(EQEmuLog::Status, "Reloading World Objects from DB..."); + logger.Log(EQEmuLogSys::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { logger.Log(EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); @@ -1060,7 +1060,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - LogFile->write(EQEmuLog::Status, "Zone Static Data Reloaded."); + logger.Log(EQEmuLogSys::Status, "Zone Static Data Reloaded."); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault) @@ -1098,7 +1098,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - LogFile->write(EQEmuLog::Status, "Successfully loaded Zone Config."); + logger.Log(EQEmuLogSys::Status, "Successfully loaded Zone Config."); return true; } @@ -1580,8 +1580,8 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien { if(client) client->CheatDetected(MQZoneUnknownDest, x, y, z); // Someone is trying to use /zone - LogFile->write(EQEmuLog::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - LogFile->write(EQEmuLog::Status, ". %f x %f y %f z ", x, y, z); + logger.Log(EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); + logger.Log(EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); } if(closest_dist > max_distance2) From a92233240c5760eeacc2d60583ca9bfb9cc95cbf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:55:10 -0600 Subject: [PATCH 014/707] Replaced Normal calls --- zone/bot.cpp | 4 ++-- zone/npc.cpp | 2 +- zone/tradeskills.cpp | 2 +- zone/zone.cpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 3b860ab92..013f08a74 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; default: - LogFile->write(EQEmuLog::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -7336,7 +7336,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - LogFile->write(EQEmuLog::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } } diff --git a/zone/npc.cpp b/zone/npc.cpp index c95f4e417..9f67afbd5 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem { if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) { - LogFile->write(EQEmuLog::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); + logger.Log(EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); } } } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 399935dd1..b249e2c28 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1482,7 +1482,7 @@ void Client::LearnRecipe(uint32 recipeID) } if (results.RowCount() != 1) { - LogFile->write(EQEmuLog::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); + logger.Log(EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); return; } diff --git a/zone/zone.cpp b/zone/zone.cpp index a8a030cf9..9c00d23cb 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -144,7 +144,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { delete pack; } - LogFile->write(EQEmuLog::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); + logger.Log(EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); logger.Log(EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); @@ -711,7 +711,7 @@ void Zone::Shutdown(bool quite) petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) - LogFile->write(EQEmuLog::Normal, "Zone shutdown: going to sleep"); + logger.Log(EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); ZoneLoaded = false; zone->ResetAuth(); From 4bf74348a10ca8c451f35c4accb654727d92e3c8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:56:09 -0600 Subject: [PATCH 015/707] Replaced Error calls --- zone/client_process.cpp | 2 +- zone/exp.cpp | 2 +- zone/worldserver.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index e42c939b5..2b41d8bd2 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) { if(app->size != sizeof(MemorizeSpell_Struct)) { - LogFile->write(EQEmuLog::Error,"Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); + logger.Log(EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); DumpPacket(app); return; } diff --git a/zone/exp.cpp b/zone/exp.cpp index 7edd70864..8e401eedc 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetLevel(uint8 set_level, bool command) { if (GetEXPForLevel(set_level) == 0xFFFFFFFF) { - LogFile->write(EQEmuLog::Error,"Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); + logger.Log(EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); return; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index d76fec5c0..9839ec3a1 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -1384,7 +1384,7 @@ void WorldServer::Process() { if(NewCorpse) NewCorpse->Spawn(); else - LogFile->write(EQEmuLog::Error,"Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); + logger.Log(EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); break; } From 18c837c39825c9fc534e001354b31aac4667d9b4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 15:59:32 -0600 Subject: [PATCH 016/707] Replaced various other log calls in zone --- zone/client_packet.cpp | 8 +++----- zone/command.cpp | 36 ++++++++++++++++++------------------ zone/embperl.cpp | 10 +++++----- zone/exp.cpp | 2 +- zone/questmgr.cpp | 24 ++++++++++++------------ 5 files changed, 39 insertions(+), 41 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index aaffb8687..30e3d760b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1340,7 +1340,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) struct in_addr ghost_addr; ghost_addr.s_addr = eqs->GetRemoteIP(); - LogFile->write(EQEmuLog::Error,"Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", + logger.Log(EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", client->AccountID(), client->AccountName(), client->GetName(), inet_ntoa(ghost_addr)); client->Save(); client->Disconnect(); @@ -6139,7 +6139,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) return; } Client* client = entity_list.GetClientByName(gmn->oldname); - LogFile->write(EQEmuLog::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + logger.Log(EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(13, "%s not found for name change. Operation failed!", gmn->oldname); @@ -9153,9 +9153,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - //LogFile->write(EQEMuLog::Debug, "%s sent a logout packet.", GetName()); - //we will save when we get destroyed soon anyhow - //Save(); + logger.LogDebug(EQEmuLogSys:EQEmuLogSys::Detail, "%s sent a logout packet.", GetName()); SendLogoutPackets(); diff --git a/zone/command.cpp b/zone/command.cpp index 5fc9e2a9f..d77279e09 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -451,7 +451,7 @@ int command_init(void) { { #ifdef COMMANDS_WARNINGS if(cur->second->access == 0) - LogFile->write(EQEmuLog::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); + logger.Log(EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); #endif } } @@ -1347,7 +1347,7 @@ void command_viewpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - LogFile->write(EQEmuLog::Normal,"View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); + logger.Log(EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1372,7 +1372,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) if (!results.Success()) return; - LogFile->write(EQEmuLog::Normal,"Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + logger.Log(EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1398,7 +1398,7 @@ void command_delpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - LogFile->write(EQEmuLog::Normal,"Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + logger.Log(EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); } @@ -1621,7 +1621,7 @@ void command_permaclass(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); - LogFile->write(EQEmuLog::Normal,"Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + logger.Log(EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); t->Kick(); @@ -1643,7 +1643,7 @@ void command_permarace(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's race - zone to take effect",t->GetName()); - LogFile->write(EQEmuLog::Normal,"Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + logger.Log(EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); t->SetBaseGender(tmp); @@ -1667,7 +1667,7 @@ void command_permagender(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's gender - zone to take effect",t->GetName()); - LogFile->write(EQEmuLog::Normal,"Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + logger.Log(EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); t->SendIllusionPacket(atoi(sep->arg[1])); @@ -2009,7 +2009,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) { - LogFile->write(EQEmuLog::Normal,"Spawning database spawn"); + logger.Log(EQEmuLogSys::Normal, "Spawning database spawn"); uint16 cond = 0; int16 cond_min = 0; if(sep->IsNumber(4)) { @@ -2329,7 +2329,7 @@ void command_setlanguage(Client *c, const Seperator *sep) } else { - LogFile->write(EQEmuLog::Normal,"Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + logger.Log(EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); uint8 langid = (uint8)atoi(sep->arg[1]); uint8 value = (uint8)atoi(sep->arg[2]); c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value ); @@ -2354,7 +2354,7 @@ void command_setskill(Client *c, const Seperator *sep) c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { - LogFile->write(EQEmuLog::Normal,"Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + logger.Log(EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); int skill_num = atoi(sep->arg[1]); uint16 skill_value = atoi(sep->arg[2]); if(skill_num < HIGHEST_SKILL) @@ -2374,7 +2374,7 @@ void command_setskillall(Client *c, const Seperator *sep) } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { - LogFile->write(EQEmuLog::Normal,"Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); + logger.Log(EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); uint16 level = atoi(sep->arg[1]); for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) { c->GetTarget()->CastToClient()->SetSkill(skill_num, level); @@ -3169,7 +3169,7 @@ void command_listpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - LogFile->write(EQEmuLog::Normal,"Petition list requested by %s", c->GetName()); + logger.Log(EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); if (results.RowCount() == 0) return; @@ -3826,7 +3826,7 @@ void command_lastname(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - LogFile->write(EQEmuLog::Normal,"#lastname request from %s for %s", c->GetName(), t->GetName()); + logger.Log(EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); @@ -4924,7 +4924,7 @@ void command_manaburn(Client *c, const Seperator *sep) target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/); c->Message(4,"You unleash an enormous blast of magical energies."); } - LogFile->write(EQEmuLog::Normal,"Manaburn request from %s, damage: %d", c->GetName(), nukedmg); + logger.Log(EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); } } else @@ -5276,7 +5276,7 @@ void command_scribespells(Client *c, const Seperator *sep) t->Message(0, "Scribing spells to spellbook."); if(t != c) c->Message(0, "Scribing spells for %s.", t->GetName()); - LogFile->write(EQEmuLog::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + logger.Log(EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot)) { @@ -5333,7 +5333,7 @@ void command_scribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - LogFile->write(EQEmuLog::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + logger.Log(EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) { book_slot = t->GetNextAvailableSpellBookSlot(); @@ -5380,7 +5380,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - LogFile->write(EQEmuLog::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + logger.Log(EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); @@ -8139,7 +8139,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->Message(0, "Training disciplines"); if(t != c) c->Message(0, "Training disciplines for %s.", t->GetName()); - LogFile->write(EQEmuLog::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + logger.Log(EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++) { diff --git a/zone/embperl.cpp b/zone/embperl.cpp index e356ff7ac..e1f1612e6 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -139,12 +139,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - LogFile->write(EQEmuLog::Quest, "perl error: %s", err); + logger.Log(EQEmuLogSys::Quest, "perl error: %s", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - LogFile->write(EQEmuLog::Quest, "Tying perl output to eqemu logs"); + logger.Log(EQEmuLogSys::Quest, "Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -169,14 +169,14 @@ void Embperl::DoInit() { ,FALSE ); - LogFile->write(EQEmuLog::Quest, "Loading perlemb plugins."); + logger.Log(EQEmuLogSys::Quest, "Loading perlemb plugins."); try { eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE); } catch(const char *err) { - LogFile->write(EQEmuLog::Quest, "Warning - plugin.pl: %s", err); + logger.Log(EQEmuLogSys::Quest, "Warning - plugin.pl: %s", err); } try { @@ -194,7 +194,7 @@ void Embperl::DoInit() { } catch(const char *err) { - LogFile->write(EQEmuLog::Quest, "Perl warning: %s", err); + logger.Log(EQEmuLogSys::Quest, "Perl warning: %s", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/exp.cpp b/zone/exp.cpp index 8e401eedc..a96b9a9a0 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command) safe_delete(outapp); this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change - LogFile->write(EQEmuLog::Normal,"Setting Level for %s to %i", GetName(), set_level); + logger.Log(EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); CalcBonuses(); diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index cca186924..bdc1ecb6f 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -154,7 +154,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - LogFile->write(EQEmuLog::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -170,7 +170,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { QuestManagerCurrentQuestVars(); if (!owner) { - LogFile->write(EQEmuLog::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::stopalltimers(Mob *mob) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - LogFile->write(EQEmuLog::Quest, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -559,7 +559,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - LogFile->write(EQEmuLog::Quest, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -570,7 +570,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - LogFile->write(EQEmuLog::Quest, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -589,7 +589,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - LogFile->write(EQEmuLog::Quest, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -619,7 +619,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - LogFile->write(EQEmuLog::Quest, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -646,7 +646,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - LogFile->write(EQEmuLog::Quest, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -655,7 +655,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - LogFile->write(EQEmuLog::Quest, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -664,7 +664,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - LogFile->write(EQEmuLog::Quest, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + logger.Log(EQEmuLogSys::Quest, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -1652,7 +1652,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Quest, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Quest, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); return; } @@ -2809,7 +2809,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - LogFile->write(EQEmuLog::Quest, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + logger.Log(EQEmuLogSys::Quest, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); } } From 26b550dd0d3cd724447537d03f0673bf2f2aee4c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 16:01:43 -0600 Subject: [PATCH 017/707] More log replacements --- zone/client.cpp | 6 +++--- zone/client_packet.cpp | 2 +- zone/command.cpp | 2 +- zone/doors.cpp | 2 +- zone/embperl.cpp | 1 + zone/entity.cpp | 4 ++-- zone/spell_effects.cpp | 4 ++-- zone/spells.cpp | 2 +- zone/zonedb.cpp | 2 +- zone/zoning.cpp | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 319b076c9..cd62b3331 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -651,7 +651,7 @@ bool Client::SendAllPackets() { eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); #if EQDEBUG >= 6 - LogFile->write(EQEmuLog::Normal, "Transmitting a packet"); + logger.Log(EQEmuLogSys::Normal, "Transmitting a packet"); #endif } return true; @@ -1918,7 +1918,7 @@ void Client::ReadBook(BookRequest_Struct *book) { if (booktxt2[0] != '\0') { #if EQDEBUG >= 6 - LogFile->write(EQEmuLog::Normal,"Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); + logger.Log(EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); #endif EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct)); @@ -2371,7 +2371,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 Save(); - LogFile->write(EQEmuLog::Normal, "Reset %s's caster specialization skills to 1. " + logger.Log(EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " "Too many specializations skills were above 50.", GetCleanName()); } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 30e3d760b..c3f8ef6c0 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -9153,7 +9153,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - logger.LogDebug(EQEmuLogSys:EQEmuLogSys::Detail, "%s sent a logout packet.", GetName()); + logger.LogDebug(EQEmuLogSys::Detail, "%s sent a logout packet.", GetName()); SendLogoutPackets(); diff --git a/zone/command.cpp b/zone/command.cpp index d77279e09..5d9cfe942 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -570,7 +570,7 @@ int command_realdispatch(Client *c, const char *message) #ifdef COMMANDS_LOGGING if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - LogFile->write(EQEmuLog::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + logger.Log(EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } #endif diff --git a/zone/doors.cpp b/zone/doors.cpp index 229bb3e4c..a4d3f80f2 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) { - LogFile->write(EQEmuLog::Status, "Loading Doors from database..."); + logger.Log(EQEmuLogSys::Status, "Loading Doors from database..."); // Door tmpDoor; diff --git a/zone/embperl.cpp b/zone/embperl.cpp index e1f1612e6..52fe31826 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -11,6 +11,7 @@ Eglin #ifdef EMBPERL #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include #include diff --git a/zone/entity.cpp b/zone/entity.cpp index 0712d252b..ccc74629c 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - LogFile->write(EQEmuLog::Error, + logger.Log(EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - LogFile->write(EQEmuLog::Error, + logger.Log(EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index a6dd26cbc..b8d67ddaa 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4817,7 +4817,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - LogFile->write(EQEmuLog::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -5156,7 +5156,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - LogFile->write(EQEmuLog::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } diff --git a/zone/spells.cpp b/zone/spells.cpp index 3f7d622b8..ff456fcbc 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -5040,7 +5040,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); - LogFile->write(EQEmuLog::Normal, + logger.Log(EQEmuLogSys::Normal, "FindType: type = %d; value = %d; threshold = %d", type, value, threshold); if (value < threshold) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 1b3f9cec3..61cbaaada 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2696,7 +2696,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - LogFile->write(EQEmuLog::Status, "Loading Blocked Spells from database..."); + logger.Log(EQEmuLogSys::Status, "Loading Blocked Spells from database..."); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 1d50ed51d..d6df3a896 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -347,7 +347,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - LogFile->write(EQEmuLog::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + logger.Log(EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it From b7ade8bf1b72286dfc3af56f2aa40c73e51bda9b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 17:27:24 -0600 Subject: [PATCH 018/707] EQEmuLog::Dump preprocessor remove --- common/debug.cpp | 4 +--- common/eqemu_logsys.cpp | 8 +++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 9bbe9d304..1150db9f0 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -372,9 +372,7 @@ bool EQEmuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) bool EQEmuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip) { if (!logFileValid) { - #if EQDEBUG >= 10 - std::cerr << "Error: Dump() from null pointer" << std::endl; - #endif + logger.LogDebug(EQEmuLogSys::Detail, "Error: Dump() from null pointer"); return false; } if (size == 0) { diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 3806e49e4..3da479576 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -68,9 +68,9 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { }; static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { Console::Color::Yellow, // "Status", - Console::Color::Yellow, // "Normal", + Console::Color::Yellow, // "Normal", Console::Color::LightRed, // "Error", - Console::Color::LightGreen, // "Debug", + Console::Color::LightGreen, // "Debug", Console::Color::LightCyan, // "Quest", Console::Color::LightMagenta, // "Command", Console::Color::LightRed // "Crash" @@ -91,9 +91,7 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...){ - if (RuleI(Logging, DebugLogLevel) < debug_level){ - return; - } + if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } va_list args; va_start(args, message); From 7a9860fdd12114359e97944d9ce46c123b596b98 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 18:12:58 -0600 Subject: [PATCH 019/707] Added EQEmuLogSys logger; pointer to the rest of the projects --- client_files/export/main.cpp | 4 ++++ client_files/import/main.cpp | 3 +++ common/eqemu_logsys.cpp | 10 ++++++---- common/eqemu_logsys.h | 3 +-- eqlaunch/eqlaunch.cpp | 3 +++ eqlaunch/worldserver.cpp | 1 + queryserv/queryserv.cpp | 2 ++ shared_memory/main.cpp | 4 ++++ ucs/ucs.cpp | 2 ++ world/net.cpp | 3 ++- zone/pathing.cpp | 4 ++-- 11 files changed, 30 insertions(+), 9 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 8bf6827d4..87874fc61 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -17,6 +17,8 @@ */ #include + +#include "../../common/eqemu_logsys.h" #include "../../common/debug.h" #include "../../common/shareddb.h" #include "../../common/eqemu_config.h" @@ -25,6 +27,8 @@ #include "../../common/rulesys.h" #include "../../common/string_util.h" +EQEmuLogSys logger; + void ExportSpells(SharedDatabase *db); void ExportSkillCaps(SharedDatabase *db); void ExportBaseData(SharedDatabase *db); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 7617248d0..390c1c109 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "../../common/eqemu_logsys.h" #include "../../common/debug.h" #include "../../common/shareddb.h" #include "../../common/eqemu_config.h" @@ -24,6 +25,8 @@ #include "../../common/rulesys.h" #include "../../common/string_util.h" +EQEmuLogSys logger; + void ImportSpells(SharedDatabase *db); void ImportSkillCaps(SharedDatabase *db); void ImportBaseData(SharedDatabase *db); diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 3da479576..ee3cb98ce 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -90,8 +90,9 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } -void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...){ - if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } +void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) +{ + if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } va_list args; va_start(args, message); @@ -103,7 +104,7 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...){ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { - if (log_type > EQEmuLogSys::MaxLogID){ + if (log_type > EQEmuLogSys::MaxLogID){ return; } if (!RuleB(Logging, LogFileCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } @@ -152,7 +153,8 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) #endif } -void EQEmuLogSys::CloseZoneLogs(){ +void EQEmuLogSys::CloseZoneLogs() +{ std::cout << "Closing down zone logs..." << std::endl; process_log.close(); } \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index cfeea78ce..fff2af07f 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -34,7 +34,7 @@ public: Error, /* Error Logs */ Debug, /* Debug Logs */ Quest, /* Quest Logs */ - Commands, /* Issued Comamnds */ + Commands, /* Issued Commands */ Crash, /* Crash Logs */ Save, /* Client Saves */ MaxLogID /* Max, used in functions to get the max log ID */ @@ -61,5 +61,4 @@ private: extern EQEmuLogSys logger; - #endif \ No newline at end of file diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index fbac09541..5ddcfefdd 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/proc_launcher.h" #include "../common/eqemu_config.h" #include "../common/servertalk.h" @@ -30,6 +31,8 @@ #include #include +EQEmuLogSys logger; + bool RunLoops = false; void CatchSignal(int sig_num); diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index 1754b6564..920bf982e 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -15,6 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + #include "../common/debug.h" #include "../common/servertalk.h" #include "../common/eqemu_config.h" diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 22ddb87ee..ce64b646b 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -18,6 +18,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/opcodemgr.h" #include "../common/eq_stream_factory.h" #include "../common/rulesys.h" @@ -39,6 +40,7 @@ LFGuildManager lfguildmanager; std::string WorldShortName; const queryservconfig *Config; WorldServer *worldserver = 0; +EQEmuLogSys logger; void CatchSignal(int sig_num) { RunLoops = false; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index b9ee32929..dbb1885d1 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -17,6 +17,8 @@ */ #include + +#include "../common/eqemu_logsys.h" #include "../common/debug.h" #include "../common/shareddb.h" #include "../common/eqemu_config.h" @@ -31,6 +33,8 @@ #include "spells.h" #include "base_data.h" +EQEmuLogSys logger; + int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformSharedMemory); set_exception_handler(); diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index dd5f304b3..ad3af0379 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -17,6 +17,7 @@ */ +#include "../common/eqemu_logsys.h" #include "../common/debug.h" #include "clientlist.h" #include "../common/opcodemgr.h" @@ -50,6 +51,7 @@ std::string WorldShortName; const ucsconfig *Config; WorldServer *worldserver = nullptr; +EQEmuLogSys logger; void CatchSignal(int sig_num) { diff --git a/world/net.cpp b/world/net.cpp index dbc63ee5d..11de88892 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -25,6 +25,7 @@ #include #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/queue.h" #include "../common/timer.h" #include "../common/eq_stream_factory.h" @@ -103,7 +104,7 @@ volatile bool RunLoops = true; uint32 numclients = 0; uint32 numzones = 0; bool holdzones = false; - +EQEmuLogSys logger; extern ConsoleList console_list; diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 0d201bc6b..5550c1519 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -206,10 +206,10 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) } std::deque PathManager::FindRoute(int startID, int endID) -{ +{ _log(PATHING__DEBUG, "FindRoute from node %i to %i", startID, endID); - memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); + memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); std::deque OpenList, ClosedList; From fc76e5c8acdd63fff081e091c430aafdaa8065c8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 18:29:27 -0600 Subject: [PATCH 020/707] pathing _log to logger.LogDebug --- zone/pathing.cpp | 42 +++++++++++++++++++++--------------------- zone/zoning.cpp | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 5550c1519..a998bf395 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque PathManager::FindRoute(int startID, int endID) { - _log(PATHING__DEBUG, "FindRoute from node %i to %i", startID, endID); + logger.LogDebug(EQEmuLogSys::Detail, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -330,7 +330,7 @@ std::deque PathManager::FindRoute(int startID, int endID) } } - _log(PATHING__DEBUG, "Unable to find a route."); + logger.LogDebug(EQEmuLogSys::Detail, "Unable to find a route."); return Route; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { - _log(PATHING__DEBUG, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); + logger.LogDebug(EQEmuLogSys::Detail, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::deque noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - _log(PATHING__DEBUG, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToStart <0 ) { - _log(PATHING__DEBUG, "No LOS to any starting Path Node within range."); + logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any starting Path Node within range."); return noderoute; } - _log(PATHING__DEBUG, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); + logger.LogDebug(EQEmuLogSys::Detail, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); // Find the nearest PathNode the end point has LOS to @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - _log(PATHING__DEBUG, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); - _log(PATHING__DEBUG, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + logger.LogDebug(EQEmuLogSys::Detail, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToEnd < 0) { - _log(PATHING__DEBUG, "No LOS to any end Path Node within range."); + logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any end Path Node within range."); return noderoute; } - _log(PATHING__DEBUG, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); + logger.LogDebug(EQEmuLogSys::Detail, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); if(ClosestPathNodeToStart == ClosestPathNodeToEnd) { @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - _log(PATHING__DEBUG, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } if(ClosestPathNodeToStart <0 ) { - _log(PATHING__DEBUG, "No LOS to any starting Path Node within range."); + logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any starting Path Node within range."); return -1; } return ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { - _log(PATHING__DEBUG, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); return false; } else { - _log(PATHING__DEBUG, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + logger.LogDebug(EQEmuLogSys::Detail, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); if (ABS(NewZ - last_z) > 5.0f) { - _log(PATHING__DEBUG, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", + logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } if (best_z2 == -999990) { - _log(PATHING__DEBUG, " HAZARD DETECTED, really deep water/lava!"); + logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED, really deep water/lava!"); return false; } else { if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { - _log(PATHING__DEBUG, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); + logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); return false; } else { - _log(PATHING__DEBUG, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); + logger.LogDebug(EQEmuLogSys::Detail, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); } } } else { - _log(PATHING__DEBUG, "Hazard point not in water or lava!"); + logger.LogDebug(EQEmuLogSys::Detail, "Hazard point not in water or lava!"); } } else { - _log(PATHING__DEBUG, "No water map loaded for hazards!"); + logger.LogDebug(EQEmuLogSys::Detail, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) if(d && !d->IsDoorOpen() ) { - _log(PATHING__DEBUG, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); + logger.LogDebug(EQEmuLogSys::Detail, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); d->ForceOpen(ForWho); } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index d6df3a896..7e4a05818 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z safe_delete(outapp); } - _log(NET__DEBUG, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); + logger.LogDebug(EQEmuLogSys::Detail, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); //Clear zonesummon variables if we're zoning to our own zone //Client wont generate a zone change packet to the server in this case so //They aren't needed and it keeps behavior on next zone attempt from being undefined. From d459c144fefa118bca03a26c5509c916b63cbbb4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 18:38:04 -0600 Subject: [PATCH 021/707] replace mlog with logger.LogDebug --- zone/fearpath.cpp | 4 +-- zone/pathing.cpp | 90 +++++++++++++++++++++++------------------------ 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index f4354e709..e2e3be399 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; curfp = true; - mlog(PATHING__DEBUG, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); + logger.LogDebug(EQEmuLogSys::Detail, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } - mlog(PATHING__DEBUG, "No path found to selected node. Falling through to old fear point selection."); + logger.LogDebug(EQEmuLogSys::Detail, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; diff --git a/zone/pathing.cpp b/zone/pathing.cpp index a998bf395..dc0d4cb40 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) return To; - mlog(PATHING__DEBUG, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); + logger.LogDebug(EQEmuLogSys::Detail, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); if(From == PathingLastPosition) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((PathingLoopCount > 5) && !IsRooted()) { - mlog(PATHING__DEBUG, "appears to be stuck. Teleporting them to next position.", GetName()); + logger.LogDebug(EQEmuLogSys::Detail, "appears to be stuck. Teleporting them to next position.", GetName()); if(Route.size() == 0) { @@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // If we are already pathing, and the destination is the same as before ... if(SameDestination) { - mlog(PATHING__DEBUG, " Still pathing to the same destination."); + logger.LogDebug(EQEmuLogSys::Detail, " Still pathing to the same destination."); // Get the coordinates of the first path node we are going to. NextNode = Route.front(); @@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // We have reached the path node. if(NodeLoc == From) { - mlog(PATHING__DEBUG, " Arrived at node %i", NextNode); + logger.LogDebug(EQEmuLogSys::Detail, " Arrived at node %i", NextNode); NodeReached = true; @@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // target, and we may run past the target if we don't check LOS at this point. int RouteSize = Route.size(); - mlog(PATHING__DEBUG, "Route size is %i", RouteSize); + logger.LogDebug(EQEmuLogSys::Detail, "Route size is %i", RouteSize); if((RouteSize == 2) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check())) { - mlog(PATHING__DEBUG, " Checking distance to target."); + logger.LogDebug(EQEmuLogSys::Detail, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - mlog(PATHING__DEBUG, " Distance between From and To (NoRoot) is %8.3f", Distance); + logger.LogDebug(EQEmuLogSys::Detail, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS"); + logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - mlog(PATHING__DEBUG, " No hazards. Running directly to target."); + logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); Route.clear(); return To; } else { - mlog(PATHING__DEBUG, " Continuing on node path."); + logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - mlog(PATHING__DEBUG, "Missing node after teleport."); + logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - mlog(PATHING__DEBUG, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + logger.LogDebug(EQEmuLogSys::Detail, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); - mlog(PATHING__DEBUG, " Now moving to node %i", NextNode); + logger.LogDebug(EQEmuLogSys::Detail, " Now moving to node %i", NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode); } @@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // we have run all the nodes, all that is left is the direct path from the last node // to the destination - mlog(PATHING__DEBUG, " Reached end of node path, running direct to target."); + logger.LogDebug(EQEmuLogSys::Detail, " Reached end of node path, running direct to target."); return To; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check()) { - mlog(PATHING__DEBUG, " Checking distance to target."); + logger.LogDebug(EQEmuLogSys::Detail, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - mlog(PATHING__DEBUG, " Distance between From and To (NoRoot) is %8.3f", Distance); + logger.LogDebug(EQEmuLogSys::Detail, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS"); + logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - mlog(PATHING__DEBUG, " No hazards. Running directly to target."); + logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); Route.clear(); return To; } else { - mlog(PATHING__DEBUG, " Continuing on node path."); + logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); } } else @@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // We get here if we were already pathing, but our destination has now changed. // - mlog(PATHING__DEBUG, " Target has changed position."); + logger.LogDebug(EQEmuLogSys::Detail, " Target has changed position."); // Update our record of where we are going to. PathingDestination = To; // Check if we now have LOS etc to the new destination. @@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - mlog(PATHING__DEBUG, " Checking for short LOS at distance %8.3f.", Distance); + logger.LogDebug(EQEmuLogSys::Detail, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS"); + logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - mlog(PATHING__DEBUG, " No hazards. Running directly to target."); + logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); Route.clear(); return To; } else { - mlog(PATHING__DEBUG, " Continuing on node path."); + logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); } } } @@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { if(!PathingRouteUpdateTimerShort->Check()) { - mlog(PATHING__DEBUG, "Short route update timer not yet expired."); + logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - mlog(PATHING__DEBUG, "Short route update timer expired."); + logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer expired."); } else { if(!PathingRouteUpdateTimerLong->Check()) { - mlog(PATHING__DEBUG, "Long route update timer not yet expired."); + logger.LogDebug(EQEmuLogSys::Detail, "Long route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - mlog(PATHING__DEBUG, "Long route update timer expired."); + logger.LogDebug(EQEmuLogSys::Detail, "Long route update timer expired."); } // We are already pathing, destination changed, no LOS. Find the nearest node to our destination. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. if(DestinationPathNode == -1) { - mlog(PATHING__DEBUG, " Unable to find path node for new destination. Running straight to target."); + logger.LogDebug(EQEmuLogSys::Detail, " Unable to find path node for new destination. Running straight to target."); Route.clear(); return To; } @@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // one, we will carry on on our path. if(DestinationPathNode == Route.back()) { - mlog(PATHING__DEBUG, " Same destination Node (%i). Continue with current path.", DestinationPathNode); + logger.LogDebug(EQEmuLogSys::Detail, " Same destination Node (%i). Continue with current path.", DestinationPathNode); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); @@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Check if we have reached a path node. if(NodeLoc == From) { - mlog(PATHING__DEBUG, " Arrived at node %i, moving to next one.\n", Route.front()); + logger.LogDebug(EQEmuLogSys::Detail, " Arrived at node %i, moving to next one.\n", Route.front()); NodeReached = true; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - mlog(PATHING__DEBUG, "Missing node after teleport."); + logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - mlog(PATHING__DEBUG, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + logger.LogDebug(EQEmuLogSys::Detail, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // Return the coords of our next path node on the route. - mlog(PATHING__DEBUG, " Now moving to node %i", NextNode); + logger.LogDebug(EQEmuLogSys::Detail, " Now moving to node %i", NextNode); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - mlog(PATHING__DEBUG, " Reached end of path grid. Running direct to target."); + logger.LogDebug(EQEmuLogSys::Detail, " Reached end of path grid. Running direct to target."); return To; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - mlog(PATHING__DEBUG, " Target moved. End node is different. Clearing route."); + logger.LogDebug(EQEmuLogSys::Detail, " Target moved. End node is different. Clearing route."); Route.clear(); // We will now fall through to get a new route. @@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } - mlog(PATHING__DEBUG, " Our route list is empty."); + logger.LogDebug(EQEmuLogSys::Detail, " Our route list is empty."); if((SameDestination) && !PathingLOSCheckTimer->Check()) { - mlog(PATHING__DEBUG, " Destination same as before, LOS check timer not reached. Returning To."); + logger.LogDebug(EQEmuLogSys::Detail, " Destination same as before, LOS check timer not reached. Returning To."); return To; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - mlog(PATHING__DEBUG, " Checking for long LOS at distance %8.3f.", Distance); + logger.LogDebug(EQEmuLogSys::Detail, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - mlog(PATHING__DEBUG, " LOS stats is %s", (PathingLOSState == HaveLOS) ? "HaveLOS" : "NoLOS"); + logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - mlog(PATHING__DEBUG, "Target is reachable. Running directly there."); + logger.LogDebug(EQEmuLogSys::Detail, "Target is reachable. Running directly there."); return To; } } - mlog(PATHING__DEBUG, " Calculating new route to target."); + logger.LogDebug(EQEmuLogSys::Detail, " Calculating new route to target."); Route = zone->pathing->FindRoute(From, To); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - mlog(PATHING__DEBUG, " No route available, running direct."); + logger.LogDebug(EQEmuLogSys::Detail, " No route available, running direct."); return To; } if(SameDestination && (Route.front() == PathingLastNodeVisited)) { - mlog(PATHING__DEBUG, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); + logger.LogDebug(EQEmuLogSys::Detail, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Route.clear(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - mlog(PATHING__DEBUG, " New route determined, heading for node %i", Route.front()); + logger.LogDebug(EQEmuLogSys::Detail, " New route determined, heading for node %i", Route.front()); PathingLoopCount = 0; From b2a1597e734044f534208b03fe3aa36f1cb34c00 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 18:52:27 -0600 Subject: [PATCH 022/707] More _log Client replacements --- zone/client_packet.cpp | 2 +- zone/inventory.cpp | 6 ++---- zone/perl_client.cpp | 16 ++++++++-------- zone/trading.cpp | 14 +++++++------- zone/worldserver.cpp | 2 +- zone/zonedb.cpp | 26 +++++++++++++------------- zone/zoning.cpp | 8 ++++---- 7 files changed, 36 insertions(+), 38 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index c3f8ef6c0..33f597fff 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. if (!CanBeInZone()) { - _log(CLIENT__ERROR, "Kicking char from zone, not allowed here"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Kicking char from zone, not allowed here"); GoToSafeCoords(database.GetZoneID("arena"), 0); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index d1b3d3ba0..6dfaa28c2 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2848,8 +2848,6 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool if (autolog && error && (!log)) log = true; - if (log) - _log(INVENTORY__ERROR, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); if (!silent) requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); @@ -2868,7 +2866,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool if (log) { _log(INVENTORY__ERROR, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - _log(INVENTORY__ERROR, "Client::InterrogateInventory() -- End"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); @@ -2883,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) { if (depth >= 10) { - _log(INVENTORY__ERROR, "Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); return; } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index d3cec99e2..82600923d 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { if (THIS->IsMerc()) - _log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - _log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process a type NPC reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - _log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); #endif else - _log(CLIENT__ERROR, "Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { if (THIS->IsMerc()) - _log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - _log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - _log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); #endif else - _log(CLIENT__ERROR, "Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); diff --git a/zone/trading.cpp b/zone/trading.cpp index fa3c8783f..eb8399ac8 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; if (partial_inst->GetID() != inst->GetID()) { - _log(TRADING__ERROR, "Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; if (partial_inst->GetID() != inst->GetID()) { - _log(TRADING__ERROR, "Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(TRADING__CLIENT, "Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1836,7 +1836,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - _log(TRADING__CLIENT, "Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); if(!gis) { - _log(TRADING__CLIENT, "Error retrieving Trader items details to update price."); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Error retrieving Trader items details to update price."); return; } @@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { // This method is called when a potential seller in the /barter window searches for matching buyers // - _log(TRADING__BARTER, "Client::SendBuyerResults %s\n", searchString); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::SendBuyerResults %s\n", searchString); char* escSearchString = new char[strlen(searchString) * 2 + 1]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - _log(TRADING__CLIENT, "Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 9839ec3a1..41220437a 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -387,7 +387,7 @@ void WorldServer::Process() { } else { #ifdef _EQDEBUG - _log(ZONE__WORLD, "Error: WhoAllReturnStruct did not point to a valid client! " + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] "id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); #endif diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 61cbaaada..c16739e16 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -619,7 +619,7 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -630,7 +630,7 @@ void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int3 Charges, CharID, SerialNumber); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", SerialNumber, CharID, results.ErrorMessage().c_str()); } @@ -650,7 +650,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 char_id){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); return; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { @@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteBuyLines(uint32 CharID) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); return; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); } @@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons CharID, BuySlot, ItemID, ItemName, Quantity, Price); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity) std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - _log(TRADING__CLIENT, "Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 7e4a05818..741a2fbd2 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //this should not happen... - _log(CLIENT__ERROR, "Unable to query zone info for ourself '%s'", zone->GetShortName()); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); return(false); } if(GetLevel() < minlevel) { - _log(CLIENT__ERROR, "Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); return(false); } if(Admin() < minstatus) { - _log(CLIENT__ERROR, "Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); return(false); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { - _log(CLIENT__ERROR, "Character does not have the flag to be in this zone (%s)!", flag_needed); + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); return(false); } } From 7e7c59967cfb3f0a87acf9d6b8dbad4b1b6026c5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 19:05:46 -0600 Subject: [PATCH 023/707] _log error convert to logger.Log(EQEmuLogSys::Error --- zone/bot.cpp | 2 +- zone/client.cpp | 6 +++--- zone/client_packet.cpp | 6 +++--- zone/guild_mgr.cpp | 28 ++++++++++++++-------------- zone/inventory.cpp | 10 +++++----- zone/merc.cpp | 2 +- zone/mob_ai.cpp | 2 +- zone/net.cpp | 32 ++++++++++++++++---------------- zone/spawngroup.cpp | 9 +++------ zone/trading.cpp | 12 ++++++------ zone/worldserver.cpp | 4 ++-- 11 files changed, 55 insertions(+), 58 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 013f08a74..bde330f03 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -15456,7 +15456,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - _log(AI__ERROR, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/client.cpp b/zone/client.cpp index cd62b3331..abb7725ba 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -8296,11 +8296,11 @@ std::string Client::TextLink::GenerateLink() if ((m_Link.length() == 0) || (m_Link.length() > 250)) { m_Error = true; m_Link = ""; - _log(CHANNELS__ERROR, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", + logger.Log(EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length()); #if EQDEBUG >= 5 - _log(CHANNELS__ERROR, ">> LinkBody: %s", m_LinkBody.c_str()); - _log(CHANNELS__ERROR, ">> LinkText: %s", m_LinkText.c_str()); + logger.Log(EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); + logger.Log(EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); #endif } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 33f597fff..c6f8fce39 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6893,7 +6893,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if ((Action != GuildBankDeposit) && (Action != GuildBankViewItem) && (Action != GuildBankWithdraw)) { - _log(GUILDS__BANK_ERROR, "Suspected hacking attempt on guild bank from %s", GetName()); + logger.Log(EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); GuildBankAck(); @@ -7054,7 +7054,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsGuildBanker() && !GuildBanks->AllowedToWithdraw(GuildID(), gbwis->Area, gbwis->SlotID, GetName())) { - _log(GUILDS__BANK_ERROR, "Suspected attempted hack on the guild bank from %s", GetName()); + logger.Log(EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); GuildBankAck(); @@ -7125,7 +7125,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "Unexpected GuildBank action."); - _log(GUILDS__BANK_ERROR, "Received unexpected guild bank action code %i from %s", Action, GetName()); + logger.Log(EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } } } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 5d42846e4..50c37aded 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -261,7 +261,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { switch(pack->opcode) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + logger.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; @@ -295,7 +295,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + logger.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { { if(pack->size != sizeof(ServerGuildRankUpdate_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", + logger.Log(EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRankUpdate_Struct)); return; @@ -364,7 +364,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + logger.Log(EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; @@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__BANK_ERROR, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c) if(Iterator == Banks.end()) { - _log(GUILDS__BANK_ERROR, "Unable to find guild bank for guild ID %i", c->GuildID()); + logger.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); return; } @@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Iterator == Banks.end()) { - _log(GUILDS__BANK_ERROR, "Unable to find guild bank for guild ID %i", GuildID); + logger.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); return false; } @@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Slot < 0) { - _log(GUILDS__BANK_ERROR, "No space to add item to the guild bank."); + logger.Log(EQEmuLogSys::Error, "No space to add item to the guild bank."); return false; } @@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__BANK_ERROR, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - _log(GUILDS__BANK_ERROR, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__BANK_ERROR, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__BANK_ERROR, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__BANK_ERROR, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__BANK_ERROR, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 6dfaa28c2..19fca9f47 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2594,7 +2594,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - _log(INVENTORY__BANDOLIER, "Char: %s, ERROR returning %s to inventory", GetName(), + logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(InvItem) { // If there was already an item in that weapon slot that we replaced, find a place to put it if(!MoveItemToInventory(InvItem)) - _log(INVENTORY__BANDOLIER, "Char: %s, ERROR returning %s to inventory", GetName(), + logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2646,7 +2646,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - _log(INVENTORY__BANDOLIER, "Char: %s, ERROR returning %s to inventory", GetName(), + logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2865,7 +2865,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (log) { - _log(INVENTORY__ERROR, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + logger.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { @@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea else { e = ""; } if (log) - _log(INVENTORY__ERROR, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", + logger.Log(EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); if (!silent) requester->Message(1, "%i:%i - inst: %s - parent: %s%s", diff --git a/zone/merc.cpp b/zone/merc.cpp index 0d9a225f2..f482ab71a 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - _log(AI__ERROR, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 5802bfd93..e359194b5 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - _log(AI__ERROR, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/net.cpp b/zone/net.cpp index c339e393f..a26a7c1fa 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -150,7 +150,7 @@ int main(int argc, char** argv) { _log(ZONE__INIT, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { - _log(ZONE__INIT_ERR, "Loading server configuration failed."); + logger.Log(EQEmuLogSys::Error, "Loading server configuration failed."); return 1; } const ZoneConfig *Config=ZoneConfig::get(); @@ -169,7 +169,7 @@ int main(int argc, char** argv) { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - _log(ZONE__INIT_ERR, "Cannot continue without a database connection."); + logger.Log(EQEmuLogSys::Error, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -192,16 +192,16 @@ int main(int argc, char** argv) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - _log(ZONE__INIT_ERR, "Could not set signal handler"); + logger.Log(EQEmuLogSys::Error, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - _log(ZONE__INIT_ERR, "Could not set signal handler"); + logger.Log(EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - _log(ZONE__INIT_ERR, "Could not set signal handler"); + logger.Log(EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #endif @@ -220,25 +220,25 @@ int main(int argc, char** argv) { database.LoadZoneNames(); _log(ZONE__INIT, "Loading items"); if (!database.LoadItems()) { - _log(ZONE__INIT_ERR, "Loading items FAILED!"); - _log(ZONE__INIT, "Failed. But ignoring error and going on..."); + logger.Log(EQEmuLogSys::Error, "Loading items FAILED!"); + logger.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } _log(ZONE__INIT, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { - _log(ZONE__INIT_ERR, "Loading npcs faction lists FAILED!"); + logger.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } _log(ZONE__INIT, "Loading loot tables"); if (!database.LoadLoot()) { - _log(ZONE__INIT_ERR, "Loading loot FAILED!"); + logger.Log(EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } _log(ZONE__INIT, "Loading skill caps"); if (!database.LoadSkillCaps()) { - _log(ZONE__INIT_ERR, "Loading skill caps FAILED!"); + logger.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } @@ -249,7 +249,7 @@ int main(int argc, char** argv) { _log(ZONE__INIT, "Loading base data"); if (!database.LoadBaseData()) { - _log(ZONE__INIT_ERR, "Loading base data FAILED!"); + logger.Log(EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } @@ -269,7 +269,7 @@ int main(int argc, char** argv) { _log(ZONE__INIT, "Loading commands"); int retval=command_init(); if(retval<0) - _log(ZONE__INIT_ERR, "Command loading FAILED"); + logger.Log(EQEmuLogSys::Error, "Command loading FAILED"); else _log(ZONE__INIT, "%d commands loaded", retval); @@ -279,7 +279,7 @@ int main(int argc, char** argv) { if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { _log(ZONE__INIT, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - _log(ZONE__INIT_ERR, "Failed to load ruleset '%s', falling back to defaults.", tmp); + logger.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { @@ -318,7 +318,7 @@ int main(int argc, char** argv) { LogFile->SetAllCallbacks(ClientLogs::EQEmuIO_pva); #endif if (!worldserver.Connect()) { - _log(ZONE__INIT_ERR, "worldserver.Connect() FAILED!"); + logger.Log(EQEmuLogSys::Error, "worldserver.Connect() FAILED!"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -331,7 +331,7 @@ int main(int argc, char** argv) { if (!strlen(zone_name) || !strcmp(zone_name,".")) { _log(ZONE__INIT, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - _log(ZONE__INIT_ERR, "Zone bootup FAILED!"); + logger.Log(EQEmuLogSys::Error, "Zone bootup FAILED!"); zone = 0; } @@ -368,7 +368,7 @@ int main(int argc, char** argv) { // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); if (!eqsf.Open(Config->ZonePort)) { - _log(ZONE__INIT_ERR, "Failed to open port %d",Config->ZonePort); + logger.Log(EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); worldserver.Disconnect(); worldwasconnected = false; diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index d6745ed6b..bc1e21451 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -149,7 +149,6 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND spawn2.version = %u and zone = '%s'", version, zone_name); auto results = QueryDatabase(query); if (!results.Success()) { - _log(ZONE__SPAWNS, "Error2 in PopulateZoneLists query '%s' ", query.c_str()); return false; } @@ -168,7 +167,7 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND zone = '%s'", zone_name); results = QueryDatabase(query); if (!results.Success()) { - _log(ZONE__SPAWNS, "Error2 in PopulateZoneLists query '%'", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); return false; } @@ -177,7 +176,6 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG SpawnGroup *sg = spawn_group_list->GetSpawnGroup(atoi(row[0])); if (!sg) { - _log(ZONE__SPAWNS, "Error in LoadSpawnGroups %s ", query.c_str()); continue; } @@ -197,7 +195,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroupid); auto results = QueryDatabase(query); if (!results.Success()) { - _log(ZONE__SPAWNS, "Error2 in PopulateZoneLists query %s", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); return false; } @@ -212,7 +210,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "ORDER BY chance", spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - _log(ZONE__SPAWNS, "Error3 in PopulateZoneLists query '%s'", query.c_str()); + logger.Log(EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); return false; } @@ -220,7 +218,6 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g SpawnEntry* newSpawnEntry = new SpawnEntry( atoi(row[1]), atoi(row[2]), row[3]?atoi(row[3]):0); SpawnGroup *sg = spawn_group_list->GetSpawnGroup(atoi(row[0])); if (!sg) { - _log(ZONE__SPAWNS, "Error in SpawngroupID: %s ", row[0]); continue; } diff --git a/zone/trading.cpp b/zone/trading.cpp index eb8399ac8..41f9047e2 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -2515,7 +2515,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Quantity = i; break; } - _log(TRADING__BARTER, "Unexpected error while moving item from seller to buyer."); + logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2523,7 +2523,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { - _log(TRADING__BARTER, "Unexpected error while moving item from seller to buyer."); + logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); if(ItemToTransfer) @@ -2561,7 +2561,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { int16 SellerSlot = m_inv.HasItem(ItemID, 1, invWhereWorn|invWherePersonal|invWhereCursor); if (SellerSlot == INVALID_INDEX) { - _log(TRADING__BARTER, "Unexpected error while moving item from seller to buyer."); + logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2569,7 +2569,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer) { - _log(TRADING__BARTER, "Unexpected error while moving item from seller to buyer."); + logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2581,7 +2581,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { QuantityMoved += ItemToTransfer->GetCharges(); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - _log(TRADING__BARTER, "Unexpected error while moving item from seller to buyer."); + logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2616,7 +2616,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemToTransfer->SetCharges(QuantityToRemoveFromStack); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - _log(TRADING__BARTER, "Unexpected error while moving item from seller to buyer."); + logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 41220437a..f8d4ff63e 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -394,7 +394,7 @@ void WorldServer::Process() { } } else - _log(ZONE__WORLD_ERR, "WhoAllReturnStruct: Could not get return struct!"); + logger.Log(EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); break; } case ServerOP_EmoteMessage: { @@ -2064,7 +2064,7 @@ uint32 WorldServer::NextGroupID() { if(cur_groupid >= last_groupid) { //this is an error... This means that 50 groups were created before //1 packet could make the zone->world->zone trip... so let it error. - _log(ZONE__WORLD_ERR, "Ran out of group IDs before the server sent us more."); + logger.Log(EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); return(0); } if(cur_groupid > (last_groupid - /*50*/995)) { From 167e11426f8fb469d3344492a9703c8ac3427fca Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 19:32:07 -0600 Subject: [PATCH 024/707] Log Message reword for zone and world bootup failure --- zone/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index a26a7c1fa..2ab8a0e2e 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -318,7 +318,7 @@ int main(int argc, char** argv) { LogFile->SetAllCallbacks(ClientLogs::EQEmuIO_pva); #endif if (!worldserver.Connect()) { - logger.Log(EQEmuLogSys::Error, "worldserver.Connect() FAILED!"); + logger.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -331,7 +331,7 @@ int main(int argc, char** argv) { if (!strlen(zone_name) || !strcmp(zone_name,".")) { _log(ZONE__INIT, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - logger.Log(EQEmuLogSys::Error, "Zone bootup FAILED!"); + logger.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; } From 17d9b9199c55d59ce0ced383ee9531f541df25a6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 19:36:15 -0600 Subject: [PATCH 025/707] Replace rest of EQEmuLog->write with EQEmuLogSys Log --- client_files/export/main.cpp | 30 +++++------ client_files/import/main.cpp | 28 +++++------ common/crash.cpp | 45 +++++++++-------- common/database.cpp | 34 ++++++------- common/eq_stream.cpp | 3 +- common/eqtime.cpp | 7 +-- common/guild_base.cpp | 2 +- common/item.cpp | 2 +- common/ptimer.cpp | 14 +++--- common/rulesys.cpp | 8 +-- common/shareddb.cpp | 98 ++++++++++++++++++------------------ common/timeoutmgr.cpp | 6 +-- queryserv/database.cpp | 5 +- shared_memory/main.cpp | 34 ++++++------- ucs/database.cpp | 5 +- world/adventure.cpp | 4 +- world/adventure_manager.cpp | 6 +-- world/eql_config.cpp | 22 ++++---- world/worlddb.cpp | 18 +++---- 19 files changed, 188 insertions(+), 183 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 87874fc61..d76ae12cd 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -37,22 +37,22 @@ int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientExport); set_exception_handler(); - LogFile->write(EQEmuLog::Status, "Client Files Export Utility"); + logger.Log(EQEmuLogSys::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { - LogFile->write(EQEmuLog::Error, "Unable to load configuration file."); + logger.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - LogFile->write(EQEmuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - LogFile->write(EQEmuLog::Status, "Connecting to database..."); + logger.Log(EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - LogFile->write(EQEmuLog::Error, "Unable to connect to the database, cannot continue without a " + logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -65,11 +65,11 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - LogFile->write(EQEmuLog::Status, "Exporting Spells..."); + logger.Log(EQEmuLogSys::Status, "Exporting Spells..."); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { - LogFile->write(EQEmuLog::Error, "Unable to open export/spells_us.txt to write, skipping."); + logger.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); return; } @@ -93,7 +93,7 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - LogFile->write(EQEmuLog::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); @@ -107,7 +107,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -127,7 +127,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -139,11 +139,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - LogFile->write(EQEmuLog::Status, "Exporting Skill Caps..."); + logger.Log(EQEmuLogSys::Status, "Exporting Skill Caps..."); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { - LogFile->write(EQEmuLog::Error, "Unable to open export/SkillCaps.txt to write, skipping."); + logger.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); return; } @@ -168,11 +168,11 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - LogFile->write(EQEmuLog::Status, "Exporting Base Data..."); + logger.Log(EQEmuLogSys::Status, "Exporting Base Data..."); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { - LogFile->write(EQEmuLog::Error, "Unable to open export/BaseData.txt to write, skipping."); + logger.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); return; } @@ -194,7 +194,7 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - LogFile->write(EQEmuLog::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 390c1c109..7e1eb7557 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -35,22 +35,22 @@ int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientImport); set_exception_handler(); - LogFile->write(EQEmuLog::Status, "Client Files Import Utility"); + logger.Log(EQEmuLogSys::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { - LogFile->write(EQEmuLog::Error, "Unable to load configuration file."); + logger.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - LogFile->write(EQEmuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - LogFile->write(EQEmuLog::Status, "Connecting to database..."); + logger.Log(EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - LogFile->write(EQEmuLog::Error, "Unable to connect to the database, cannot continue without a " + logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -67,7 +67,7 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -75,10 +75,10 @@ int GetSpellColumns(SharedDatabase *db) { } void ImportSpells(SharedDatabase *db) { - LogFile->write(EQEmuLog::Status, "Importing Spells..."); + logger.Log(EQEmuLogSys::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { - LogFile->write(EQEmuLog::Error, "Unable to open import/spells_us.txt to read, skipping."); + logger.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); return; } @@ -141,23 +141,23 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - LogFile->write(EQEmuLog::Status, "%d spells imported.", spells_imported); + logger.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); } } if(spells_imported % 1000 != 0) { - LogFile->write(EQEmuLog::Status, "%d spells imported.", spells_imported); + logger.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - LogFile->write(EQEmuLog::Status, "Importing Skill Caps..."); + logger.Log(EQEmuLogSys::Status, "Importing Skill Caps..."); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { - LogFile->write(EQEmuLog::Error, "Unable to open import/SkillCaps.txt to read, skipping."); + logger.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); return; } @@ -189,11 +189,11 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - LogFile->write(EQEmuLog::Status, "Importing Base Data..."); + logger.Log(EQEmuLogSys::Status, "Importing Base Data..."); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { - LogFile->write(EQEmuLog::Error, "Unable to open import/BaseData.txt to read, skipping."); + logger.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); return; } diff --git a/common/crash.cpp b/common/crash.cpp index cd7389c09..94a8fb928 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -1,4 +1,5 @@ #include "debug.h" +#include "eqemu_logsys.h" #include "crash.h" #if defined(_WINDOWS) && defined(CRASH_LOGGING) @@ -24,7 +25,7 @@ public: } } - LogFile->write(EQEmuLog::Crash, buffer); + logger.Log(EQEmuLogSys::Crash, buffer); StackWalker::OnOutput(szText); } }; @@ -34,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) switch(ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_ACCESS_VIOLATION"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); break; case EXCEPTION_BREAKPOINT: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_BREAKPOINT"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); break; case EXCEPTION_DATATYPE_MISALIGNMENT: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); break; case EXCEPTION_FLT_DENORMAL_OPERAND: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); break; case EXCEPTION_FLT_INEXACT_RESULT: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); break; case EXCEPTION_FLT_INVALID_OPERATION: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); break; case EXCEPTION_FLT_OVERFLOW: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_OVERFLOW"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); break; case EXCEPTION_FLT_STACK_CHECK: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_STACK_CHECK"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); break; case EXCEPTION_FLT_UNDERFLOW: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_FLT_UNDERFLOW"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); break; case EXCEPTION_ILLEGAL_INSTRUCTION: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); break; case EXCEPTION_IN_PAGE_ERROR: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_IN_PAGE_ERROR"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); break; case EXCEPTION_INT_OVERFLOW: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_INT_OVERFLOW"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); break; case EXCEPTION_INVALID_DISPOSITION: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_INVALID_DISPOSITION"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); break; case EXCEPTION_NONCONTINUABLE_EXCEPTION: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); break; case EXCEPTION_PRIV_INSTRUCTION: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_PRIV_INSTRUCTION"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); break; case EXCEPTION_SINGLE_STEP: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_SINGLE_STEP"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); break; case EXCEPTION_STACK_OVERFLOW: - LogFile->write(EQEmuLog::Crash, "EXCEPTION_STACK_OVERFLOW"); + logger.Log(EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); break; default: - LogFile->write(EQEmuLog::Crash, "Unknown Exception"); + logger.Log(EQEmuLogSys::Crash, "Unknown Exception"); break; } diff --git a/common/database.cpp b/common/database.cpp index 39f78cfa6..f852ae37e 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -84,12 +84,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - LogFile->write(EQEmuLog::Error, "Failed to connect to database: Error: %s", errbuf); + logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); return false; } else { - LogFile->write(EQEmuLog::Status, "Using database '%s' at %s:%d",database,host,port); + logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid = GetCharacterID(pp->name); if(!charid) { - LogFile->write(EQEmuLog::Error, "StoreCharacter: no character id"); + logger.Log(EQEmuLogSys::Error, "StoreCharacter: no character id"); return false; } @@ -736,10 +736,10 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - LogFile->write(EQEmuLog::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else - LogFile->write(EQEmuLog::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); + logger.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); #endif } @@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::AddReport(std::string who, std::string against, std::string lines) { @@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines safe_delete_array(escape_str); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { @@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); return; } @@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); } void Database::ClearAllGroups(void) @@ -3255,14 +3255,14 @@ uint32 Database::GetGroupID(const char* name){ if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); return 0; } if (results.RowCount() == 0) { // Commenting this out until logging levels can prevent this from going to console - //LogFile->write(EQEmuLog::Debug, "Character not in a group: %s", name); + //logger.Log(EQEmuLogSys::Debug, "Character not in a group: %s", name); return 0; } @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - LogFile->write(EQEmuLog::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } @@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 3e89e2fc3..70e9ab43f 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -17,6 +17,7 @@ */ #include "debug.h" +#include "eqemu_logsys.h" #include "eq_packet.h" #include "eq_stream.h" #include "op_codes.h" @@ -987,7 +988,7 @@ EQRawApplicationPacket *p=nullptr; EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); #if EQDEBUG >= 4 if(emu_op == OP_Unknown) { - LogFile->write(EQEmuLog::Debug, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + logger.Log(EQEmuLogSys::Debug, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } #endif p->SetOpcode(emu_op); diff --git a/common/eqtime.cpp b/common/eqtime.cpp index bff36bc4c..4ffd66bb3 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -18,6 +18,7 @@ #include #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/eqtime.h" #include "../common/eq_packet_structs.h" #include @@ -140,7 +141,7 @@ bool EQTime::saveFile(const char *filename) of.open(filename); if(!of) { - LogFile->write(EQEmuLog::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); + logger.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); return false; } //Enable for debugging @@ -164,14 +165,14 @@ bool EQTime::loadFile(const char *filename) in.open(filename); if(!in) { - LogFile->write(EQEmuLog::Error, "Could not load EQTime file %s", filename); + logger.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename); return false; } in >> version; in.ignore(80, '\n'); if(version != EQT_VERSION) { - LogFile->write(EQEmuLog::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); + logger.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); return false; } //in >> eqTime.start_eqtime.day; diff --git a/common/guild_base.cpp b/common/guild_base.cpp index f1db14af7..e2a411c6c 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -337,7 +337,7 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } diff --git a/common/item.cpp b/common/item.cpp index c06df3a89..9e8be60f7 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } if (result == INVALID_INDEX) { - LogFile->write(EQEmuLog::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); + logger.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/common/ptimer.cpp b/common/ptimer.cpp index bd753d391..2d6e07c63 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - LogFile->write(EQEmuLog::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - LogFile->write(EQEmuLog::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - LogFile->write(EQEmuLog::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { if (this == nullptr) { - LogFile->write(EQEmuLog::Error, "Null timer during ->Check()!?\n"); + logger.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); return(true); } uint32 current_time = get_current_time(); @@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - LogFile->write(EQEmuLog::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - LogFile->write(EQEmuLog::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - LogFile->write(EQEmuLog::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); #endif return false; } diff --git a/common/rulesys.cpp b/common/rulesys.cpp index ae1b8e5f6..148f2bfc9 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -282,7 +282,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } @@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index c036fb5de..0a8148c8d 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } @@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); return false; } @@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { const Item_Struct* item = GetItem(item_id); if (!item) { - LogFile->write(EQEmuLog::Error, + logger.Log(EQEmuLogSys::Error, "Warning: %s %i has an invalid item_id %i in inventory slot %i", ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); continue; @@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (put_slot_id != INVALID_INDEX) continue; - LogFile->write(EQEmuLog::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", + logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", ((is_charid==true)? "charid": "acctid"), id, item_id, slot_id); if (is_charid) @@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - LogFile->write(EQEmuLog::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + logger.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { const Item_Struct* item = GetItem(item_id); if (!item) { - LogFile->write(EQEmuLog::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); + logger.Log(EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); continue; } @@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { else if (slot_id >= 3111 && slot_id <= 3179) { // Admins: please report any occurrences of this error - LogFile->write(EQEmuLog::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); + logger.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); put_slot_id = inv->PushCursor(*inst); } else @@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) { - LogFile->write(EQEmuLog::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); + logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); } } @@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - LogFile->write(EQEmuLog::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - LogFile->write(EQEmuLog::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + logger.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - LogFile->write(EQEmuLog::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); + logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); } @@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() { items_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(items_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - LogFile->write(EQEmuLog::Error, "Error Loading Items: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); return false; } @@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ try { hash.insert(item.ID, item); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "Database::LoadItems: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); break; } } @@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile) } if (results.RowCount() == 0) { - LogFile->write(EQEmuLog::Error, "No book to send, (%s)", txtfile); + logger.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile); txtout.assign(" ",1); return txtout; } @@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() { faction_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(faction_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - LogFile->write(EQEmuLog::Error, "Error Loading npc factions: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); return false; } @@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst = CreateBaseItem(item, charges); if (inst == nullptr) { - LogFile->write(EQEmuLog::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - LogFile->write(EQEmuLog::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst = CreateBaseItem(item, charges); if (inst == nullptr) { - LogFile->write(EQEmuLog::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - LogFile->write(EQEmuLog::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) inst = new ItemInst(item, charges); if (inst == nullptr) { - LogFile->write(EQEmuLog::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); - LogFile->write(EQEmuLog::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); + logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() { mutex.Unlock(); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "Error loading skill caps: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); return false; } @@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) { const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); return; } @@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() { mutex.Unlock(); } catch(std::exception& ex) { - LogFile->write(EQEmuLog::Error, "Error Loading Base Data: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); return false; } @@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { cl = atoi(row[1]); if(lvl <= 0) { - LogFile->write(EQEmuLog::Error, "Non fatal error: base_data.level <= 0, ignoring."); + logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); continue; } if(lvl >= max_level) { - LogFile->write(EQEmuLog::Error, "Non fatal error: base_data.level >= max_level, ignoring."); + logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); continue; } if(cl <= 0) { - LogFile->write(EQEmuLog::Error, "Non fatal error: base_data.cl <= 0, ignoring."); + logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); continue; } if(cl > 16) { - LogFile->write(EQEmuLog::Error, "Non fatal error: base_data.class > 16, ignoring."); + logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); continue; } @@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; @@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() { loot_drop_mmf->Size()); mutex.Unlock(); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "Error loading loot: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); return false; } @@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { return &loot_table_hash->at(loottable_id); } } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "Could not get loot table: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); } return nullptr; } @@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { return &loot_drop_hash->at(lootdrop_id); } } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "Could not get loot drop: %s", ex.what()); + logger.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); } return nullptr; } diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index 771ce16af..309d24f1a 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() { Timeoutable *it = *cur; if(it->next_check.Check()) { #ifdef TIMEOUT_DEBUG - LogFile->write(EQEmuLog::Debug, "Checking timeout on 0x%x\n", it); + logger.Log(EQEmuLogSys::Debug, "Checking timeout on 0x%x\n", it); #endif it->CheckTimeout(); } @@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) { DeleteMember(who); //just in case... prolly not needed. members.push_back(who); #ifdef TIMEOUT_DEBUG - LogFile->write(EQEmuLog::Debug, "Adding timeoutable 0x%x\n", who); + logger.Log(EQEmuLogSys::Debug, "Adding timeoutable 0x%x\n", who); #endif } void TimeoutManager::DeleteMember(Timeoutable *who) { #ifdef TIMEOUT_DEBUG - LogFile->write(EQEmuLog::Debug, "Removing timeoutable 0x%x\n", who); + logger.Log(EQEmuLogSys::Debug, "Removing timeoutable 0x%x\n", who); #endif std::vector::iterator cur,end; cur = members.begin(); diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 56e09e238..18a852e2b 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -19,6 +19,7 @@ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include #include @@ -68,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - LogFile->write(EQEmuLog::Error, "Failed to connect to database: Error: %s", errbuf); + logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - LogFile->write(EQEmuLog::Status, "Using database '%s' at %s:%d",database,host,port); + logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index dbb1885d1..c7d9f2e42 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -39,22 +39,22 @@ int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformSharedMemory); set_exception_handler(); - LogFile->write(EQEmuLog::Status, "Shared Memory Loader Program"); + logger.Log(EQEmuLogSys::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { - LogFile->write(EQEmuLog::Error, "Unable to load configuration file."); + logger.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - LogFile->write(EQEmuLog::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - LogFile->write(EQEmuLog::Status, "Connecting to database..."); + logger.Log(EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - LogFile->write(EQEmuLog::Error, "Unable to connect to the database, cannot continue without a " + logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -113,61 +113,61 @@ int main(int argc, char **argv) { } if(load_all || load_items) { - LogFile->write(EQEmuLog::Status, "Loading items..."); + logger.Log(EQEmuLogSys::Status, "Loading items..."); try { LoadItems(&database); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "%s", ex.what()); + logger.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_factions) { - LogFile->write(EQEmuLog::Status, "Loading factions..."); + logger.Log(EQEmuLogSys::Status, "Loading factions..."); try { LoadFactions(&database); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "%s", ex.what()); + logger.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_loot) { - LogFile->write(EQEmuLog::Status, "Loading loot..."); + logger.Log(EQEmuLogSys::Status, "Loading loot..."); try { LoadLoot(&database); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "%s", ex.what()); + logger.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_skill_caps) { - LogFile->write(EQEmuLog::Status, "Loading skill caps..."); + logger.Log(EQEmuLogSys::Status, "Loading skill caps..."); try { LoadSkillCaps(&database); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "%s", ex.what()); + logger.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_spells) { - LogFile->write(EQEmuLog::Status, "Loading spells..."); + logger.Log(EQEmuLogSys::Status, "Loading spells..."); try { LoadSpells(&database); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "%s", ex.what()); + logger.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_bd) { - LogFile->write(EQEmuLog::Status, "Loading base data..."); + logger.Log(EQEmuLogSys::Status, "Loading base data..."); try { LoadBaseData(&database); } catch(std::exception &ex) { - LogFile->write(EQEmuLog::Error, "%s", ex.what()); + logger.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } diff --git a/ucs/database.cpp b/ucs/database.cpp index 8b224b936..b73a50711 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -19,6 +19,7 @@ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include #include @@ -73,14 +74,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - LogFile->write(EQEmuLog::Error, "Failed to connect to database: Error: %s", errbuf); + logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - LogFile->write(EQEmuLog::Status, "Using database '%s' at %s:%d",database,host,port); + logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } diff --git a/world/adventure.cpp b/world/adventure.cpp index 98ec087b4..453e3f93f 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); @@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - LogFile->write(EQEmuLog::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index db4b768d8..022448516 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 65d4a5f11..5707d43d7 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() { std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); else { auto row = results.begin(); m_dynamics = atoi(row[0]); @@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() { query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); return; } @@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } @@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } @@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - LogFile->write(EQEmuLog::Error, "Update for unknown zone %s", short_name); + logger.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - LogFile->write(EQEmuLog::Error, "Update for unknown zone %s", short_name); + logger.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 91406b527..5e14dcc59 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,11 +298,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - LogFile->write(EQEmuLog::Status, "Start zone query: %s\n", query.c_str()); + logger.Log(EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* } } else { - LogFile->write(EQEmuLog::Status, "Found starting location in start_zones"); + logger.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - LogFile->write(EQEmuLog::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - LogFile->write(EQEmuLog::Status, "SoF Start zone query: %s\n", query.c_str()); + logger.Log(EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru } } else { - LogFile->write(EQEmuLog::Status, "Found starting location in start_zones"); + logger.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector &rl) { const std::string query = "SELECT name FROM launcher"; auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); return; } @@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) { MailKeyString, CharID); auto results = QueryDatabase(query); if (!results.Success()) - LogFile->write(EQEmuLog::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); } @@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level) std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - LogFile->write(EQEmuLog::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); return false; } From ce0a5cf7b81fabb21cb5aab78302e1bc965fd3ae Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 20:14:27 -0600 Subject: [PATCH 026/707] Add LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...) --- common/eqemu_logsys.cpp | 6 +++++- common/eqemu_logsys.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index ee3cb98ce..28da9d627 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -90,6 +90,10 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } +void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...){ + +} + void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) { if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } @@ -116,7 +120,7 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) auto t = std::time(nullptr); auto tm = *std::localtime(&t); - EQEmuLogSys::ConsoleMessage(log_type, message); + EQEmuLogSys::ConsoleMessage(log_type, output_message); if (process_log){ process_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << StringFormat("[%s] ", TypeNames[log_type]).c_str() << output_message << std::endl; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index fff2af07f..f91a2338b 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -49,6 +49,7 @@ public: void CloseZoneLogs(); void ConsoleMessage(uint16 log_type, const std::string message); void LogDebug(DebugLevel debug_level, std::string message, ...); + void LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...); void Log(uint16 log_type, const std::string message, ...); void StartZoneLogs(const std::string log_name); From b1fbcc51e074c74675a6e41dc29341e9896faa0a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 20:52:51 -0600 Subject: [PATCH 027/707] linux compile fix --- common/eqemu_logsys.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 28da9d627..fd380e1e2 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -25,11 +25,12 @@ #include #include #include -#include + std::ofstream process_log; #ifdef _WINDOWS +#include #include #include #include @@ -90,8 +91,16 @@ void EQEmuLogSys::StartZoneLogs(const std::string log_name) process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } -void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...){ +void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...) +{ + if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } + va_list args; + va_start(args, message); + std::string output_message = vStringFormat(message.c_str(), args); + va_end(args); + + EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) @@ -103,7 +112,7 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); + EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); } void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) From 2159a56b17800b80cfad440bc13d58efb0f2d8eb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 23:25:50 -0600 Subject: [PATCH 028/707] Add log test command #logtest --- zone/command.cpp | 14 +++++++++++++- zone/command.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/zone/command.cpp b/zone/command.cpp index 5d9cfe942..0171aaa7c 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #ifdef _WINDOWS #define strcasecmp _stricmp @@ -428,7 +429,8 @@ int command_init(void) { command_add("open_shop", nullptr, 100, command_merchantopenshop) || command_add("merchant_close_shop", "Closes a merchant shop", 100, command_merchantcloseshop) || command_add("close_shop", nullptr, 100, command_merchantcloseshop) || - command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) + command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || + command_add("logtest", "Performs log performance testing.", 250, command_logtest) ) { command_deinit(); @@ -10665,3 +10667,13 @@ void command_shownumhits(Client *c, const Seperator *sep) c->ShowNumHits(); return; } + +void command_logtest(Client *c, const Seperator *sep){ + clock_t t = std::clock(); /* Function timer start */ + if (sep->IsNumber(1)){ + uint32 i = 0; + for (i = 0; i < atoi(sep->arg[1]); i++){ + logger.LogDebug(EQEmuLogSys::General, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + } + } +} \ No newline at end of file diff --git a/zone/command.h b/zone/command.h index 68e956166..088c83510 100644 --- a/zone/command.h +++ b/zone/command.h @@ -326,6 +326,7 @@ void command_npctype_cache(Client *c, const Seperator *sep); void command_merchantopenshop(Client *c, const Seperator *sep); void command_merchantcloseshop(Client *c, const Seperator *sep); void command_shownumhits(Client *c, const Seperator *sep); +void command_logtest(Client *c, const Seperator *sep); #ifdef EQPROFILE void command_profiledump(Client *c, const Seperator *sep); From 108d3110b64fd921e868820c6ebb52c44f1b90ed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 10 Jan 2015 23:26:10 -0600 Subject: [PATCH 029/707] RULE_BOOL(Logging, EnableConsoleLogging, true) /* Turns on or off ALL logging to console */ RULE_BOOL(Logging, EnableFileLogging, true) /* Turns on or off ALL forms of file logging */ --- common/eqemu_logsys.cpp | 60 ++++++++++++++++++++++++++++++++++------- common/eqemu_logsys.h | 6 +++-- common/ruletypes.h | 5 ++++ 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index fd380e1e2..eab7ee2d9 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -25,7 +25,7 @@ #include #include #include - +#include std::ofstream process_log; @@ -35,6 +35,8 @@ std::ofstream process_log; #include #include #include +#else +#include #endif namespace Console { @@ -65,7 +67,18 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Debug", "Quest", "Command", - "Crash" + "Crash", + "Save", + "UCS", + "Query Server", + "Socket Server", + "Spawns", + "AI", + "Pathing", + "Quests", + "Spells", + "Zone", + }; static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { Console::Color::Yellow, // "Status", @@ -86,7 +99,7 @@ EQEmuLogSys::~EQEmuLogSys(){ void EQEmuLogSys::StartZoneLogs(const std::string log_name) { - _mkdir("logs/zone"); + EQEmuLogSys::MakeDirectory("logs/zone"); std::cout << "Starting Zone Logs..." << std::endl; process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } @@ -115,6 +128,22 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); } +void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ + time_t raw_time; + struct tm * time_info; + time(&raw_time); + time_info = localtime(&raw_time); + strftime(time_stamp, 80, "[%d-%m-%Y :: %H:%M:%S]", time_info); +} + +void EQEmuLogSys::MakeDirectory(std::string directory_name){ +#ifdef _WINDOWS + _mkdir(directory_name.c_str()); +#else + mkdir(directory_name.c_str()); +#endif +} + void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { if (log_type > EQEmuLogSys::MaxLogID){ @@ -122,20 +151,25 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) } if (!RuleB(Logging, LogFileCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } + if (!RuleB(Logging, EnableFileLogging)){ + return; + } + va_list args; va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - auto t = std::time(nullptr); - auto tm = *std::localtime(&t); EQEmuLogSys::ConsoleMessage(log_type, output_message); + char time_stamp[80]; + EQEmuLogSys::SetCurrentTimeStamp(time_stamp); + if (process_log){ - process_log << std::put_time(&tm, "[%d-%m-%Y :: %H:%M:%S] ") << StringFormat("[%s] ", TypeNames[log_type]).c_str() << output_message << std::endl; + process_log << time_stamp << " " << StringFormat("[%s] ", TypeNames[log_type]).c_str() << output_message << std::endl; } else{ - std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << std::endl; + std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; } } @@ -144,6 +178,9 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) if (log_type > EQEmuLogSys::MaxLogID){ return; } + if (!RuleB(Logging, EnableConsoleLogging)){ + return; + } if (!RuleB(Logging, ConsoleLogCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } #ifdef _WINDOWS @@ -155,10 +192,15 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) info.FontWeight = FW_NORMAL; wcscpy(info.FaceName, L"Lucida Console"); SetCurrentConsoleFontEx(console_handle, NULL, &info); - SetConsoleTextAttribute(console_handle, LogColors[log_type]); + if (LogColors[log_type]){ + SetConsoleTextAttribute(console_handle, LogColors[log_type]); + } + else{ + SetConsoleTextAttribute(console_handle, Console::Color::White); + } #endif - std::cout << "[N::" << TypeNames[log_type] << "] " << message << std::endl; + std::cout << "[N::" << TypeNames[log_type] << "] " << message << "\n"; #ifdef _WINDOWS /* Always set back to white*/ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index f91a2338b..88fd1362f 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -45,12 +45,14 @@ public: Moderate, /* 1 - Informational based, used in functions, when particular things load */ Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; - + void CloseZoneLogs(); void ConsoleMessage(uint16 log_type, const std::string message); + void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); void LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...); - void Log(uint16 log_type, const std::string message, ...); + void MakeDirectory(std::string directory_name); + void SetCurrentTimeStamp(char* time_stamp); void StartZoneLogs(const std::string log_name); diff --git a/common/ruletypes.h b/common/ruletypes.h index 1d9286a69..c16590783 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -599,7 +599,12 @@ RULE_CATEGORY_END() RULE_CATEGORY(Logging) RULE_BOOL(Logging, ConsoleLogCommands, false) /* Turns on or off console logs */ RULE_BOOL(Logging, LogFileCommands, false) + RULE_INT(Logging, DebugLogLevel, 0) /* Sets Debug Level, -1 = OFF, 0 = Low Level, 1 = Info, 2 = Extreme */ + +RULE_BOOL(Logging, EnableConsoleLogging, true) /* Turns on or off ALL logging to console */ +RULE_BOOL(Logging, EnableFileLogging, true) /* Turns on or off ALL forms of file logging */ + RULE_CATEGORY_END() From 855f7ac2a026ae3aac91910dd93e9b640bc2792e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Jan 2015 00:20:43 -0600 Subject: [PATCH 030/707] Quote fix --- common/eqemu_logsys.cpp | 6 +++++- zone/worldserver.cpp | 5 +---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index eab7ee2d9..f7bd6edc3 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -69,6 +69,7 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Command", "Crash", "Save", + /* "UCS", "Query Server", "Socket Server", @@ -78,8 +79,11 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Quests", "Spells", "Zone", - + "Tasks", + "Trading", + */ }; + static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { Console::Color::Yellow, // "Status", Console::Color::Yellow, // "Normal", diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index f8d4ff63e..2e1c2e699 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -386,11 +386,8 @@ void WorldServer::Process() { } } else { - #ifdef _EQDEBUG - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] - "id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", + logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); - #endif } } else From 3c53d907da922b06f877f73b634a5d92ab388543 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 11 Jan 2015 22:41:44 -0600 Subject: [PATCH 031/707] Fix double construction of EQEmuLogSys --- common/debug.cpp | 5 ++--- common/eqemu_logsys.cpp | 1 + common/eqemu_logsys.h | 1 - world/net.cpp | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 1150db9f0..874de6aa6 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -41,14 +41,13 @@ namespace ConsoleColor { #endif +#include "eqemu_logsys.h" #include "debug.h" #include "misc_functions.h" #include "platform.h" #include "eqemu_logsys.h" #include "string_util.h" -EQEmuLogSys backport_log_sys; - #ifndef va_copy #define va_copy(d,s) ((d) = (s)) #endif @@ -165,7 +164,7 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) va_list argptr, tmpargptr; va_start(argptr, fmt); - backport_log_sys.Log(id, vStringFormat(fmt, argptr).c_str()); + logger.Log(id, vStringFormat(fmt, argptr).c_str()); if (logCallbackFmt[id]) { msgCallbackFmt p = logCallbackFmt[id]; diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index f7bd6edc3..c7e8d300f 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -96,6 +96,7 @@ static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { EQEmuLogSys::EQEmuLogSys(){ + std::cout << "I AM CONSTRUCTING!!!! LUL " << std::endl; } EQEmuLogSys::~EQEmuLogSys(){ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 88fd1362f..746689920 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -55,7 +55,6 @@ public: void SetCurrentTimeStamp(char* time_stamp); void StartZoneLogs(const std::string log_name); - private: bool zone_general_init = false; diff --git a/world/net.cpp b/world/net.cpp index 11de88892..c75dbe04b 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -97,14 +97,13 @@ LoginServerList loginserverlist; EQWHTTPServer http_server; UCSConnection UCSLink; QueryServConnection QSLink; -LauncherList launcher_list; +LauncherList launcher_list; AdventureManager adventure_manager; EQEmu::Random emu_random; volatile bool RunLoops = true; uint32 numclients = 0; uint32 numzones = 0; bool holdzones = false; -EQEmuLogSys logger; extern ConsoleList console_list; From 489f24a80ac20c916432b73fc50cd993234ef075 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 02:16:57 -0600 Subject: [PATCH 032/707] Preliminary addition of log settings map --- common/eqemu_logsys.cpp | 24 +++++++++++------------- common/eqemu_logsys.h | 15 +++++++++++++++ 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index c7e8d300f..632eed4da 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -69,19 +69,12 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Command", "Crash", "Save", - /* - "UCS", - "Query Server", - "Socket Server", - "Spawns", - "AI", - "Pathing", - "Quests", - "Spells", - "Zone", - "Tasks", - "Trading", - */ +}; + +static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { + "Netcode", + "Guilds", + "Rules", }; static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { @@ -96,6 +89,11 @@ static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { EQEmuLogSys::EQEmuLogSys(){ + // LogSettings log_settings; + for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){ + log_settings[i].log_to_console = 1; + std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl; + } std::cout << "I AM CONSTRUCTING!!!! LUL " << std::endl; } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 746689920..2e0b8c0a4 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -46,6 +46,13 @@ public: Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; + enum LogCategory { + Netcode = 0, + Guilds, + Rules, + MaxCategoryID /* Don't Remove this*/ + }; + void CloseZoneLogs(); void ConsoleMessage(uint16 log_type, const std::string message); void Log(uint16 log_type, const std::string message, ...); @@ -55,6 +62,14 @@ public: void SetCurrentTimeStamp(char* time_stamp); void StartZoneLogs(const std::string log_name); + struct LogSettings{ + uint8 log_to_file; + uint8 log_to_console; + uint8 log_to_gmsay; + }; + + LogSettings log_settings[EQEmuLogSys::LogCategory::MaxCategoryID]; + private: bool zone_general_init = false; From 2e397b1383e2e1bc403f48a6ae3a7ebca974c90f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 05:14:46 -0600 Subject: [PATCH 033/707] static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] enum LogCategory --- common/eqemu_logsys.cpp | 71 ++++++++++++++++++++++++++++------------- common/eqemu_logsys.h | 23 +++++++++++-- 2 files changed, 70 insertions(+), 24 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 632eed4da..e2324fdf7 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -20,6 +20,7 @@ #include "eqemu_logsys.h" #include "string_util.h" #include "rulesys.h" +#include "platform.h" #include #include @@ -61,45 +62,68 @@ namespace Console { } static const char* TypeNames[EQEmuLogSys::MaxLogID] = { - "Status", - "Normal", - "Error", - "Debug", - "Quest", - "Command", - "Crash", - "Save", + "Status", + "Normal", + "Error", + "Debug", + "Quest", + "Command", + "Crash", + "Save", }; +/* If you add to this, make sure you update LogCategory in eqemu_logsys.h */ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { + "Zone", + "World", + "UCS", + "QueryServer", + "WebInterface", + "AA", + "Doors", + "Guild", + "Inventory", "Netcode", - "Guilds", + "Object", "Rules", + "Skills", + "Spawns", + "Spells", + "Tasks", + "Trading", + "Tribute", }; static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { - Console::Color::Yellow, // "Status", - Console::Color::Yellow, // "Normal", - Console::Color::LightRed, // "Error", - Console::Color::LightGreen, // "Debug", - Console::Color::LightCyan, // "Quest", - Console::Color::LightMagenta, // "Command", - Console::Color::LightRed // "Crash" + Console::Color::Yellow, // "Status", + Console::Color::Yellow, // "Normal", + Console::Color::LightRed, // "Error", + Console::Color::LightGreen, // "Debug", + Console::Color::LightCyan, // "Quest", + Console::Color::LightMagenta, // "Command", + Console::Color::LightRed // "Crash" }; EQEmuLogSys::EQEmuLogSys(){ - // LogSettings log_settings; - for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){ - log_settings[i].log_to_console = 1; - std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl; - } - std::cout << "I AM CONSTRUCTING!!!! LUL " << std::endl; } EQEmuLogSys::~EQEmuLogSys(){ } +void EQEmuLogSys::LoadLogSettings() +{ + log_platform = GetExecutablePlatformInt(); + std::cout << "PLATFORM " << log_platform << std::endl; + for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){ + log_settings[i].log_to_console = 1; + log_settings[i].log_to_file = 1; + log_settings[i].log_to_gmsay = 1; + std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl; + } + log_settings_loaded = true; +} + void EQEmuLogSys::StartZoneLogs(const std::string log_name) { EQEmuLogSys::MakeDirectory("logs/zone"); @@ -149,6 +173,9 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { + if (!log_settings_loaded){ + EQEmuLogSys::LoadLogSettings(); + } if (log_type > EQEmuLogSys::MaxLogID){ return; } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 2e0b8c0a4..eaa30f374 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -46,10 +46,26 @@ public: Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; + /* If you add to this, make sure you update LogCategoryName in eqemu_logsys.cpp */ enum LogCategory { - Netcode = 0, - Guilds, + Zone_Server = 0, + World_Server, + UCS_Server, + QS_Server, + WebInterface_Server, + AA, + Doors, + Guild, + Inventory, + Netcode, + Object, Rules, + Skills, + Spawns, + Spells, + Tasks, + Trading, + Tribute, MaxCategoryID /* Don't Remove this*/ }; @@ -61,6 +77,7 @@ public: void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartZoneLogs(const std::string log_name); + void LoadLogSettings(); struct LogSettings{ uint8 log_to_file; @@ -69,6 +86,8 @@ public: }; LogSettings log_settings[EQEmuLogSys::LogCategory::MaxCategoryID]; + bool log_settings_loaded = false; + int log_platform = 0; private: bool zone_general_init = false; From fac1361d36df1f5a8c15ef0847d22f388b59bc2e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 05:15:31 -0600 Subject: [PATCH 034/707] logger.LoadLogSettings() added after each platform executable registry Added int return for platform executable --- client_files/export/main.cpp | 1 + client_files/import/main.cpp | 1 + common/platform.cpp | 3 +++ common/platform.h | 1 + eqlaunch/eqlaunch.cpp | 1 + queryserv/queryserv.cpp | 1 + shared_memory/main.cpp | 1 + ucs/ucs.cpp | 1 + world/net.cpp | 3 +++ zone/net.cpp | 3 ++- 10 files changed, 15 insertions(+), 1 deletion(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index d76ae12cd..550446cb2 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -35,6 +35,7 @@ void ExportBaseData(SharedDatabase *db); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientExport); + logger.LoadLogSettings(); set_exception_handler(); logger.Log(EQEmuLogSys::Status, "Client Files Export Utility"); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 7e1eb7557..381889d93 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -33,6 +33,7 @@ void ImportBaseData(SharedDatabase *db); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientImport); + logger.LoadLogSettings(); set_exception_handler(); logger.Log(EQEmuLogSys::Status, "Client Files Import Utility"); diff --git a/common/platform.cpp b/common/platform.cpp index 1a7b2ed7f..4955d6639 100644 --- a/common/platform.cpp +++ b/common/platform.cpp @@ -10,3 +10,6 @@ const EQEmuExePlatform& GetExecutablePlatform() { return exe_platform; } +int GetExecutablePlatformInt(){ + return exe_platform; +} \ No newline at end of file diff --git a/common/platform.h b/common/platform.h index 7eaae045b..281402291 100644 --- a/common/platform.h +++ b/common/platform.h @@ -18,5 +18,6 @@ enum EQEmuExePlatform void RegisterExecutablePlatform(EQEmuExePlatform p); const EQEmuExePlatform& GetExecutablePlatform(); +int GetExecutablePlatformInt(); #endif diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 5ddcfefdd..89e2b0670 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -39,6 +39,7 @@ void CatchSignal(int sig_num); int main(int argc, char *argv[]) { RegisterExecutablePlatform(ExePlatformLaunch); + logger.LoadLogSettings(); set_exception_handler(); std::string launcher_name; diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index ce64b646b..fa52a11f5 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -50,6 +50,7 @@ void CatchSignal(int sig_num) { int main() { RegisterExecutablePlatform(ExePlatformQueryServ); + logger.LoadLogSettings(); set_exception_handler(); Timer LFGuildExpireTimer(60000); Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index c7d9f2e42..333d5789c 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -37,6 +37,7 @@ EQEmuLogSys logger; int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformSharedMemory); + logger.LoadLogSettings(); set_exception_handler(); logger.Log(EQEmuLogSys::Status, "Shared Memory Loader Program"); diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index ad3af0379..2024bf155 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -69,6 +69,7 @@ std::string GetMailPrefix() { int main() { RegisterExecutablePlatform(ExePlatformUCS); + logger.LoadLogSettings(); set_exception_handler(); // Check every minute for unused channels we can delete diff --git a/world/net.cpp b/world/net.cpp index c75dbe04b..3977f482b 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -105,12 +105,15 @@ uint32 numclients = 0; uint32 numzones = 0; bool holdzones = false; +EQEmuLogSys logger; + extern ConsoleList console_list; void CatchSignal(int sig_num); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformWorld); + logger.LoadLogSettings(); set_exception_handler(); /* Database Version Check */ diff --git a/zone/net.cpp b/zone/net.cpp index 2ab8a0e2e..95b7f1396 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -17,6 +17,7 @@ */ #define DONT_SHARED_OPCODES +#define PLATFORM_ZONE 1 #include "../common/debug.h" #include "../common/features.h" @@ -42,7 +43,6 @@ #include "../common/memory_mapped_file.h" #include "../common/eqemu_exception.h" #include "../common/spdat.h" - #include "../common/eqemu_logsys.h" #include "zone_config.h" @@ -114,6 +114,7 @@ extern void MapOpcodes(); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformZone); + logger.LoadLogSettings(); set_exception_handler(); const char *zone_name; From 08a23265f8cd86489181f6e4aefb916c4d565ed7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 12:37:33 -0600 Subject: [PATCH 035/707] Make some log functions less process specific in naming --- common/eqemu_logsys.cpp | 21 ++++++++++++--------- common/eqemu_logsys.h | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index e2324fdf7..1d1a732af 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -115,6 +115,7 @@ void EQEmuLogSys::LoadLogSettings() { log_platform = GetExecutablePlatformInt(); std::cout << "PLATFORM " << log_platform << std::endl; + /* Write defaults */ for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){ log_settings[i].log_to_console = 1; log_settings[i].log_to_file = 1; @@ -124,11 +125,13 @@ void EQEmuLogSys::LoadLogSettings() log_settings_loaded = true; } -void EQEmuLogSys::StartZoneLogs(const std::string log_name) +void EQEmuLogSys::StartLogs(const std::string log_name) { - EQEmuLogSys::MakeDirectory("logs/zone"); - std::cout << "Starting Zone Logs..." << std::endl; - process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + std::cout << "Starting Zone Logs..." << std::endl; + EQEmuLogSys::MakeDirectory("logs/zone"); + process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); + } } void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...) @@ -173,9 +176,7 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { - if (!log_settings_loaded){ - EQEmuLogSys::LoadLogSettings(); - } + if (log_type > EQEmuLogSys::MaxLogID){ return; } @@ -240,6 +241,8 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) void EQEmuLogSys::CloseZoneLogs() { - std::cout << "Closing down zone logs..." << std::endl; - process_log.close(); + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + std::cout << "Closing down zone logs..." << std::endl; + process_log.close(); + } } \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index eaa30f374..9a0586f7e 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -76,7 +76,7 @@ public: void LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); - void StartZoneLogs(const std::string log_name); + void StartLogs(const std::string log_name); void LoadLogSettings(); struct LogSettings{ From 9d355f0f990b340ba033919ac009cbe0db3ec50f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 20:11:23 -0600 Subject: [PATCH 036/707] Add zone callback for client messages so log messages can be piped to it --- common/eqemu_logsys.cpp | 6 +++++- common/eqemu_logsys.h | 7 ++++++- zone/client_logs.cpp | 5 +++++ zone/client_logs.h | 1 + zone/net.cpp | 2 ++ zone/zone.cpp | 2 +- 6 files changed, 20 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 1d1a732af..1d0af0bb4 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -106,6 +106,7 @@ static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { EQEmuLogSys::EQEmuLogSys(){ + on_log_gmsay_hook = [](uint16 log_type, std::string&) {}; } EQEmuLogSys::~EQEmuLogSys(){ @@ -154,7 +155,6 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); } @@ -191,6 +191,10 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + on_log_gmsay_hook(output_message); + } + EQEmuLogSys::ConsoleMessage(log_type, output_message); char time_stamp[80]; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 9a0586f7e..037a06feb 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -21,6 +21,9 @@ #include #include +#include +#include + #include "types.h" class EQEmuLogSys { @@ -89,9 +92,11 @@ public: bool log_settings_loaded = false; int log_platform = 0; + void OnLogHookCallBack(std::function f) { on_log_gmsay_hook = f; } + private: bool zone_general_init = false; - + std::function on_log_gmsay_hook; }; extern EQEmuLogSys logger; diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index 4aba31159..f2ead3a59 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -21,6 +21,7 @@ #ifdef CLIENT_LOGS #include "client_logs.h" #include "client.h" +#include "entity.h" #include ClientLogs client_logs; @@ -134,6 +135,10 @@ void ClientLogs::EQEmuIO_pva(EQEmuLog::LogIDs id, const char *prefix, const char client_logs.msg(id, _buffer); } +void ClientLogs::ClientMessage(uint16 log_type, std::string& message){ + entity_list.MessageStatus(0, 80, 7, "%s", message.c_str()); +} + #endif //CLIENT_LOGS diff --git a/zone/client_logs.h b/zone/client_logs.h index 4db83a6b1..547c49641 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -46,6 +46,7 @@ public: void clear(); //unsubscribes everybody void msg(EQEmuLog::LogIDs id, const char *buf); + static void ClientMessage(uint16 log_type, std::string& message); protected: diff --git a/zone/net.cpp b/zone/net.cpp index 95b7f1396..601a598e5 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -45,6 +45,7 @@ #include "../common/spdat.h" #include "../common/eqemu_logsys.h" +#include "client_logs.h" #include "zone_config.h" #include "masterentity.h" #include "worldserver.h" @@ -115,6 +116,7 @@ extern void MapOpcodes(); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformZone); logger.LoadLogSettings(); + logger.OnLog(&ClientLogs::ClientMessage); set_exception_handler(); const char *zone_name; diff --git a/zone/zone.cpp b/zone/zone.cpp index 9c00d23cb..98eb41ee3 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -152,7 +152,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { /* Set Logging */ - logger.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + logger.StartLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); return true; } From b1939aaa3eb0934f4e35ded0c567b4d73fca9004 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 20:58:17 -0600 Subject: [PATCH 037/707] Remove Save from LogTypes --- common/eqemu_logsys.cpp | 4 ++-- common/eqemu_logsys.h | 5 ++--- zone/net.cpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 1d0af0bb4..73317e525 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -69,7 +69,6 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Quest", "Command", "Crash", - "Save", }; /* If you add to this, make sure you update LogCategory in eqemu_logsys.h */ @@ -155,6 +154,7 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); + EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); } @@ -192,7 +192,7 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) va_end(args); if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - on_log_gmsay_hook(output_message); + on_log_gmsay_hook(log_type, output_message); } EQEmuLogSys::ConsoleMessage(log_type, output_message); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 037a06feb..8d577bfc1 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -39,7 +39,6 @@ public: Quest, /* Quest Logs */ Commands, /* Issued Commands */ Crash, /* Crash Logs */ - Save, /* Client Saves */ MaxLogID /* Max, used in functions to get the max log ID */ }; @@ -74,13 +73,13 @@ public: void CloseZoneLogs(); void ConsoleMessage(uint16 log_type, const std::string message); + void LoadLogSettings(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); void LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartLogs(const std::string log_name); - void LoadLogSettings(); struct LogSettings{ uint8 log_to_file; @@ -92,7 +91,7 @@ public: bool log_settings_loaded = false; int log_platform = 0; - void OnLogHookCallBack(std::function f) { on_log_gmsay_hook = f; } + void OnLogHookCallBackZone(std::function f) { on_log_gmsay_hook = f; } private: bool zone_general_init = false; diff --git a/zone/net.cpp b/zone/net.cpp index 601a598e5..c10c2b00c 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -116,7 +116,7 @@ extern void MapOpcodes(); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformZone); logger.LoadLogSettings(); - logger.OnLog(&ClientLogs::ClientMessage); + logger.OnLogHookCallBackZone(&ClientLogs::ClientMessage); set_exception_handler(); const char *zone_name; From 4811631127f98dc12951413e6f50d32eed920c59 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 21:19:19 -0600 Subject: [PATCH 038/707] Convert _log from TASKS category --- zone/entity.cpp | 2 +- zone/net.cpp | 2 +- zone/questmgr.cpp | 2 +- zone/tasks.cpp | 180 +++++++++++++++++++++---------------------- zone/worldserver.cpp | 14 ++-- 5 files changed, 100 insertions(+), 100 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index ccc74629c..1854f83bf 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID) // If we have been passed a TaskID, only reload the client state if they have // that Task active. if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) { - _log(TASKS__CLIENTLOAD, "Reloading Task State For Client %s", client->GetName()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); client->RemoveClientTaskState(); client->LoadClientTaskState(); taskmanager->SendActiveTasksToClient(client); diff --git a/zone/net.cpp b/zone/net.cpp index c10c2b00c..39cc24b96 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -294,7 +294,7 @@ int main(int argc, char** argv) { } if(RuleB(TaskSystem, EnableTaskSystem)) { - _log(ZONE__INIT, "Loading Tasks"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); taskmanager = new TaskManager; taskmanager->LoadTasks(); } diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index bdc1ecb6f..50e722d8d 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2074,7 +2074,7 @@ bool QuestManager::istaskenabled(int taskid) { void QuestManager::tasksetselector(int tasksetid) { QuestManagerCurrentQuestVars(); - _log(TASKS__UPDATE, "TaskSetSelector called for task set %i", tasksetid); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager) initiator->TaskSetSelector(owner, tasksetid); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 3433842b2..67f137d64 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() { int taskID = atoi(row[1]); TaskSets[taskSet].push_back(taskID); - _log(TASKS__GLOBALLOAD, "Adding TaskID %4i to TaskSet %4i", taskID, taskSet); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); } return true; @@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() { bool TaskManager::LoadSingleTask(int TaskID) { - _log(TASKS__GLOBALLOAD, "TaskManager::LoadSingleTask(%i)", TaskID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false; @@ -121,7 +121,7 @@ void TaskManager::ReloadGoalLists() { bool TaskManager::LoadTasks(int singleTask) { // If TaskID !=0, then just load the task specified. - _log(TASKS__GLOBALLOAD, "TaskManager::LoadTasks Called"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); std::string query; if(singleTask == 0) { @@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->SequenceMode = ActivitiesSequential; Tasks[taskID]->LastStep = 0; - _log(TASKS__GLOBALLOAD,"TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward, Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel, Tasks[taskID]->Repeatable ? "Yes" : "No"); - _log(TASKS__GLOBALLOAD,"Title: %s ", Tasks[taskID]->Title); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); } @@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]); Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]); - _log(TASKS__GLOBALLOAD, "Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " "GoalMethod: %i, GoalCount: %3i, ZoneID:%3i", Tasks[taskID]->ActivityCount, activityID, taskID, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type, @@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID); - _log(TASKS__GLOBALLOAD, " Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); - _log(TASKS__GLOBALLOAD, " Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); - _log(TASKS__GLOBALLOAD, " Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); Tasks[taskID]->ActivityCount++; } @@ -316,7 +316,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[task].Updated) { - _log(TASKS__CLIENTSAVE, "TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) " "VALUES (%i, %i, %i, %i)", @@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(!state->ActiveTasks[task].Activity[activityIndex].Updated) continue; - _log(TASKS__CLIENTSAVE, "TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", characterID, task, activityIndex); if(updatedActivityCount==0) @@ -358,7 +358,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(updatedActivityCount == 0) continue; - _log(TASKS__CLIENTSAVE, "Executing query %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { @@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { for(unsigned int i=state->LastCompletedTaskLoaded; iCompletedTasks.size(); i++) { - _log(TASKS__CLIENTSAVE, "TaskManager::SaveClientState Saving Completed Task at slot %i", i); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); int taskID = state->CompletedTasks[i].TaskID; if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr)) @@ -459,7 +459,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTaskCount = 0; - _log(TASKS__CLIENTLOAD, "TaskManager::LoadClientState for character ID %d", characterID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` " "FROM `character_tasks` " @@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { ++state->ActiveTaskCount; - _log(TASKS__CLIENTLOAD, "TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); } // Load Activities - _log(TASKS__CLIENTLOAD, "LoadClientState. Loading activities for character ID %d", characterID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` " "FROM `character_activities` " @@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false; - _log(TASKS__CLIENTLOAD, "TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); } @@ -639,7 +639,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); state->EnabledTasks.push_back(taskID); - _log(TASKS__CLIENTLOAD, "Adding TaskID %i to enabled tasks", taskID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); } // Check that there is an entry in the client task state for every activity in each task @@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); - _log(TASKS__CLIENTLOAD, "LoadClientState for Character ID %d DONE!", characterID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); return true; } @@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { } } - _log(TASKS__UPDATE, "New enabled task list "); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); for(unsigned int i=0; iGetLevel(); - _log(TASKS__UPDATE, "TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, state->EnabledTasks.size()); if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return; @@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if(TaskSets[TaskSetID][0] == 0) { - _log(TASKS__UPDATE, "TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); std::vector::iterator Iterator = TaskSets[TaskSetID].begin(); while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) { @@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) && (TaskListIndex < MAXCHOOSERENTRIES)) { - _log(TASKS__UPDATE, "Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex, TaskSets[TaskSetID][TaskSetIndex]); @@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task return; } // Titanium OpCode: 0x5e7c - _log(TASKS__UPDATE, "TaskSelector for %i Tasks", TaskCount); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); char *Ptr; int PlayerLevel = c->GetLevel(); @@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) { - _log(TASKS__UPDATE, "TaskSelector for %i Tasks", TaskCount); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); int PlayerLevel = c->GetLevel(); @@ -1275,7 +1275,7 @@ int ClientTaskState::GetActiveTaskID(int index) { static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { - _log(TASKS__UPDATE, "DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); @@ -1284,7 +1284,7 @@ static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { return; } - _log(TASKS__UPDATE, "Delete query %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); } bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { @@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first // activity as active if not complete. - _log(TASKS__UPDATE, "CharID: %i Task: %i Sequence mode is %i", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode); if(Task->SequenceMode == ActivitiesSequential) { @@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) { if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - _log(TASKS__UPDATE, "KeepOneRecord enabled"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - _log(TASKS__UPDATE, "Erased Element count is %i", ErasedElements); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTasks.push_back(cti); } - _log(TASKS__UPDATE, "Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); return AllActivitiesComplete; } @@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { bool CurrentStepComplete = true; - _log(TASKS__UPDATE, "Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); // If CurrentStep is -1, this is the first call to this method since loading the // client state. Unlock all activities with a step number of 0 if(ActiveTasks[TaskIndex].CurrentStep == -1) { @@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // If we are only keeping one completed record per task, and the player has done // the same task again, erase the previous completed entry for this task. if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - _log(TASKS__UPDATE, "KeepOneRecord enabled"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - _log(TASKS__UPDATE, "Erased Element count is %i", ErasedElements); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI int Ret = false; - _log(TASKS__UPDATE, "ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); // If the client has no tasks, there is nothing further to check. @@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(Task->Activity[j].Type != ActivityType) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - _log(TASKS__UPDATE, "Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID); continue; } @@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI continue; } // We found an active task to kill this type of NPC, so increment the done count - _log(TASKS__UPDATE, "Calling increment done count ByNPC"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); IncrementDoneCount(c, Task, i, j); Ret = true; } @@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI // If the client has no tasks, there is nothing further to check. - _log(TASKS__UPDATE, "ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); if(ActiveTaskCount == 0) return; @@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(Task->Activity[j].Type != (int)Type) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - _log(TASKS__UPDATE, "Char: %s Activity type %i for Item %i failed zone check", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", c->GetName(), Type, ItemID); continue; } @@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI continue; } // We found an active task related to this item, so increment the done count - _log(TASKS__UPDATE, "Calling increment done count ForItem"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); IncrementDoneCount(c, Task, i, j, Count); } } @@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { // If the client has no tasks, there is nothing further to check. - _log(TASKS__UPDATE, "ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityExplore) continue; if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - _log(TASKS__UPDATE, "Char: %s Explore exploreid %i failed zone check", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", c->GetName(), ExploreID); continue; } @@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { } // We found an active task to explore this area, so set done count to goal count // (Only a goal count of 1 makes sense for explore activities?) - _log(TASKS__UPDATE, "Increment on explore"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); @@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i bool Ret = false; - _log(TASKS__UPDATE, "ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); if(ActiveTaskCount == 0) return false; @@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i (Task->Activity[j].Type != ActivityGiveCash)) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - _log(TASKS__UPDATE, "Char: %s Deliver activity failed zone check (current zone %i, need zone %i", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID); continue; } @@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i // Is the activity related to these items ? // if((Task->Activity[j].Type == ActivityGiveCash) && Cash) { - _log(TASKS__UPDATE, "Increment on GiveCash"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); IncrementDoneCount(c, Task, i, j, Cash); Ret = true; } @@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i continue; } // We found an active task related to this item, so increment the done count - _log(TASKS__UPDATE, "Increment on GiveItem"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); IncrementDoneCount(c, Task, i, j, 1); Ret = true; } @@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { // If the client has no tasks, there is nothing further to check. - _log(TASKS__UPDATE, "ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityTouch) continue; if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue; if(Task->Activity[j].ZoneID != ZoneID) { - _log(TASKS__UPDATE, "Char: %s Touch activity failed zone check", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", c->GetName()); continue; } // We found an active task to zone into this zone, so set done count to goal count // (Only a goal count of 1 makes sense for touch activities?) - _log(TASKS__UPDATE, "Increment on Touch"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); } @@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { } void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) { - _log(TASKS__UPDATE, "IncrementDoneCount"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count; @@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true; // Have we reached the goal count for this activity ? if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) { - _log(TASKS__UPDATE, "Done (%i) = Goal (%i) for Activity %i", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount, Task->Activity[ActivityID].GoalCount, ActivityID); @@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex); - _log(TASKS__UPDATE, "TaskCompleted is %i", TaskComplete); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); // and by the 'Task Stage Completed' message c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex); // Send the updated task/activity list to the client @@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) { void ClientTaskState::FailTask(Client *c, int TaskID) { - _log(TASKS__UPDATE, "FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); if(ActiveTaskCount == 0) return; for(int i=0; i= Task->ActivityCount) return false; - _log(TASKS__UPDATE, "ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State); @@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/) { - _log(TASKS__UPDATE, "ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - _log(TASKS__UPDATE, "Increment done count on UpdateTaskActivity"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update); } void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { - _log(TASKS__UPDATE, "ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - _log(TASKS__UPDATE, "ResetTaskActivityCount"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0; @@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) { if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1; for(unsigned int i=0; iunknown5 = 0x00000001; tac->unknown5 = 0; // 0 for task complete or failed. - _log(TASKS__UPDATE, "TaskFailed"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); @@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) if(State->CompletedTasks.size() > 50) FirstTaskToSend = State->CompletedTasks.size() - 50; - _log(TASKS__UPDATE, "Completed Task Count: %i, First Task to send is %i, Last is %i", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend); /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { @@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false); - _log(TASKS__UPDATE, "SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - _log(TASKS__UPDATE, " Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, @@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - _log(TASKS__UPDATE, " Short: %i, %i, %i", TaskID, Activity, TaskIndex); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal); - _log(TASKS__UPDATE, "SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - _log(TASKS__UPDATE, " Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, TaskComplete); @@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - _log(TASKS__UPDATE, " Short: %i, %i, %i", TaskID, Activity, TaskIndex); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->SequenceNumber = SequenceNumber; cts->unknown4 = 0x00000002; - _log(TASKS__UPDATE, "CancelTask"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); @@ -2932,24 +2932,24 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { int characterID = c->CharacterID(); - _log(TASKS__UPDATE, "ClientTaskState Cancel Task %i ", sequenceNumber); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } - _log(TASKS__UPDATE, "CancelTask: %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + logger.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); - _log(TASKS__UPDATE, "CancelTask: %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY; ActiveTaskCount--; @@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { // int FreeSlot = -1; for(int i=0; iProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - _log(TASKS__PROXIMITY, "Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } @@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() { bool TaskGoalListManager::LoadLists() { - _log(TASKS__GLOBALLOAD, "TaskGoalListManager::LoadLists Called"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); for(int i=0; i< NumberOfLists; i++) safe_delete_array(TaskGoalLists[i].GoalItemEntries); @@ -3093,7 +3093,7 @@ bool TaskGoalListManager::LoadLists() { } NumberOfLists = results.RowCount(); - _log(TASKS__GLOBALLOAD, "Database returned a count of %i lists", NumberOfLists); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); TaskGoalLists = new TaskGoalList_Struct[NumberOfLists]; @@ -3207,7 +3207,7 @@ std::vector TaskGoalListManager::GetListContents(int ListID) { bool TaskGoalListManager::IsInList(int ListID, int Entry) { - _log(TASKS__UPDATE, "TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); int ListIndex = GetListByID(ListID); @@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) { else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry]) LastEntry = MiddleEntry - 1; else { - _log(TASKS__UPDATE, "TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); return true; } @@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() { bool TaskProximityManager::LoadProximities(int zoneID) { TaskProximity proximity; - _log(TASKS__GLOBALLOAD, "TaskProximityManager::LoadProximities Called for zone %i", zoneID); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); TaskProximities.clear(); std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, " @@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) { TaskProximity* P = &TaskProximities[i]; - _log(TASKS__PROXIMITY, "Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ); if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY || diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 2e1c2e699..68ebb51fc 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -2005,14 +2005,14 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) { ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer; - _log(TASKS__GLOBALLOAD, "Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); switch(rts->Command) { case RELOADTASKS: entity_list.SaveAllClientsTaskState(); if(rts->Parameter == 0) { - _log(TASKS__GLOBALLOAD, "Reload ALL tasks"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); safe_delete(taskmanager); taskmanager = new TaskManager; taskmanager->LoadTasks(); @@ -2021,7 +2021,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) entity_list.ReloadAllClientsTaskState(); } else { - _log(TASKS__GLOBALLOAD, "Reload only task %i", rts->Parameter); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); taskmanager->LoadTasks(rts->Parameter); entity_list.ReloadAllClientsTaskState(rts->Parameter); } @@ -2030,23 +2030,23 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) case RELOADTASKPROXIMITIES: if(zone) { - _log(TASKS__GLOBALLOAD, "Reload task proximities"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); taskmanager->LoadProximities(zone->GetZoneID()); } break; case RELOADTASKGOALLISTS: - _log(TASKS__GLOBALLOAD, "Reload task goal lists"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); taskmanager->ReloadGoalLists(); break; case RELOADTASKSETS: - _log(TASKS__GLOBALLOAD, "Reload task sets"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); taskmanager->LoadTaskSets(); break; default: - _log(TASKS__GLOBALLOAD, "Unhandled ServerOP_ReloadTasks command %i", rts->Command); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); } From ffdce868c1aeb3968b4d474af373e29ab35bc7cf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 21:45:49 -0600 Subject: [PATCH 039/707] Convert netcode debugging _log to logger.LogDebugType --- common/eq_stream.cpp | 14 +++--- common/eq_stream_ident.cpp | 23 +++++----- common/patches/rof.cpp | 89 ++++++++++++++++++------------------ common/patches/rof2.cpp | 89 ++++++++++++++++++------------------ common/patches/sod.cpp | 59 ++++++++++++------------ common/patches/sof.cpp | 29 ++++++------ common/patches/template.cpp | 6 +-- common/patches/titanium.cpp | 23 +++++----- common/patches/underfoot.cpp | 59 ++++++++++++------------ common/struct_strategy.cpp | 5 +- common/worldconn.cpp | 5 +- 11 files changed, 205 insertions(+), 196 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 70e9ab43f..d2326cf7b 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -200,7 +200,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - _log(NET__NET_TRACE, "OP_Packet: Removing older queued packet with sequence %d", seq); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); delete qp; } @@ -250,7 +250,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - _log(NET__NET_TRACE, "OP_Fragment: Removing older queued packet with sequence %d", seq); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); delete qp; } SetNextAckToSend(seq); @@ -960,7 +960,7 @@ EQRawApplicationPacket *p=nullptr; EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); #if EQDEBUG >= 4 if(emu_op == OP_Unknown) { - _log(NET__ERROR, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } #endif p->SetOpcode(emu_op); @@ -1426,19 +1426,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. if(p->size == sig->first_length) { - _log(NET__IDENT_TRACE, "%s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else if(sig->first_length == 0) { - _log(NET__IDENT_TRACE, "%s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else { //opcode matched but length did not. - _log(NET__IDENT_TRACE, "%s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); res = MatchFailed; } } else { //first opcode did not match.. - _log(NET__IDENT_TRACE, "%s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); res = MatchFailed; } } diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index 97fdd2c48..531a297ad 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -1,4 +1,5 @@ #include "debug.h" +#include "eqemu_logsys.h" #include "eq_stream_ident.h" #include "eq_stream_proxy.h" #include "logsys.h" @@ -45,7 +46,7 @@ void EQStreamIdentifier::Process() { //first see if this stream has expired if(r->expire.Check(false)) { //this stream has failed to match any pattern in our timeframe. - _log(NET__IDENTIFY, "Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); delete r; cur = m_streams.erase(cur); @@ -61,23 +62,23 @@ void EQStreamIdentifier::Process() { } if(r->stream->GetState() != ESTABLISHED) { //the stream closed before it was identified. - _log(NET__IDENTIFY, "Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); switch(r->stream->GetState()) { case ESTABLISHED: - _log(NET__IDENTIFY, "Stream state was Established"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); break; case CLOSING: - _log(NET__IDENTIFY, "Stream state was Closing"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); break; case DISCONNECTING: - _log(NET__IDENTIFY, "Stream state was Disconnecting"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); break; case CLOSED: - _log(NET__IDENTIFY, "Stream state was Closed"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); break; default: - _log(NET__IDENTIFY, "Stream state was Unestablished or unknown"); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); break; } r->stream->ReleaseFromUse(); @@ -102,13 +103,13 @@ void EQStreamIdentifier::Process() { switch(res) { case EQStream::MatchNotReady: //the stream has not received enough packets to compare with this signature -// _log(NET__IDENT_TRACE, "%s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); +// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); all_ready = false; break; case EQStream::MatchSuccessful: { //yay, a match. - _log(NET__IDENTIFY, "Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further r->stream->SetActive(true); @@ -122,7 +123,7 @@ void EQStreamIdentifier::Process() { } case EQStream::MatchFailed: //do nothing... - _log(NET__IDENT_TRACE, "%s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); break; } } @@ -130,7 +131,7 @@ void EQStreamIdentifier::Process() { //if we checked all patches and did not find a match. if(all_ready && !found_one) { //the stream cannot be identified. - _log(NET__IDENTIFY, "Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index f65302c36..32ce8f07d 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -1,4 +1,5 @@ #include "../debug.h" +#include "../eqemu_logsys.h" #include "rof.h" #include "../opcodemgr.h" #include "../logsys.h" @@ -51,7 +52,7 @@ namespace RoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -77,7 +78,7 @@ namespace RoF - _log(NET__IDENTIFY, "Registered patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -92,10 +93,10 @@ namespace RoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -315,7 +316,7 @@ namespace RoF if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -550,7 +551,7 @@ namespace RoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -584,13 +585,13 @@ namespace RoF safe_delete_array(Serialized); } else { - _log(NET__ERROR, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //_log(NET__ERROR, "Sending inventory to client"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -951,16 +952,16 @@ namespace RoF ENCODE(OP_GroupUpdate) { - //_log(NET__ERROR, "OP_GroupUpdate"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //_log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -978,7 +979,7 @@ namespace RoF return; } //if(gjs->action == groupActLeave) - // _log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -995,19 +996,19 @@ namespace RoF if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //_log(NET__ERROR, "Struct is GroupUpdate2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //_log(NET__ERROR, "Yourname is %s", gu2->yourname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //_log(NET__ERROR, "Membername[%i] is %s", i, gu2->membername[i]); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -1015,7 +1016,7 @@ namespace RoF } } - //_log(NET__ERROR, "Leadername is %s", gu2->leadersname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -1077,7 +1078,7 @@ namespace RoF return; } - //_log(NET__ERROR, "Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1385,7 +1386,7 @@ namespace RoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2555,7 +2556,7 @@ namespace RoF outapp->WriteUInt8(0); // Unknown - _log(NET__STRUCTS, "Player Profile Packet is %i bytes", outapp->GetWritePosition()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3320,7 +3321,7 @@ namespace RoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3653,16 +3654,16 @@ namespace RoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //_log(NET__STRUCTS, "Spawn name is [%s]", emu->name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //_log(NET__STRUCTS, "Spawn packet size is %i, entries = %i", in->size, entrycount); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer, *BufferStart; @@ -3901,9 +3902,9 @@ namespace RoF Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - _log(NET__ERROR, "SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } - //_log(NET__ERROR, "Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4297,7 +4298,7 @@ namespace RoF DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_Disband"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4311,7 +4312,7 @@ namespace RoF DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4325,7 +4326,7 @@ namespace RoF DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4339,7 +4340,7 @@ namespace RoF DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupInvite"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4352,7 +4353,7 @@ namespace RoF DECODE(OP_GroupInvite2) { - //_log(NET__ERROR, "Received incoming OP_GroupInvite2. Forwarding"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -4496,8 +4497,8 @@ namespace RoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //_log(NET__ERROR, "Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - _log(NET__ERROR, "MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -4826,7 +4827,7 @@ namespace RoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //_log(NET__ERROR, "Serialize called for: %s", item->Name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); RoF::structs::ItemSerializationHeader hdr; @@ -4935,7 +4936,7 @@ namespace RoF } ss.write((const char*)&null_term, sizeof(uint8)); - //_log(NET__ERROR, "ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct)); RoF::structs::ItemBodyStruct ibs; memset(&ibs, 0, sizeof(RoF::structs::ItemBodyStruct)); @@ -5042,7 +5043,7 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); } - //_log(NET__ERROR, "ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct)); RoF::structs::ItemSecondaryBodyStruct isbs; memset(&isbs, 0, sizeof(RoF::structs::ItemSecondaryBodyStruct)); @@ -5083,7 +5084,7 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); } - //_log(NET__ERROR, "ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct)); RoF::structs::ItemTertiaryBodyStruct itbs; memset(&itbs, 0, sizeof(RoF::structs::ItemTertiaryBodyStruct)); @@ -5122,7 +5123,7 @@ namespace RoF // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - //_log(NET__ERROR, "ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct)); RoF::structs::ClickEffectStruct ices; memset(&ices, 0, sizeof(RoF::structs::ClickEffectStruct)); @@ -5149,7 +5150,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - //_log(NET__ERROR, "ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct)); RoF::structs::ProcEffectStruct ipes; memset(&ipes, 0, sizeof(RoF::structs::ProcEffectStruct)); @@ -5173,7 +5174,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - //_log(NET__ERROR, "ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct)); RoF::structs::WornEffectStruct iwes; memset(&iwes, 0, sizeof(RoF::structs::WornEffectStruct)); @@ -5264,7 +5265,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - //_log(NET__ERROR, "ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct)); RoF::structs::ItemQuaternaryBodyStruct iqbs; memset(&iqbs, 0, sizeof(RoF::structs::ItemQuaternaryBodyStruct)); @@ -5454,7 +5455,7 @@ namespace RoF RoFSlot.MainSlot = TempSlot; } - _log(NET__ERROR, "Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5495,7 +5496,7 @@ namespace RoF RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - _log(NET__ERROR, "Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5600,7 +5601,7 @@ namespace RoF ServerSlot = INVALID_INDEX; } - _log(NET__ERROR, "Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -5635,7 +5636,7 @@ namespace RoF ServerSlot = TempSlot; } - _log(NET__ERROR, "Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 03d919dd8..7548dec77 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -1,4 +1,5 @@ #include "../debug.h" +#include "../eqemu_logsys.h" #include "rof2.h" #include "../opcodemgr.h" #include "../logsys.h" @@ -51,7 +52,7 @@ namespace RoF2 //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -77,7 +78,7 @@ namespace RoF2 - _log(NET__IDENTIFY, "Registered patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -92,10 +93,10 @@ namespace RoF2 opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -381,7 +382,7 @@ namespace RoF2 if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -616,7 +617,7 @@ namespace RoF2 if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -650,13 +651,13 @@ namespace RoF2 safe_delete_array(Serialized); } else { - _log(NET__ERROR, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //_log(NET__ERROR, "Sending inventory to client"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -1017,16 +1018,16 @@ namespace RoF2 ENCODE(OP_GroupUpdate) { - //_log(NET__ERROR, "OP_GroupUpdate"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //_log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -1044,7 +1045,7 @@ namespace RoF2 return; } //if(gjs->action == groupActLeave) - // _log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -1061,19 +1062,19 @@ namespace RoF2 if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //_log(NET__ERROR, "Struct is GroupUpdate2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //_log(NET__ERROR, "Yourname is %s", gu2->yourname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //_log(NET__ERROR, "Membername[%i] is %s", i, gu2->membername[i]); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -1081,7 +1082,7 @@ namespace RoF2 } } - //_log(NET__ERROR, "Leadername is %s", gu2->leadersname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -1143,7 +1144,7 @@ namespace RoF2 return; } - //_log(NET__ERROR, "Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1451,7 +1452,7 @@ namespace RoF2 char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType); if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2639,7 +2640,7 @@ namespace RoF2 // Think we need 1 byte of padding at the end outapp->WriteUInt8(0); // Unknown - _log(NET__STRUCTS, "Player Profile Packet is %i bytes", outapp->GetWritePosition()); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3386,7 +3387,7 @@ namespace RoF2 if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3720,16 +3721,16 @@ namespace RoF2 //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //_log(NET__STRUCTS, "Spawn name is [%s]", emu->name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //_log(NET__STRUCTS, "Spawn packet size is %i, entries = %i", in->size, entrycount); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer, *BufferStart; @@ -3972,9 +3973,9 @@ namespace RoF2 Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - _log(NET__ERROR, "SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } - //_log(NET__ERROR, "Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4369,7 +4370,7 @@ namespace RoF2 DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_Disband"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4383,7 +4384,7 @@ namespace RoF2 DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4397,7 +4398,7 @@ namespace RoF2 DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4411,7 +4412,7 @@ namespace RoF2 DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupInvite"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4424,7 +4425,7 @@ namespace RoF2 DECODE(OP_GroupInvite2) { - //_log(NET__ERROR, "Received incoming OP_GroupInvite2. Forwarding"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -4567,8 +4568,8 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //_log(NET__ERROR, "Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - _log(NET__ERROR, "MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -4897,7 +4898,7 @@ namespace RoF2 std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //_log(NET__ERROR, "Serialize called for: %s", item->Name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); RoF2::structs::ItemSerializationHeader hdr; @@ -5005,7 +5006,7 @@ namespace RoF2 } ss.write((const char*)&null_term, sizeof(uint8)); - //_log(NET__ERROR, "ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct)); RoF2::structs::ItemBodyStruct ibs; memset(&ibs, 0, sizeof(RoF2::structs::ItemBodyStruct)); @@ -5112,7 +5113,7 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); } - //_log(NET__ERROR, "ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct)); RoF2::structs::ItemSecondaryBodyStruct isbs; memset(&isbs, 0, sizeof(RoF2::structs::ItemSecondaryBodyStruct)); @@ -5153,7 +5154,7 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); } - //_log(NET__ERROR, "ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct)); RoF2::structs::ItemTertiaryBodyStruct itbs; memset(&itbs, 0, sizeof(RoF2::structs::ItemTertiaryBodyStruct)); @@ -5192,7 +5193,7 @@ namespace RoF2 // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - //_log(NET__ERROR, "ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct)); RoF2::structs::ClickEffectStruct ices; memset(&ices, 0, sizeof(RoF2::structs::ClickEffectStruct)); @@ -5219,7 +5220,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - //_log(NET__ERROR, "ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct)); RoF2::structs::ProcEffectStruct ipes; memset(&ipes, 0, sizeof(RoF2::structs::ProcEffectStruct)); @@ -5243,7 +5244,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - //_log(NET__ERROR, "ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct)); RoF2::structs::WornEffectStruct iwes; memset(&iwes, 0, sizeof(RoF2::structs::WornEffectStruct)); @@ -5334,7 +5335,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - //_log(NET__ERROR, "ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); RoF2::structs::ItemQuaternaryBodyStruct iqbs; memset(&iqbs, 0, sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); @@ -5545,7 +5546,7 @@ namespace RoF2 RoF2Slot.MainSlot = TempSlot; } - _log(NET__ERROR, "Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5586,7 +5587,7 @@ namespace RoF2 RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - _log(NET__ERROR, "Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5695,7 +5696,7 @@ namespace RoF2 ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - _log(NET__ERROR, "Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } @@ -5730,7 +5731,7 @@ namespace RoF2 ServerSlot = TempSlot; } - _log(NET__ERROR, "Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 6982290c8..51992cc68 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -1,4 +1,5 @@ #include "../debug.h" +#include "../eqemu_logsys.h" #include "sod.h" #include "../opcodemgr.h" #include "../logsys.h" @@ -49,7 +50,7 @@ namespace SoD //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -75,7 +76,7 @@ namespace SoD - _log(NET__IDENTIFY, "Registered patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -90,10 +91,10 @@ namespace SoD opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -246,7 +247,7 @@ namespace SoD if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -358,7 +359,7 @@ namespace SoD if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -390,13 +391,13 @@ namespace SoD } else { - _log(NET__ERROR, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //_log(NET__ERROR, "Sending inventory to client"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -682,16 +683,16 @@ namespace SoD ENCODE(OP_GroupUpdate) { - //_log(NET__ERROR, "OP_GroupUpdate"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //_log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -709,7 +710,7 @@ namespace SoD return; } //if(gjs->action == groupActLeave) - // _log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -726,19 +727,19 @@ namespace SoD if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //_log(NET__ERROR, "Struct is GroupUpdate2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //_log(NET__ERROR, "Yourname is %s", gu2->yourname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //_log(NET__ERROR, "Membername[%i] is %s", i, gu2->membername[i]); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -746,7 +747,7 @@ namespace SoD } } - //_log(NET__ERROR, "Leadername is %s", gu2->leadersname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); char *Buffer = (char *)outapp->pBuffer; @@ -806,7 +807,7 @@ namespace SoD return; } - //_log(NET__ERROR, "Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -966,7 +967,7 @@ namespace SoD char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2107,7 +2108,7 @@ namespace SoD if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2362,16 +2363,16 @@ namespace SoD //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //_log(NET__STRUCTS, "Spawn name is [%s]", emu->name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //_log(NET__STRUCTS, "Spawn packet size is %i, entries = %i", in->size, entrycount); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer; @@ -2962,7 +2963,7 @@ namespace SoD DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_Disband"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -2976,7 +2977,7 @@ namespace SoD DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -2990,7 +2991,7 @@ namespace SoD DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3004,7 +3005,7 @@ namespace SoD DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupInvite"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -3017,7 +3018,7 @@ namespace SoD DECODE(OP_GroupInvite2) { - //_log(NET__ERROR, "Received incoming OP_GroupInvite2. Forwarding"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -3090,7 +3091,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - _log(NET__ERROR, "Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); @@ -3383,7 +3384,7 @@ namespace SoD std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //_log(NET__ERROR, "Serialize called for: %s", item->Name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); SoD::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 8405f9def..913e300b5 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1,4 +1,5 @@ #include "../debug.h" +#include "../eqemu_logsys.h" #include "sof.h" #include "../opcodemgr.h" #include "../logsys.h" @@ -49,7 +50,7 @@ namespace SoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -75,7 +76,7 @@ namespace SoF - _log(NET__IDENTIFY, "Registered patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -90,10 +91,10 @@ namespace SoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -213,7 +214,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -336,7 +337,7 @@ namespace SoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -370,13 +371,13 @@ namespace SoF } else { - _log(NET__ERROR, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //_log(NET__ERROR, "Sending inventory to client"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -765,7 +766,7 @@ namespace SoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1706,7 +1707,7 @@ namespace SoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1886,7 +1887,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -2095,7 +2096,7 @@ namespace SoF //kill off the emu structure and send the eq packet. delete[] __emu_buffer; - //_log(NET__ERROR, "Sending zone spawns"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawns"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -2428,7 +2429,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - _log(NET__ERROR, "Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); @@ -2707,7 +2708,7 @@ namespace SoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //_log(NET__ERROR, "Serialize called for: %s", item->Name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); SoF::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/patches/template.cpp b/common/patches/template.cpp index 8c4be992c..5120a2ef2 100644 --- a/common/patches/template.cpp +++ b/common/patches/template.cpp @@ -23,7 +23,7 @@ void Register(EQStreamIdentifier &into) { //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if(!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -55,10 +55,10 @@ void Reload() { opfile += name; opfile += ".conf"; if(!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index f40c0266c..b24021f87 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1,4 +1,5 @@ #include "../debug.h" +#include "../eqemu_logsys.h" #include "titanium.h" #include "../opcodemgr.h" #include "../logsys.h" @@ -47,7 +48,7 @@ namespace Titanium //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -73,7 +74,7 @@ namespace Titanium - _log(NET__IDENTIFY, "Registered patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -88,10 +89,10 @@ namespace Titanium opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -186,7 +187,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -267,7 +268,7 @@ namespace Titanium int itemcount = in->size / sizeof(InternalSerializedItem_Struct); if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; return; } @@ -284,7 +285,7 @@ namespace Titanium safe_delete_array(serialized); } else { - _log(NET__STRUCTS, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -634,7 +635,7 @@ namespace Titanium char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1156,7 +1157,7 @@ namespace Titanium if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1273,7 +1274,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -1622,7 +1623,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - _log(NET__ERROR, "Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 1ebd8dc8d..f896a4c3f 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -1,4 +1,5 @@ #include "../debug.h" +#include "../eqemu_logsys.h" #include "underfoot.h" #include "../opcodemgr.h" #include "../logsys.h" @@ -49,7 +50,7 @@ namespace Underfoot //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -75,7 +76,7 @@ namespace Underfoot - _log(NET__IDENTIFY, "Registered patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -90,10 +91,10 @@ namespace Underfoot opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - _log(NET__OPCODES, "Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - _log(NET__OPCODES, "Reloaded opcodes for patch %s", name); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -306,7 +307,7 @@ namespace Underfoot if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -493,7 +494,7 @@ namespace Underfoot if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -525,13 +526,13 @@ namespace Underfoot safe_delete_array(Serialized); } else { - _log(NET__ERROR, "Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //_log(NET__ERROR, "Sending inventory to client"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -838,16 +839,16 @@ namespace Underfoot ENCODE(OP_GroupUpdate) { - //_log(NET__ERROR, "OP_GroupUpdate"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //_log(NET__ERROR, "Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //_log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -866,7 +867,7 @@ namespace Underfoot return; } //if(gjs->action == groupActLeave) - // _log(NET__ERROR, "Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -883,19 +884,19 @@ namespace Underfoot if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //_log(NET__ERROR, "Struct is GroupUpdate2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //_log(NET__ERROR, "Yourname is %s", gu2->yourname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //_log(NET__ERROR, "Membername[%i] is %s", i, gu2->membername[i]); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -903,7 +904,7 @@ namespace Underfoot } } - //_log(NET__ERROR, "Leadername is %s", gu2->leadersname); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -963,7 +964,7 @@ namespace Underfoot delete in; return; } - //_log(NET__ERROR, "Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1189,7 +1190,7 @@ namespace Underfoot char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - _log(NET__STRUCTS, "Serialization failed on item slot %d.", int_struct->slot_id); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2373,7 +2374,7 @@ namespace Underfoot if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2623,16 +2624,16 @@ namespace Underfoot //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - _log(NET__STRUCTS, "Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //_log(NET__STRUCTS, "Spawn name is [%s]", emu->name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //_log(NET__STRUCTS, "Spawn packet size is %i, entries = %i", in->size, entrycount); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer; @@ -3275,7 +3276,7 @@ namespace Underfoot DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_Disband"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -3289,7 +3290,7 @@ namespace Underfoot DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3303,7 +3304,7 @@ namespace Underfoot DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupFollow2"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3317,7 +3318,7 @@ namespace Underfoot DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //_log(NET__ERROR, "Received incoming OP_GroupInvite"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -3330,7 +3331,7 @@ namespace Underfoot DECODE(OP_GroupInvite2) { - //_log(NET__ERROR, "Received incoming OP_GroupInvite2. Forwarding"); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -3405,7 +3406,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - _log(NET__ERROR, "Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = UnderfootToServerSlot(eq->from_slot); emu->to_slot = UnderfootToServerSlot(eq->to_slot); @@ -3628,7 +3629,7 @@ namespace Underfoot std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //_log(NET__ERROR, "Serialize called for: %s", item->Name); + //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); Underfoot::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 9b568b12e..06ab1a5b3 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -1,5 +1,6 @@ #include "debug.h" +#include "eqemu_logsys.h" #include "struct_strategy.h" #include "logsys.h" #include "eq_stream.h" @@ -38,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo EQApplicationPacket *p = *in_p; *in_p = nullptr; - _log(NET__STRUCTS, "Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); delete p; } void StructStrategy::ErrorDecoder(EQApplicationPacket *p) { - _log(NET__STRUCTS, "Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); p->SetOpcode(OP_Unknown); } diff --git a/common/worldconn.cpp b/common/worldconn.cpp index d43009b23..c0aafd19f 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include "worldconn.h" @@ -43,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) { void WorldConnection::OnConnected() { const EQEmuConfig *Config=EQEmuConfig::get(); - _log(NET__WORLD, "Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16); MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); @@ -75,7 +76,7 @@ bool WorldConnection::Connect() { if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { return true; } else { - _log(NET__WORLD, "WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); } return false; } From 34f30b974e05e5b620ec15181b35be64df6df980 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:07:16 -0600 Subject: [PATCH 040/707] More netcode debugging _log to logger.LogDebugType --- common/eq_stream.cpp | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index d2326cf7b..475fab95e 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { - _log(NET__DEBUG, _L "Session not initialized, packet ignored" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -184,7 +184,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - _log(NET__DEBUG, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); @@ -193,7 +193,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - _log(NET__DEBUG, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { @@ -234,7 +234,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - _log(NET__DEBUG, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); @@ -243,7 +243,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - _log(NET__DEBUG, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { @@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) return; if(OpMgr == nullptr || *OpMgr == nullptr) { - _log(NET__DEBUG, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; } @@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd) if(SeqEmpty && NonSeqEmpty) { //no more data to send if(CheckState(CLOSING)) { - _log(NET__DEBUG, _L "All outgoing data flushed, closing stream." __L ); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); //we are waiting for the queues to empty, now we can do our disconnect. //this packet will not actually go out until the next call to Write(). _SendDisconnect(); @@ -1113,7 +1113,7 @@ uint32 newlength=0; delete p; ProcessQueue(); } else { - _log(NET__DEBUG, _L "Incoming packet failed checksum" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); _hex(NET__NET_CREATE_HEX, buffer, length); } } @@ -1214,7 +1214,7 @@ void EQStream::ProcessQueue() EQProtocolPacket *qp=nullptr; while((qp=RemoveQueue(NextInSeq))!=nullptr) { - _log(NET__DEBUG, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; _log(NET__APP_TRACE, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); @@ -1327,22 +1327,22 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { switch(orig_state) { case CLOSING: //if we time out in the closing state, they are not acking us, just give up - _log(NET__DEBUG, _L "Timeout expired in closing state. Moving to closed state." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); _SendDisconnect(); SetState(CLOSED); break; case DISCONNECTING: //we timed out waiting for them to send us the disconnect reply, just give up. - _log(NET__DEBUG, _L "Timeout expired in disconnecting state. Moving to closed state." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); SetState(CLOSED); break; case CLOSED: - _log(NET__DEBUG, _L "Timeout expired in closed state??" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); break; case ESTABLISHED: //we timed out during normal operation. Try to be nice about it. //we will almost certainly time out again waiting for the disconnect reply, but oh well. - _log(NET__DEBUG, _L "Timeout expired in established state. Closing connection." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); _SendDisconnect(); SetState(DISCONNECTING); break; @@ -1393,12 +1393,12 @@ void EQStream::AdjustRates(uint32 average_delta) void EQStream::Close() { if(HasOutgoingData()) { //there is pending data, wait for it to go out. - _log(NET__DEBUG, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); SetState(CLOSING); } else { //otherwise, we are done, we can drop immediately. _SendDisconnect(); - _log(NET__DEBUG, _L "Stream closing immediate due to Close()" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); SetState(DISCONNECTING); } } From bc02d7c31acdb2d90cd9efc6542d4a71014a24ce Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:20:11 -0600 Subject: [PATCH 041/707] More netcode debugging _log to logger.LogDebugType --- common/eq_stream.cpp | 196 +++++++++++++++++++++---------------------- 1 file changed, 98 insertions(+), 98 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 475fab95e..9a957f5a7 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) { OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; - _log(NET__APP_CREATE, _L "Creating new application packet, length %d" __L, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; @@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { EQRawApplicationPacket *ap=nullptr; - _log(NET__APP_CREATE, _L "Creating new application packet, length %d" __L, len); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; @@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processed < p->size) { subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); - _log(NET__NET_CREATE, _L "Extracting combined packet of length %d" __L, subpacket_length); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processedsize) { EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { - _log(NET__NET_CREATE, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); processed+=subpacket_length+1; } else { subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1)); - _log(NET__NET_CREATE, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length); processed+=subpacket_length+3; } @@ -178,7 +178,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Packet: { if(!p->pBuffer || (p->Size() < 4)) { - _log(NET__ERROR, _L "Received OP_Packet that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); @@ -188,7 +188,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - _log(NET__APP_TRACE, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); @@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // Check for an embedded OP_AppCombinded (protocol level 0x19) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); - _log(NET__NET_CREATE, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -228,7 +228,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Fragment: { if(!p->pBuffer || (p->Size() < 4)) { - _log(NET__ERROR, _L "Received OP_Fragment that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); @@ -238,7 +238,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - _log(NET__APP_TRACE, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); @@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (oversize_buffer) { memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2); oversize_offset+=p->size-2; - _log(NET__NET_TRACE, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); if (oversize_offset==oversize_length) { if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); - _log(NET__NET_CREATE, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); //_raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; } else { EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset); - _log(NET__NET_CREATE, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); if (ap) { ap->copyInfo(p); InboundQueuePush(ap); @@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) oversize_buffer=new unsigned char[oversize_length]; memcpy(oversize_buffer,p->pBuffer+6,p->size-6); oversize_offset=p->size-6; - _log(NET__NET_TRACE, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); } } } @@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_KeepAlive: { #ifndef COLLECTOR NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size)); - _log(NET__NET_TRACE, _L "Received and queued reply to keep alive" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); #endif } break; case OP_Ack: { if(!p->pBuffer || (p->Size() < 4)) { - _log(NET__ERROR, _L "Received OP_Ack that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionRequest: { if(p->Size() < sizeof(SessionRequest)) { - _log(NET__ERROR, _L "Received OP_SessionRequest that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); break; } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - _log(NET__ERROR, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case // streamactive means we identified the opcode for the stream, we cannot re-establish this connection @@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); SetMaxLen(ntohl(Request->MaxLength)); - _log(NET__NET_TRACE, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); SetState(ESTABLISHED); #ifndef COLLECTOR Key=0x11223344; @@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionResponse: { if(p->Size() < sizeof(SessionResponse)) { - _log(NET__ERROR, _L "Received OP_SessionResponse that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); break; } @@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) compressed=(Response->Format&FLAG_COMPRESSED); encoded=(Response->Format&FLAG_ENCODED); - _log(NET__NET_TRACE, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); // Kinda kludgy, but trie for now if (StreamType==UnknownStream) { @@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) EQStreamState state = GetState(); if(state == ESTABLISHED) { //client initiated disconnect? - _log(NET__NET_TRACE, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); _SendDisconnect(); SetState(CLOSED); } else if(state == CLOSING) { //we were waiting for this anyways, ignore pending messages, send the reply and be closed. - _log(NET__NET_TRACE, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); _SendDisconnect(); SetState(CLOSED); } else { //we are expecting this (or have already gotten it, but dont care either way) - _log(NET__NET_TRACE, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); SetState(CLOSED); } } @@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_OutOfOrderAck: { if(!p->pBuffer || (p->Size() < 4)) { - _log(NET__ERROR, _L "Received OP_OutOfOrderAck that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } //if the packet they got out of order is between our last acked packet and the last sent packet, then its valid. if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) { - _log(NET__NET_TRACE, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, seq, SequencedBase, SequencedBase+NextSequencedSend); bool retransmit_acked_packets = false; @@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if(!retransmit_acked_packets) { uint16 sqsize = SequencedQueue.size(); uint16 index = seq - SequencedBase; - _log(NET__NET_TRACE, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); if (index < sqsize) { std::deque::iterator sitr; sitr = SequencedQueue.begin(); @@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) NextSequencedSend = 0; } else { - _log(NET__NET_TRACE, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionStatRequest: { if(p->Size() < sizeof(SessionStats)) { - _log(NET__ERROR, _L "Received OP_SessionStatRequest that was of malformed size" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); break; } #ifndef COLLECTOR SessionStats *Stats=(SessionStats *)p->pBuffer; - _log(NET__NET_TRACE, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, (unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta), (unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta), (unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta)); @@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX) retransmittimeout = RETRANSMIT_TIMEOUT_MAX; - _log(NET__NET_TRACE, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); } } #endif } break; case OP_SessionStatResponse: { - _log(NET__NET_TRACE, _L "Received OP_SessionStatResponse. Ignoring." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); } break; case OP_OutOfSession: { - _log(NET__NET_TRACE, _L "Received OP_OutOfSession. Ignoring." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); } break; default: @@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) // Convert the EQApplicationPacket to 1 or more EQProtocolPackets if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2) - _log(NET__FRAGMENT, _L "Making oversized packet, len %d" __L, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); @@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); - _log(NET__FRAGMENT, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); SequencedPush(out); @@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) out->size=chunksize+2; SequencedPush(out); used+=chunksize; - _log(NET__FRAGMENT, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); } delete p; delete[] tmpbuff; @@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p) #else MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } - _log(NET__APP_TRACE, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); *(uint16 *)(p->pBuffer)=htons(NextOutSeq); SequencedQueue.push_back(p); NextOutSeq++; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) delete p; #else MOutboundQueue.lock(); - _log(NET__APP_TRACE, _L "Pushing non-sequenced packet of length %d" __L, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); NonSequencedQueue.push(p); MOutboundQueue.unlock(); #endif @@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) void EQStream::SendAck(uint16 seq) { uint16 Seq=htons(seq); - _log(NET__NET_ACKS, _L "Sending ack with sequence %d" __L, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); SetLastAckSent(seq); NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16))); } void EQStream::SendOutOfOrderAck(uint16 seq) { - _log(NET__APP_TRACE, _L "Sending out of order ack with sequence %d" __L, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); uint16 Seq=htons(seq); NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16))); } @@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd) // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) { - _log(NET__NET_TRACE, _L "Timeout since last ack received, starting retransmit at the start of our unacked " + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " "buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend); NextSequencedSend = 0; retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet @@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // And remove it form the queue p = NonSequencedQueue.front(); - _log(NET__NET_COMBINE, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); NonSequencedQueue.pop(); } else if (!p->combine(NonSequencedQueue.front())) { // Tryint to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - _log(NET__NET_COMBINE, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - _log(NET__RATES, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked, so just remove this packet and it's spot in the queue - _log(NET__NET_COMBINE, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); delete NonSequencedQueue.front(); NonSequencedQueue.pop(); } @@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd) if (sitr!=SequencedQueue.end()) { if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging... if(SequencedQueue.empty()) { - _log(NET__ERROR, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); SeqEmpty=true; continue; } if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) { if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) { - _log(NET__NET_TRACE, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); sitr++; NextSequencedSend++; } else if (!p) { // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - _log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - _log(NET__NET_COMBINE, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - _log(NET__RATES, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - _log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } @@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - _log(NET__NET_COMBINE, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - _log(NET__NET_COMBINE, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - _log(NET__RATES, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - _log(NET__NET_COMBINE, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } else { // No more sequenced packets @@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd) // We have a packet still, must have run out of both seq and non-seq, so send it if (p) { - _log(NET__NET_COMBINE, _L "Final combined packet not full, len %d" __L, p->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); ReadyToSend.push(p); BytesWritten+=p->size; } @@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses out->size=sizeof(SessionResponse); - _log(NET__NET_TRACE, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no"); NonSequencedPush(out); @@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); - _log(NET__NET_TRACE, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); NonSequencedPush(out); } @@ -932,7 +932,7 @@ void EQStream::_SendDisconnect() *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); - _log(NET__NET_TRACE, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); } void EQStream::InboundQueuePush(EQRawApplicationPacket *p) @@ -1016,7 +1016,7 @@ void EQStream::InboundQueueClear() { EQApplicationPacket *p=nullptr; - _log(NET__APP_TRACE, _L "Clearing inbound queue" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); MInboundQueue.lock(); if (!InboundQueue.empty()) { @@ -1059,7 +1059,7 @@ void EQStream::OutboundQueueClear() { EQProtocolPacket *p=nullptr; - _log(NET__APP_TRACE, _L "Clearing outbound queue" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); MOutboundQueue.lock(); while(!NonSequencedQueue.empty()) { @@ -1081,7 +1081,7 @@ void EQStream::PacketQueueClear() { EQProtocolPacket *p=nullptr; - _log(NET__APP_TRACE, _L "Clearing future packet queue" __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); if(!PacketQueue.empty()) { std::map::iterator itr; @@ -1143,33 +1143,33 @@ std::deque::iterator itr, tmp; MOutboundQueue.lock(); //do a bit of sanity checking. if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } SeqOrder ord = CompareSequence(SequencedBase, seq); if(ord == SeqInOrder) { //they are not acking anything new... - _log(NET__NET_ACKS, _L "Received an ack with no window advancement (seq %d)." __L, seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); } else if(ord == SeqPast) { //they are nacking blocks going back before our buffer, wtf? - _log(NET__NET_ACKS, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); } else { - _log(NET__NET_ACKS, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); //this is a good ack, we get to ack some blocks. seq++; //we stop at the block right after their ack, counting on the wrap of both numbers. while(SequencedBase != seq) { if(SequencedQueue.empty()) { -_log(NET__ERROR, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); +logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); SequencedBase = NextOutSeq; NextSequencedSend = 0; break; } - _log(NET__NET_ACKS, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); //clean out the acked packet delete SequencedQueue.front(); SequencedQueue.pop_front(); @@ -1180,10 +1180,10 @@ _log(NET__ERROR, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is SequencedBase++; } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - _log(NET__ERROR, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - _log(NET__ERROR, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } @@ -1193,7 +1193,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::SetNextAckToSend(uint32 seq) { MAcks.lock(); - _log(NET__NET_ACKS, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); NextAckToSend=seq; MAcks.unlock(); } @@ -1201,7 +1201,7 @@ void EQStream::SetNextAckToSend(uint32 seq) void EQStream::SetLastAckSent(uint32 seq) { MAcks.lock(); - _log(NET__NET_ACKS, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); LastAckSent=seq; MAcks.unlock(); } @@ -1217,7 +1217,7 @@ void EQStream::ProcessQueue() logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; - _log(NET__APP_TRACE, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } } @@ -1228,21 +1228,21 @@ EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); - _log(NET__APP_TRACE, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } return qp; } void EQStream::SetStreamType(EQStreamType type) { - _log(NET__NET_TRACE, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); StreamType=type; switch (StreamType) { case LoginStream: app_opcode_size=1; compressed=false; encoded=false; - _log(NET__NET_TRACE, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); break; case ChatOrMailStream: case ChatStream: @@ -1250,7 +1250,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=1; compressed=false; encoded=true; - _log(NET__NET_TRACE, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); break; case ZoneStream: case WorldStream: @@ -1258,7 +1258,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=2; compressed=true; encoded=false; - _log(NET__NET_TRACE, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); break; } } @@ -1308,7 +1308,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq) void EQStream::SetState(EQStreamState state) { MState.lock(); - _log(NET__NET_TRACE, _L "Changing state from %d to %d" __L, State, state); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); State=state; MState.unlock(); } @@ -1320,7 +1320,7 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { EQStreamState orig_state = GetState(); if (orig_state == CLOSING && !outgoing_data) { - _log(NET__NET_TRACE, _L "Out of data in closing state, disconnecting." __L); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); _SendDisconnect(); SetState(DISCONNECTING); } else if (LastPacket && (now-LastPacket) > timeout) { @@ -1371,11 +1371,11 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - _log(NET__RATES, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } else { - _log(NET__RATES, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, AVERAGE_DELTA_MAX); } } else { @@ -1383,7 +1383,7 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - _log(NET__RATES, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } From 6e11baf30827be770215da5687a852e5843ea701 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:28:16 -0600 Subject: [PATCH 042/707] Convert world debugging _log to logger.LogDebugType --- queryserv/queryserv.cpp | 2 +- ucs/ucs.cpp | 4 +- world/client.cpp | 48 +++++++-------- world/cliententry.cpp | 2 +- world/clientlist.cpp | 14 ++--- world/console.cpp | 24 ++++---- world/eqw.cpp | 6 +- world/eqw_http_handler.cpp | 18 +++--- world/eqw_parser.cpp | 6 +- world/launcher_link.cpp | 24 ++++---- world/launcher_list.cpp | 10 ++-- world/login_server.cpp | 32 +++++----- world/login_server_list.cpp | 2 +- world/net.cpp | 116 ++++++++++++++++++------------------ world/zonelist.cpp | 8 +-- world/zoneserver.cpp | 8 +-- zone/net.cpp | 4 +- 17 files changed, 164 insertions(+), 164 deletions(-) diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index fa52a11f5..425ab0f9e 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -83,7 +83,7 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - _log(WORLD__INIT_ERR, "Cannot continue without a database connection."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 2024bf155..6d3d8975e 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -104,14 +104,14 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - _log(WORLD__INIT_ERR, "Cannot continue without a database connection."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - _log(WORLD__INIT, "Loading rule set '%s'", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { _log(UCS__ERROR, "Failed to load ruleset '%s', falling back to defaults.", tmp); } diff --git a/world/client.cpp b/world/client.cpp index 01130302d..a2ee6638f 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1519,7 +1519,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) if (!cc) return false; - _log(WORLD__CLIENT, "Validating char creation info..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); RaceClassCombos class_combo; bool found = false; @@ -1536,7 +1536,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - _log(WORLD__CLIENT_ERR, "Could not find class/race/deity/start_zone combination"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); return false; } @@ -1553,7 +1553,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - _log(WORLD__CLIENT_ERR, "Could not find starting stats for selected character combo, cannot verify stats"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); return false; } @@ -1566,37 +1566,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) allocation.DefaultPointAllocation[6]; if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) { - _log(WORLD__CLIENT_ERR, "Strength out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); return false; } if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) { - _log(WORLD__CLIENT_ERR, "Dexterity out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); return false; } if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) { - _log(WORLD__CLIENT_ERR, "Agility out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); return false; } if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) { - _log(WORLD__CLIENT_ERR, "Stamina out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); return false; } if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) { - _log(WORLD__CLIENT_ERR, "Intelligence out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); return false; } if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) { - _log(WORLD__CLIENT_ERR, "Wisdom out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); return false; } if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) { - _log(WORLD__CLIENT_ERR, "Charisma out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); return false; } @@ -1609,7 +1609,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) current_stats += cc->WIS - allocation.BaseStats[5]; current_stats += cc->CHA - allocation.BaseStats[6]; if (current_stats > max_stats) { - _log(WORLD__CLIENT_ERR, "Current Stats > Maximum Stats"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); return false; } @@ -1690,7 +1690,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) if (!cc) return false; - _log(WORLD__CLIENT,"Validating char creation info..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); classtemp = cc->class_ - 1; racetemp = cc->race - 1; @@ -1703,16 +1703,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // if out of range looking it up in the table would crash stuff // so we return from these if (classtemp >= PLAYER_CLASS_COUNT) { - _log(WORLD__CLIENT_ERR," class is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); return false; } if (racetemp >= _TABLE_RACES) { - _log(WORLD__CLIENT_ERR," race is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); return false; } if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs? - _log(WORLD__CLIENT_ERR," invalid race/class combination"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); // we return from this one, since if it's an invalid combination our table // doesn't have meaningful values for the stats return false; @@ -1740,43 +1740,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // that are messed up not just the first hit if (bTOTAL + stat_points != cTOTAL) { - _log(WORLD__CLIENT_ERR," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); Charerrors++; } if (cc->STR > bSTR + stat_points || cc->STR < bSTR) { - _log(WORLD__CLIENT_ERR," stat STR is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); Charerrors++; } if (cc->STA > bSTA + stat_points || cc->STA < bSTA) { - _log(WORLD__CLIENT_ERR," stat STA is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); Charerrors++; } if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) { - _log(WORLD__CLIENT_ERR," stat AGI is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); Charerrors++; } if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) { - _log(WORLD__CLIENT_ERR," stat DEX is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); Charerrors++; } if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) { - _log(WORLD__CLIENT_ERR," stat WIS is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); Charerrors++; } if (cc->INT > bINT + stat_points || cc->INT < bINT) { - _log(WORLD__CLIENT_ERR," stat INT is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); Charerrors++; } if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) { - _log(WORLD__CLIENT_ERR," stat CHA is out of range"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); Charerrors++; } /*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of) I am NOT writing those tables - kathgar*/ - _log(WORLD__CLIENT,"Found %d errors in character creation request", Charerrors); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); return Charerrors == 0; } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index 5e93a8668..8f2301f1d 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) { int16 tmpStatus = WorldConfig::get()->DefaultStatus; paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID()); if (!paccountid) { - _log(WORLD__CLIENTLIST_ERR,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); return false; } strn0cpy(paccountname, plsname, sizeof(paccountname)); diff --git a/world/clientlist.cpp b/world/clientlist.cpp index f2e1c8b9b..1a4237186 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -56,7 +56,7 @@ void ClientList::Process() { if (!iterator.GetData()->Process()) { struct in_addr in; in.s_addr = iterator.GetData()->GetIP(); - _log(WORLD__CLIENTLIST,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); //the client destructor should take care of this. // iterator.GetData()->Free(); iterator.RemoveCurrent(); @@ -425,7 +425,7 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword) } int16 tmpadmin; - //_log(WORLD__ZONELIST,"Login with '%s' and '%s'", iName, iPassword); + //logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login with '%s' and '%s'", iName, iPassword); uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin); if (accid) { @@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID) if(!from) { - _log(WORLD__CLIENT_ERR,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); return; } @@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S safe_delete(output); } catch(...){ - _log(WORLD__ZONELIST_ERR,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); return; } } @@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon safe_delete(pack2); } catch(...){ - _log(WORLD__ZONELIST_ERR,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); return; } } @@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) { iterator.Reset(); while(iterator.MoreElements()) { - _log(WORLD__CLIENTLIST, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); if (iterator.GetData()->GetAccountID() == account_id) { Client* tmp = iterator.GetData(); return tmp; @@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) { iterator.Reset(); while(iterator.MoreElements()) { - _log(WORLD__CLIENTLIST, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); if (iterator.GetData()->GetCharName() == charname) { Client* tmp = iterator.GetData(); return tmp; diff --git a/world/console.cpp b/world/console.cpp index c57a85f43..a6cb6027d 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -88,7 +88,7 @@ void Console::Die() { state = CONSOLE_STATE_CLOSED; struct in_addr in; in.s_addr = GetIP(); - _log(WORLD__CONSOLE,"Removing console from %s:%d",inet_ntoa(in),GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); tcpc->Disconnect(); } @@ -219,7 +219,7 @@ bool Console::Process() { if (!tcpc->Connected()) { struct in_addr in; in.s_addr = GetIP(); - _log(WORLD__CONSOLE,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); return false; } //if we have not gotten the special markers after this timer, send login prompt @@ -234,7 +234,7 @@ bool Console::Process() { SendMessage(1, "Timeout, disconnecting..."); struct in_addr in; in.s_addr = GetIP(); - _log(WORLD__CONSOLE,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); return false; } @@ -243,29 +243,29 @@ bool Console::Process() { in.s_addr = GetIP(); if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) { auto zs = new ZoneServer(tcpc); - _log(WORLD__CONSOLE,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); zoneserver_list.Add(zs); numzones++; tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) { - _log(WORLD__CONSOLE,"New launcher from %s:%d", inet_ntoa(in), GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); launcher_list.Add(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) { - _log(WORLD__CONSOLE,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); UCSLink.SetConnection(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) { - _log(WORLD__CONSOLE,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); QSLink.SetConnection(tcpc); tcpc = 0; } else { - _log(WORLD__CONSOLE,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); } return false; } @@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) { state = CONSOLE_STATE_CLOSED; return; } - _log(WORLD__CONSOLE,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); SendMessage(1, 0); SendMessage(2, "Login accepted."); state = CONSOLE_STATE_CONNECTED; @@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) { break; } case CONSOLE_STATE_CONNECTED: { - _log(WORLD__CONSOLE,"TCP command: %s: \"%s\"",paccountname,command); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); Seperator sep(command); if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) { SendMessage(1, " whoami"); @@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) { tmpname[0] = '*'; strcpy(&tmpname[1], paccountname); - _log(WORLD__CONSOLE,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0)); } } @@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) { #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); - _log(WORLD__CONSOLE,"Login Server Reconnect manually restarted by Console"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); } else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) { if (strcasecmp(sep.arg[1], "list") == 0) { diff --git a/world/eqw.cpp b/world/eqw.cpp index 343aa9ebd..b85720808 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -75,11 +75,11 @@ EQW::EQW() { void EQW::AppendOutput(const char *str) { m_outputBuffer += str; -// _log(WORLD__EQW, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length()); +// logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length()); } const std::string &EQW::GetOutput() const { -// _log(WORLD__EQW, "Getting, length %d", m_outputBuffer.length()); +// logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Getting, length %d", m_outputBuffer.length()); return(m_outputBuffer); } @@ -269,7 +269,7 @@ void EQW::LSReconnect() { pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; - _log(WORLD__CONSOLE,"Login Server Reconnect manually restarted by Web Tool"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index 70c56acfa..ae2f18403 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const { int16 status = 0; uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status); if(acctid == 0) { - _log(WORLD__HTTP_ERR, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); return(false); } if(status < httpLoginStatus) { - _log(WORLD__HTTP_ERR, "Login of %s failed: status too low.", m_username.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); return(false); } @@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP } void EQWHTTPServer::Stop() { - _log(WORLD__HTTP, "Requesting that HTTP Service stop."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); m_running = false; Close(); } bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { if(m_running) { - _log(WORLD__HTTP_ERR, "HTTP Service is already running on port %d", m_port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); return(false); } //load up our nice mime types if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) { - _log(WORLD__HTTP_ERR, "Failed to load mime types from '%s'", mime_file); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); return(false); } else { - _log(WORLD__HTTP, "Loaded mime types from %s", mime_file); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); } //fire up the server thread char errbuf[TCPServer_ErrorBufferSize]; if(!Open(port, errbuf)) { - _log(WORLD__HTTP_ERR, "Unable to bind to port %d for HTTP service: %s", port, errbuf); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); return(false); } @@ -320,12 +320,12 @@ bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { /* void EQWHTTPServer::Run() { - _log(WORLD__HTTP, "HTTP Processing thread started on port %d", m_port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread started on port %d", m_port); do { #warning DELETE THIS IF YOU DONT USE IT Sleep(10); } while(m_running); - _log(WORLD__HTTP, "HTTP Processing thread terminating on port %d", m_port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread terminating on port %d", m_port); } ThreadReturnType EQWHTTPServer::ThreadProc(void *data) { diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index 172c839d7..0a4a19ff5 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -65,7 +65,7 @@ EQWParser::EQWParser() { my_perl = perl_alloc(); _empty_sv = newSV(0); if(!my_perl) - _log(WORLD__PERL_ERR, "Error: perl_alloc failed!"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); else DoInit(); } @@ -182,10 +182,10 @@ void EQWParser::DoInit() { #ifdef EMBPERL_PLUGIN - _log(WORLD__PERL, "Loading worldui perl plugins."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); std::string err; if(!eval_file("world", "worldui.pl", err)) { - _log(WORLD__PERL_ERR, "Warning - world.pl: %s", err.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); } eval_pv( diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index c72416a2d..4a56e4977 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -79,7 +79,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - _log(WORLD__LAUNCH_ERR, "Launcher authorization failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -90,7 +90,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - _log(WORLD__LAUNCH_ERR, "Launcher authorization failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -100,7 +100,7 @@ bool LauncherLink::Process() { } else { - _log(WORLD__LAUNCH,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -114,25 +114,25 @@ bool LauncherLink::Process() { break; } case ServerOP_ZAAuth: { - _log(WORLD__LAUNCH, "Got authentication from %s when they are already authenticated.", m_name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); break; } case ServerOP_LauncherConnectInfo: { const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer; if(HasName()) { - _log(WORLD__LAUNCH_ERR, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); break; } m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); if(config == nullptr) { - _log(WORLD__LAUNCH, "Unknown launcher '%s' connected. Disconnecting.", it->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; } - _log(WORLD__LAUNCH, "Launcher Identified itself as '%s'. Loading zone list.", it->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); std::vector result; //database.GetLauncherZones(it->name, result); @@ -146,7 +146,7 @@ bool LauncherLink::Process() { zs.port = cur->port; zs.up = false; zs.starts = 0; - _log(WORLD__LAUNCH_TRACE, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); m_states[cur->name] = zs; } @@ -162,17 +162,17 @@ bool LauncherLink::Process() { std::map::iterator res; res = m_states.find(it->short_name); if(res == m_states.end()) { - _log(WORLD__LAUNCH_ERR, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); break; } - _log(WORLD__LAUNCH, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); res->second.up = it->running; res->second.starts = it->start_count; break; } default: { - _log(WORLD__LAUNCH_ERR, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) { zs.port = port; zs.up = false; zs.starts = 0; - _log(WORLD__LAUNCH_TRACE, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); m_states[short_name] = zs; StartZone(short_name); diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 0722cb1e9..1f220c8b6 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -60,7 +60,7 @@ void LauncherList::Process() { //printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - _log(WORLD__LAUNCH, "Removing pending launcher %d", l->GetID()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); cur = m_pendingLaunchers.erase(cur); delete l; } else if(l->HasName()) { @@ -72,10 +72,10 @@ void LauncherList::Process() { std::map::iterator res; res = m_launchers.find(name); if(res != m_launchers.end()) { - _log(WORLD__LAUNCH, "Ghosting launcher %s", name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); delete res->second; } - _log(WORLD__LAUNCH, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); //put the launcher in the list. m_launchers[name] = l; } else { @@ -91,7 +91,7 @@ void LauncherList::Process() { //printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - _log(WORLD__LAUNCH, "Removing launcher %s (%d)", l->GetName(), l->GetID()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); curl = m_launchers.erase(curl); delete l; } else { @@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { void LauncherList::Add(EmuTCPConnection *conn) { auto it = new LauncherLink(nextID++, conn); - _log(WORLD__LAUNCH, "Adding pending launcher %d", it->GetID()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); m_pendingLaunchers.push_back(it); } diff --git a/world/login_server.cpp b/world/login_server.cpp index a448c0826..1a9eabda3 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -96,7 +96,7 @@ bool LoginServer::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - _log(WORLD__LS_TRACE,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { @@ -160,12 +160,12 @@ bool LoginServer::Process() { case ServerOP_LSFatalError: { #ifndef IGNORE_LS_FATAL_ERROR WorldConfig::DisableLoginserver(); - _log(WORLD__LS_ERR, "Login server responded with FatalError. Disabling reconnect."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); #else - _log(WORLD__LS_ERR, "Login server responded with FatalError."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); #endif if (pack->size > 1) { - _log(WORLD__LS_ERR, " %s",pack->pBuffer); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); } break; } @@ -177,18 +177,18 @@ bool LoginServer::Process() { case ServerOP_LSRemoteAddr: { if (!Config->WorldAddress.length()) { WorldConfig::SetWorldAddress((char *)pack->pBuffer); - _log(WORLD__LS, "Loginserver provided %s as world address",pack->pBuffer); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); } break; } case ServerOP_LSAccountUpdate: { - _log(WORLD__LS, "Received ServerOP_LSAccountUpdate packet from loginserver"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); CanAccountUpdate = true; break; } default: { - _log(WORLD__LS_ERR, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -202,10 +202,10 @@ bool LoginServer::Process() { bool LoginServer::InitLoginServer() { if(Connected() == false) { if(ConnectReady()) { - _log(WORLD__LS, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); Connect(); } else { - _log(WORLD__LS_ERR, "Not connected but not ready to connect, this is bad: %s:%d", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", LoginServerAddress,LoginServerPort); } } @@ -216,29 +216,29 @@ bool LoginServer::Connect() { char tmp[25]; if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){ minilogin = true; - _log(WORLD__LS, "Setting World to MiniLogin Server type"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); } else minilogin = false; if (minilogin && WorldConfig::get()->WorldAddress.length()==0) { - _log(WORLD__LS_ERR, "**** For minilogin to work, you need to set the
element in the section."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); return false; } char errbuf[TCPConnection_ErrorBufferSize]; if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) { - _log(WORLD__LS_ERR, "Unable to resolve '%s' to an IP.",LoginServerAddress); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); return false; } if (LoginServerIP == 0 || LoginServerPort == 0) { - _log(WORLD__LS_ERR, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); return false; } if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) { - _log(WORLD__LS, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); if (minilogin) SendInfo(); else @@ -248,7 +248,7 @@ bool LoginServer::Connect() { return true; } else { - _log(WORLD__LS_ERR, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); return false; } } @@ -324,7 +324,7 @@ void LoginServer::SendStatus() { void LoginServer::SendAccountUpdate(ServerPacket* pack) { ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; if(CanUpdate()) { - _log(WORLD__LS, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); strn0cpy(s->worldaccount, LoginAccount, 30); strn0cpy(s->worldpassword, LoginPassword, 30); SendPacket(pack); diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index 4bce5032c..84cb4af76 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) { bool LoginServerList::SendAccountUpdate(ServerPacket* pack) { LinkedListIterator iterator(list); - _log(WORLD__LS, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); iterator.Reset(); while(iterator.MoreElements()){ if(iterator.GetData()->CanUpdate()) { diff --git a/world/net.cpp b/world/net.cpp index 3977f482b..6f3d85f5e 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -126,36 +126,36 @@ int main(int argc, char** argv) { } // Load server configuration - _log(WORLD__INIT, "Loading server configuration.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - _log(WORLD__INIT_ERR, "Loading server configuration failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - _log(WORLD__INIT, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - _log(WORLD__INIT, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - _log(WORLD__INIT, "CURRENT_VERSION: %s", CURRENT_VERSION); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - _log(WORLD__INIT_ERR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - _log(WORLD__INIT_ERR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - _log(WORLD__INIT_ERR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #endif @@ -164,7 +164,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - _log(WORLD__INIT, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -172,19 +172,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - _log(WORLD__INIT, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - _log(WORLD__INIT, "Connecting to MySQL..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - _log(WORLD__INIT_ERR, "Cannot continue without a database connection."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -280,56 +280,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - _log(WORLD__INIT, "Starting HTTP world service..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - _log(WORLD__INIT, "HTTP world service disabled."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); } - _log(WORLD__INIT, "Checking Database Conversions.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - _log(WORLD__INIT, "Loading variables.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); database.LoadVariables(); - _log(WORLD__INIT, "Loading zones.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); database.LoadZoneNames(); - _log(WORLD__INIT, "Clearing groups.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); database.ClearGroup(); - _log(WORLD__INIT, "Clearing raids.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - _log(WORLD__INIT, "Loading items.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); if (!database.LoadItems()) - _log(WORLD__INIT_ERR, "Error: Could not load item data. But ignoring"); - _log(WORLD__INIT, "Loading skill caps.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - _log(WORLD__INIT_ERR, "Error: Could not load skill cap data. But ignoring"); - _log(WORLD__INIT, "Loading guilds.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - _log(WORLD__INIT, "Loading rule set '%s'", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - _log(WORLD__INIT_ERR, "Failed to load ruleset '%s', falling back to defaults.", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - _log(WORLD__INIT, "No rule set configured, using default rules"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); } else { - _log(WORLD__INIT, "Loaded default rule set 'default'", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - _log(WORLD__INIT, "Clearing temporary merchant lists.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - _log(WORLD__INIT, "Loading EQ time of day.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - _log(WORLD__INIT_ERR, "Unable to load %s", Config->EQTimeFile.c_str()); - _log(WORLD__INIT, "Loading launcher list.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -338,45 +338,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - _log(WORLD__INIT, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - _log(WORLD__INIT, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - _log(WORLD__INIT, "Loading adventures..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - _log(WORLD__INIT_ERR, "Unable to load adventure templates."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - _log(WORLD__INIT_ERR, "Unable to load adventure templates."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - _log(WORLD__INIT, "Purging expired instances"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - _log(WORLD__INIT, "Loading char create info..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - _log(WORLD__INIT,"Zone (TCP) listener started."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); } else { - _log(WORLD__INIT_ERR,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - _log(WORLD__INIT_ERR," %s",errbuf); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - _log(WORLD__INIT,"Client (UDP) listener started."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); } else { - _log(WORLD__INIT_ERR,"Failed to start client (UDP) listener (port 9000)"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -404,7 +404,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - _log(WORLD__CLIENT, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -417,19 +417,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - _log(WORLD__CLIENT, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - _log(WORLD__CLIENT, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - _log(WORLD__CLIENT, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - _log(WORLD__CLIENT, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - _log(WORLD__ZONE, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -492,16 +492,16 @@ int main(int argc, char** argv) { } Sleep(20); } - _log(WORLD__SHUTDOWN,"World main loop completed."); - _log(WORLD__SHUTDOWN,"Shutting down console connections (if any)."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); console_list.KillAll(); - _log(WORLD__SHUTDOWN,"Shutting down zone connections (if any)."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - _log(WORLD__SHUTDOWN,"Zone (TCP) listener stopped."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); tcps.Close(); - _log(WORLD__SHUTDOWN,"Client (UDP) listener stopped."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); eqsf.Close(); - _log(WORLD__SHUTDOWN,"Signaling HTTP service to stop..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); CheckEQEMuErrorAndPause(); @@ -509,9 +509,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - _log(WORLD__SHUTDOWN,"Caught signal %d",sig_num); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - _log(WORLD__SHUTDOWN,"Failed to save time file."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); RunLoops = false; } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index cf27ed495..49d1d24eb 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -79,7 +79,7 @@ void ZSList::KillAll() { void ZSList::Process() { if(shutdowntimer && shutdowntimer->Check()){ - _log(WORLD__ZONELIST, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); auto pack2 = new ServerPacket; pack2->opcode = ServerOP_ShutdownAll; pack2->size=0; @@ -99,10 +99,10 @@ void ZSList::Process() { ZoneServer* zs = iterator.GetData(); struct in_addr in; in.s_addr = zs->GetIP(); - _log(WORLD__ZONELIST,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); zs->LSShutDownUpdate(zs->GetZoneID()); if (holdzones){ - _log(WORLD__ZONELIST,"Hold Zones mode is ON - rebooting lost zone"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); if(!zs->IsStaticZone()) RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID()); else @@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip s->port = port; s->zoneid = zoneid; if(zoneid != 0) - _log(WORLD__ZONELIST,"Rebooting static zone with the ID of: %i",zoneid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); tmp[z]->SendPacket(pack); delete pack; safe_delete_array(tmp); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 70c1cd1b1..62c7ca37a 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -209,7 +209,7 @@ bool ZoneServer::Process() { } else { - _log(WORLD__ZONE,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } } @@ -708,20 +708,20 @@ bool ZoneServer::Process() { /* Zone was already running*/ if(ingress_server) { - _log(WORLD__ZONE,"Found a zone already booted for %s\n", ztz->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); ztz->response = 1; } /* Boot the Zone*/ else { int server_id; if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){ - _log(WORLD__ZONE,"Successfully booted a zone for %s\n", ztz->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); // bootup successful, ready to rock ztz->response = 1; ingress_server = zoneserver_list.FindByID(server_id); } else { - _log(WORLD__ZONE_ERR,"FAILED to boot a zone for %s\n", ztz->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); // bootup failed, send back error code 0 ztz->response = 0; } diff --git a/zone/net.cpp b/zone/net.cpp index 39cc24b96..31648b9f9 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -385,7 +385,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqss->GetRemoteIP(); - _log(WORLD__CLIENT, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); stream_identifier.AddStream(eqss); //takes the stream } @@ -397,7 +397,7 @@ int main(int argc, char** argv) { //now that we know what patch they are running, start up their client object struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); - _log(WORLD__CLIENT, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); Client* client = new Client(eqsi); entity_list.AddClient(client); } From 6c0e2631dc4db14a479ba812dc66523133511074 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:29:56 -0600 Subject: [PATCH 043/707] Convert rules debugging _log to logger.LogDebugType --- common/rulesys.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 148f2bfc9..13c9fbf98 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { - _log(RULES__ERROR, "Unable to find category '%s'", catname); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); return(false); } } @@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas switch(type) { case IntRule: m_RuleIntValues [index] = atoi(rule_value); - _log(RULES__CHANGE, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); break; case RealRule: m_RuleRealValues[index] = atof(rule_value); - _log(RULES__CHANGE, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); break; case BoolRule: uint32 val = 0; if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1")) val = 1; m_RuleBoolValues[index] = val; - _log(RULES__CHANGE, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); break; } @@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas } void RuleManager::ResetRules() { - _log(RULES__CHANGE, "Resetting running rules to default values"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); #define RULE_INT(cat, rule, default_value) \ m_RuleIntValues[ Int__##rule ] = default_value; #define RULE_REAL(cat, rule, default_value) \ @@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & return(true); } } - _log(RULES__ERROR, "Unable to find rule '%s'", rule_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); return(false); } @@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) { m_activeRuleset = _FindOrCreateRuleset(db, ruleset); if(m_activeRuleset == -1) { - _log(RULES__ERROR, "Unable to find or create rule set %s", ruleset); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); return; } m_activeName = ruleset; } - _log(RULES__CHANGE, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); } else { - _log(RULES__CHANGE, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } int r; @@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { int rsid = GetRulesetID(db, ruleset); if(rsid < 0) { - _log(RULES__ERROR, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); return(false); } - _log(RULES__CHANGE, "Loading rule set '%s' (%d)", ruleset, rsid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); m_activeRuleset = rsid; m_activeName = ruleset; @@ -288,7 +288,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { for(auto row = results.begin(); row != results.end(); ++row) if(!SetRule(row[0], row[1], nullptr, false)) - _log(RULES__ERROR, "Unable to interpret rule record for %s", row[0]); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); return true; } @@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - _log(RULES__ERROR, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - _log(RULES__ERROR, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } From c288ca5204914042977a9035b019a7136718b7d0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:32:44 -0600 Subject: [PATCH 044/707] Convert 'Guilds' debugging _log to logger.LogDebugType --- common/eqemu_logsys.h | 2 +- common/guild_base.cpp | 130 ++++++++++++++++++++--------------------- world/wguild_mgr.cpp | 28 ++++----- zone/bot.cpp | 2 +- zone/client_packet.cpp | 2 +- zone/command.cpp | 14 ++--- zone/guild_mgr.cpp | 20 +++---- 7 files changed, 100 insertions(+), 98 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 8d577bfc1..e1363c8dc 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -57,7 +57,7 @@ public: WebInterface_Server, AA, Doors, - Guild, + Guilds, Inventory, Netcode, Object, diff --git a/common/guild_base.cpp b/common/guild_base.cpp index e2a411c6c..b8b6206e9 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to load guilds when we have no database object."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); return(false); } @@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - _log(GUILDS__ERROR, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - _log(GUILDS__ERROR, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - _log(GUILDS__ERROR, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - _log(GUILDS__ERROR, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); continue; } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to refresh guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() == 0) { - _log(GUILDS__ERROR, "Unable to find guild %d in the database.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); return false; } @@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - _log(GUILDS__ERROR, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } @@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false; } - _log(GUILDS__DB, "Successfully refreshed guild %d from the database.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); return true; } @@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to store guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - _log(GUILDS__DB, "Requested to store non-existent guild %d", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); return(false); } GuildInfo *info = res->second; @@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - _log(GUILDS__ERROR, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); if (!results.Success()) - _log(GUILDS__ERROR, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; @@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); @@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } safe_delete_array(title_esc); } - _log(GUILDS__DB, "Stored guild %d in the database", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); return true; } uint32 BaseGuildManager::_GetFreeGuildID() { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested find a free guild ID when we have no database object."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -343,12 +343,12 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (results.RowCount() == 0) { - _log(GUILDS__DB, "Located free guild ID %d in the database", index); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); return index; } } - _log(GUILDS__ERROR, "Unable to find a free guild ID when requested."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); return GUILD_NONE; } @@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) { //now store the resulting guild setup into the DB. if(!_StoreGuildDB(new_id)) { - _log(GUILDS__ERROR, "Error storing new guild. It may have been partially created which may need manual removal."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); return(GUILD_NONE); } - _log(GUILDS__DB, "Created guild %d in the database.", new_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); return(new_id); } @@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to delete guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id); QueryWithLogging(query, "deleting guild bank"); - _log(GUILDS__DB, "Deleted guild %d from the database.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); return(true); } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to rename guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); return false; } @@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); safe_delete_array(esc); return false; } safe_delete_array(esc); - _log(GUILDS__DB, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); info->name = name; //update our local record. @@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to set the leader for guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); return false; } @@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(!DBSetGuildRank(leader, GUILD_LEADER)) return false; - _log(GUILDS__DB, "Set guild leader for guild %d to %d in the database", guild_id, leader); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); info->leader_char_id = leader; //update our local record. @@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - _log(GUILDS__ERROR, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; @@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c safe_delete_array(esc); safe_delete_array(esc_set); - _log(GUILDS__DB, "Set MOTD for guild %d in the database", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); info->motd = motd; //update our local record. info->motd_setter = setter; //update our local record. @@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - _log(GUILDS__ERROR, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - _log(GUILDS__DB, "Set URL for guild %d in the database", GuildID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); info->url = URL; //update our local record. @@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - _log(GUILDS__ERROR, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - _log(GUILDS__DB, "Set Channel for guild %d in the database", GuildID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); info->channel = Channel; //update our local record. @@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested to set char to guild %d when we have no database object.", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - _log(GUILDS__ERROR, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - _log(GUILDS__ERROR, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } - _log(GUILDS__DB, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); return true; } @@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__ERROR, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - _log(GUILDS__ERROR, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } - _log(GUILDS__DB, "Set public not for char %d", charid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); return true; } @@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - _log(GUILDS__ERROR, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } @@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - _log(GUILDS__ERROR, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - _log(GUILDS__ERROR, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - _log(GUILDS__DB, "Retreived guild member info for char %s from the database", char_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); return true; @@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { if(m_db == nullptr) { - _log(GUILDS__DB, "Requested char info on %d when we have no database object.", char_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); return false; } @@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - _log(GUILDS__ERROR, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - _log(GUILDS__DB, "Retreived guild member info for char %d", char_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); return true; @@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const { bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const { if(guild_id == GUILD_NONE) { - _log(GUILDS__PERMISSIONS, "Check leader for char %d: not a guild.", char_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - _log(GUILDS__PERMISSIONS, "Check leader for char %d: invalid guild.", char_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); return(false); //invalid guild } - _log(GUILDS__PERMISSIONS, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); return(char_id == res->second->leader_char_id); } @@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { if(status >= 250) { - _log(GUILDS__PERMISSIONS, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); return(true); //250+ as allowed anything } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - _log(GUILDS__PERMISSIONS, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); return(false); //invalid guild } bool granted = (res->second->minstatus <= status); - _log(GUILDS__PERMISSIONS, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied"); return(granted); @@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const { if(rank > GUILD_MAX_RANK) { - _log(GUILDS__PERMISSIONS, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid rank } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - _log(GUILDS__PERMISSIONS, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid guild } bool granted = res->second->ranks[rank].permissions[act]; - _log(GUILDS__PERMISSIONS, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", res->second->name.c_str(), guild_id, res->second->ranks[rank].name.c_str(), rank, GuildActionNames[act], act, @@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - _log(GUILDS__ERROR, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index 0f3e07636..1a148bc08 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -15,6 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ + +#include "../common/eqemu_logsys.h" #include "../common/debug.h" #include "wguild_mgr.h" #include "../common/servertalk.h" @@ -32,7 +34,7 @@ WorldGuildManager guild_mgr; void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - _log(GUILDS__REFRESH, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -45,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, } void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { - _log(GUILDS__REFRESH, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -56,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui } void WorldGuildManager::SendGuildDelete(uint32 guild_id) { - _log(GUILDS__REFRESH, "Broadcasting guild delete for guild %d to world", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -69,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - _log(GUILDS__REFRESH, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!RefreshGuild(s->guild_id)) { - _log(GUILDS__ERROR, "Unable to preform local refresh on guild %d", s->guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); //can we do anything? } @@ -89,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - _log(GUILDS__REFRESH, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); //preform the local update client_list.UpdateClientGuild(s->char_id, s->guild_id); @@ -108,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - _log(GUILDS__REFRESH, "Received and broadcasting guild delete for guild %d", s->guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!LocalDeleteGuild(s->guild_id)) { - _log(GUILDS__ERROR, "Unable to preform local delete on guild %d", s->guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); //can we do anything? } @@ -129,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildMemberUpdate: { if(pack->size != sizeof(ServerGuildMemberUpdate_Struct)) { - _log(GUILDS__ERROR, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); return; } @@ -139,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { } default: - _log(GUILDS__ERROR, "Unknown packet 0x%x received from zone??", pack->opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); break; } } diff --git a/zone/bot.cpp b/zone/bot.cpp index bde330f03..1f0cc6062 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8447,7 +8447,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER); - //_log(GUILDS__REFRESH, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID(); + //logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID(); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index c6f8fce39..83d386b72 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -7196,7 +7196,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID()); - _log(GUILDS__ACTIONS, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) diff --git a/zone/command.cpp b/zone/command.cpp index 0171aaa7c..f79e7e385 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -4602,10 +4602,10 @@ void command_guild(Client *c, const Seperator *sep) } if(guild_id == GUILD_NONE) { - _log(GUILDS__ACTIONS, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid); } else { - _log(GUILDS__ACTIONS, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id); } @@ -4654,7 +4654,7 @@ void command_guild(Client *c, const Seperator *sep) return; } - _log(GUILDS__ACTIONS, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) @@ -4696,7 +4696,7 @@ void command_guild(Client *c, const Seperator *sep) uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader); - _log(GUILDS__ACTIONS, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) @@ -4735,7 +4735,7 @@ void command_guild(Client *c, const Seperator *sep) } } - _log(GUILDS__ACTIONS, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) @@ -4769,7 +4769,7 @@ void command_guild(Client *c, const Seperator *sep) } } - _log(GUILDS__ACTIONS, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) @@ -4820,7 +4820,7 @@ void command_guild(Client *c, const Seperator *sep) } } - _log(GUILDS__ACTIONS, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 50c37aded..4a72a6d9c 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -32,7 +32,7 @@ extern WorldServer worldserver; extern volatile bool ZoneLoaded; void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - _log(GUILDS__REFRESH, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { if(guild_id == 0) { - _log(GUILDS__REFRESH, "Guild lookup for char %d when sending char refresh.", charid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); CharGuildInfo gci; if(!GetCharInfo(charid, gci)) { @@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin } } - _log(GUILDS__REFRESH, "Sending char refresh for %d from guild %d to world", charid, guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID) } void ZoneGuildManager::SendGuildDelete(uint32 guild_id) { - _log(GUILDS__REFRESH, "Sending guild delete for guild %d to world", guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -266,7 +266,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - _log(GUILDS__REFRESH, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //reload all the guild details from the database. RefreshGuild(s->guild_id); @@ -300,7 +300,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - _log(GUILDS__REFRESH, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); Client *c = entity_list.GetClientByCharID(s->char_id); @@ -369,7 +369,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - _log(GUILDS__REFRESH, "Received guild delete from world for guild %d", s->guild_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); //clear all the guild tags. entity_list.RefreshAllGuildInfo(s->guild_id); @@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if (!c || !c->IsInAGuild()) { - _log(GUILDS__ERROR,"Invalid Client or not in guild. ID=%i", FromID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); break; } - _log(GUILDS__IN_PACKETS,"Processing ServerOP_OnlineGuildMembersResponse"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; @@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { VARSTRUCT_DECODE_STRING(Name, Buffer); strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName)); gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer); - _log(GUILDS__OUT_PACKETS,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); c->QueuePacket(outapp); } safe_delete(outapp); From f26f49c2a1322331e60bb60be5ce03babbc41d84 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:37:20 -0600 Subject: [PATCH 045/707] Convert 'QueryServ' debugging _log to logger.LogDebugType --- queryserv/database.cpp | 56 +++++++++++++++++++-------------------- queryserv/lfguild.cpp | 15 ++++++----- queryserv/queryserv.cpp | 14 +++++----- queryserv/worldserver.cpp | 37 ++++++++++++++------------ world/queryserv.cpp | 13 ++++----- 5 files changed, 70 insertions(+), 65 deletions(-) diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 18a852e2b..13206857a 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, safe_delete_array(escapedMessage); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } @@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->char2_money.silver, QS->char2_money.copper, QS->char2_count); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->npc_count); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(members == 0) @@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ lastIndex, QS->Chars[i].char_id); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->char_id, QS->stack_size, QS->char_count, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->char_count, QS->postaction); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->char_money.copper, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { std::string query(queryBuffer); auto results = QueryDatabase(query); if (!results.Success()) { - _log(QUERYSERV__ERROR, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - _log(QUERYSERV__ERROR, "%s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } safe_delete(pack); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index c135d4991..27cf102de 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -2,6 +2,7 @@ #include "lfguild.h" #include "database.h" #include "worldserver.h" +#include "../common/eqemu_logsys.h" #include "../common/string_util.h" #include "../common/packet_dump.h" #include "../common/rulesys.h" @@ -39,7 +40,7 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - _log(QUERYSERV__ERROR, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -241,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(QUERYSERV__ERROR, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -256,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(QUERYSERV__ERROR, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -287,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(QUERYSERV__ERROR, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -304,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(QUERYSERV__ERROR, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -334,7 +335,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(QUERYSERV__ERROR, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } @@ -347,7 +348,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - _log(QUERYSERV__ERROR, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 425ab0f9e..a64ce9be8 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -65,16 +65,16 @@ int main() { */ - _log(QUERYSERV__INIT, "Starting EQEmu QueryServ."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - _log(QUERYSERV__INIT, "Loading server configuration failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - _log(QUERYSERV__INIT, "Connecting to MySQL..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!database.Connect( @@ -89,16 +89,16 @@ int main() { /* Initialize Logging */ if (!load_log_settings(Config->LogSettingsFile.c_str())) - _log(QUERYSERV__INIT, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - _log(QUERYSERV__INIT, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - _log(QUERYSERV__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - _log(QUERYSERV__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index fc87929ca..9a0c2d46d 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -15,23 +15,26 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" -#include -#include -#include -#include -#include -#include -#include -#include "../common/servertalk.h" -#include "worldserver.h" -#include "queryservconfig.h" -#include "database.h" -#include "lfguild.h" -#include "../common/packet_functions.h" + +#include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/md5.h" #include "../common/packet_dump.h" +#include "../common/packet_functions.h" +#include "../common/servertalk.h" + +#include "database.h" +#include "lfguild.h" +#include "queryservconfig.h" +#include "worldserver.h" +#include +#include +#include +#include +#include +#include +#include extern WorldServer worldserver; extern const queryservconfig *Config; @@ -50,7 +53,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - _log(QUERYSERV__INIT, "Connected to World."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -63,7 +66,7 @@ void WorldServer::Process() ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - _log(QUERYSERV__TRACE, "Received Opcode: %4X", pack->opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { case 0: { break; @@ -145,7 +148,7 @@ void WorldServer::Process() break; } default: - _log(QUERYSERV__ERROR, "Received unhandled ServerOP_QueryServGeneric", Type); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); break; } break; diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 3eb664a5e..3a7147f23 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -1,4 +1,5 @@ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "queryserv.h" #include "world_config.h" #include "clientlist.h" @@ -22,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - _log(QUERYSERV__ERROR, "Incoming QueryServ Connection while we were already connected to a QueryServ."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); Stream->Disconnect(); } @@ -56,7 +57,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - _log(QUERYSERV__ERROR, "QueryServ authorization failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -68,7 +69,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - _log(QUERYSERV__ERROR, "QueryServ authorization failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -78,7 +79,7 @@ bool QueryServConnection::Process() } else { - _log(QUERYSERV__ERROR,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -96,7 +97,7 @@ bool QueryServConnection::Process() } case ServerOP_ZAAuth: { - _log(QUERYSERV__ERROR, "Got authentication from QueryServ when they are already authenticated."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); break; } case ServerOP_QueryServGeneric: @@ -113,7 +114,7 @@ bool QueryServConnection::Process() } default: { - _log(QUERYSERV__ERROR, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } From 40d32fc1e5f7c04d4c3e9264370aeb776b54421a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:44:47 -0600 Subject: [PATCH 046/707] Convert 'UCS' debugging _log to logger.LogDebugType --- common/eqemu_logsys.cpp | 1 + common/eqemu_logsys.h | 1 + ucs/chatchannel.cpp | 35 +++++++++-------- ucs/clientlist.cpp | 79 ++++++++++++++++++------------------- ucs/database.cpp | 86 ++++++++++++++++++++--------------------- ucs/ucs.cpp | 22 +++++------ ucs/worldserver.cpp | 9 +++-- world/ucs.cpp | 13 ++++--- 8 files changed, 126 insertions(+), 120 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 73317e525..857d0ed63 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -82,6 +82,7 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Doors", "Guild", "Inventory", + "Launcher", "Netcode", "Object", "Rules", diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index e1363c8dc..ecf3fecf7 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -59,6 +59,7 @@ public: Doors, Guilds, Inventory, + Launcher, Netcode, Object, Rules, diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 56b7eb5b9..3435eeda6 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -17,10 +17,11 @@ */ +#include "../common/eqemu_logsys.h" +#include "../common/string_util.h" #include "chatchannel.h" #include "clientlist.h" #include "database.h" -#include "../common/string_util.h" #include extern Database database; @@ -41,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - _log(UCS__TRACE, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -148,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) { void ChatChannelList::RemoveChannel(ChatChannel *Channel) { - _log(UCS__TRACE, "RemoveChannel(%s)", Channel->GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); LinkedListIterator iterator(ChatChannels); @@ -169,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) { void ChatChannelList::RemoveAllChannels() { - _log(UCS__TRACE, "RemoveAllChannels"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); LinkedListIterator iterator(ChatChannels); @@ -227,7 +228,7 @@ void ChatChannel::AddClient(Client *c) { if(IsClientInChannel(c)) { - _log(UCS__ERROR, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); return; } @@ -236,7 +237,7 @@ void ChatChannel::AddClient(Client *c) { int AccountStatus = c->GetAccountStatus(); - _log(UCS__TRACE, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); LinkedListIterator iterator(ClientsInChannel); @@ -261,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) { if(!c) return false; - _log(UCS__TRACE, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); bool HideMe = c->GetHideMe(); @@ -298,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) { if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0)) return false; - _log(UCS__TRACE, "Starting delete timer for empty password protected channel %s", Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000); } @@ -396,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - _log(UCS__TRACE, "Sending message to %s from %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); ChannelClient->SendChannelMessage(Name, Message, Sender); } @@ -478,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client return nullptr; } - _log(UCS__TRACE, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); ChatChannel *RequiredChannel = FindChannel(NormalisedName); @@ -554,7 +555,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - _log(UCS__TRACE, "Empty temporary password protected channel %s being destroyed.", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); @@ -571,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) { Invitees.push_back(Invitee); - _log(UCS__TRACE, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); } } @@ -586,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) { Invitees.erase(Iterator); - _log(UCS__TRACE, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); return; } @@ -612,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) { Moderators.push_back(Moderator); - _log(UCS__TRACE, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); } } @@ -627,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) { Moderators.erase(Iterator); - _log(UCS__TRACE, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); return; } @@ -653,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) { Voiced.push_back(inVoiced); - _log(UCS__TRACE, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); } } @@ -668,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) { Voiced.erase(Iterator); - _log(UCS__TRACE, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); return; } diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 26c1befa4..48e2b1a94 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -19,6 +19,7 @@ #include "../common/debug.h" #include "../common/string_util.h" +#include "../common/eqemu_logsys.h" #include "clientlist.h" #include "database.h" @@ -235,7 +236,7 @@ std::vector ParseRecipients(std::string RecipientString) { static void ProcessMailTo(Client *c, std::string MailMessage) { - _log(UCS__TRACE, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); std::vector Recipients; @@ -304,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - _log(UCS__ERROR, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -399,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) { static void ProcessCommandBuddy(Client *c, std::string Buddy) { - _log(UCS__TRACE, "Received buddy command with parameters %s", Buddy.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); c->GeneralChannelMessage("Buddy list modified"); uint8 SubAction = 1; @@ -429,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { static void ProcessCommandIgnore(Client *c, std::string Ignoree) { - _log(UCS__TRACE, "Received ignore command with parameters %s", Ignoree.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); c->GeneralChannelMessage("Ignore list modified"); uint8 SubAction = 0; @@ -480,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) { exit(1); if (chatsf->Open()) - _log(UCS__INIT,"Client (UDP) Chat listener started on port %i.", ChatPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); else { - _log(UCS__ERROR,"Failed to start client (UDP) listener (port %-4i)", ChatPort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); exit(1); } @@ -559,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) { if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName()) && (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) { - _log(UCS__CLIENT, "Removing old connection for %s", c->GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); struct in_addr in; in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - _log(UCS__CLIENT, "Client connection from %s:%d closed.", inet_ntoa(in), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -585,7 +586,7 @@ void Clientlist::Process() { in.s_addr = eqs->GetRemoteIP(); - _log(UCS__CLIENT, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); eqs->SetOpcodeManager(&ChatOpMgr); @@ -605,7 +606,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - _log(UCS__CLIENT, "Client connection from %s:%d closed.", inet_ntoa(in), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -645,7 +646,7 @@ void Clientlist::Process() { if(strlen(PacketBuffer) != 9) { - _log(UCS__ERROR, "Mail key is the wrong size. Version of world incompatible with UCS."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -666,11 +667,11 @@ void Clientlist::Process() { else CharacterName = MailBoxString.substr(LastPeriod + 1); - _log(UCS__TRACE, "Received login for user %s with key %s", MailBox, Key); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) { - _log(UCS__ERROR, "Chat Key for %s does not match, closing connection.", MailBox); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; @@ -702,7 +703,7 @@ void Clientlist::Process() { default: { - _log(UCS__ERROR, "Unhandled chat opcode %8X", opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); break; } } @@ -715,7 +716,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - _log(UCS__TRACE, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()), KeyValid, (*Iterator)->GetForceDisconnect()); @@ -859,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) break; case CommandSetMessageStatus: - _log(UCS__TRACE, "Set Message Status, Params: %s", Parameters.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); ProcessSetMessageStatus(Parameters); break; @@ -884,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) default: c->SendHelp(); - _log(UCS__ERROR, "Unhandled OP_Mail command: %s", CommandString.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); } } @@ -895,7 +896,7 @@ void Clientlist::CloseAllConnections() { for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) { - _log(UCS__TRACE, "Removing client %s", (*Iterator)->GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); (*Iterator)->CloseConnection(); } @@ -904,7 +905,7 @@ void Clientlist::CloseAllConnections() { void Client::AddCharacter(int CharID, const char *CharacterName, int Level) { if(!CharacterName) return; - _log(UCS__TRACE, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); CharacterEntry NewCharacter; NewCharacter.CharID = CharID; NewCharacter.Name = CharacterName; @@ -970,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { for(int i = 0; i < MAX_JOINED_CHANNELS; i++) if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; - _log(UCS__TRACE, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; } } @@ -1011,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) { } } - _log(UCS__TRACE, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); int NumberOfChannels = ChannelCount(); @@ -1112,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) { void Client::LeaveChannels(std::string ChannelNameList) { - _log(UCS__TRACE, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); std::string::size_type CurrentPos = 0; @@ -1291,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message) std::string ChannelName = Message.substr(1, MessageStart-1); - _log(UCS__TRACE, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1434,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - _log(UCS__TRACE, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if(RuleB(Chat, EnableAntiSpam)) @@ -1646,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) { else Message = "Password change on channel " + ChannelName; - _log(UCS__TRACE, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1701,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - _log(UCS__TRACE, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1789,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - _log(UCS__TRACE, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Invitee); @@ -1917,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - _log(UCS__TRACE, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Moderator); @@ -1998,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - _log(UCS__TRACE, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Voicee); @@ -2086,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - _log(UCS__TRACE, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Kickee); @@ -2195,32 +2196,32 @@ void Client::SetConnectionType(char c) { case 'S': { TypeOfConnection = ConnectionTypeCombined; - _log(UCS__TRACE, "Connection type is Combined (SoF/SoD)"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); break; } case 'U': { TypeOfConnection = ConnectionTypeCombined; UnderfootOrLater = true; - _log(UCS__TRACE, "Connection type is Combined (Underfoot+)"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); break; } case 'M': { TypeOfConnection = ConnectionTypeMail; - _log(UCS__TRACE, "Connection type is Mail (6.2 or Titanium client)"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); break; } case 'C': { TypeOfConnection = ConnectionTypeChat; - _log(UCS__TRACE, "Connection type is Chat (6.2 or Titanium client)"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); break; } default: { TypeOfConnection = ConnectionTypeUnknown; - _log(UCS__TRACE, "Connection type is unknown."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); } } } @@ -2298,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin void Client::ChangeMailBox(int NewMailBox) { - _log(UCS__TRACE, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); SetMailBox(NewMailBox); - _log(UCS__TRACE, "New mailbox is %s", MailBoxName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); auto outapp = new EQApplicationPacket(OP_MailboxChange, 2); @@ -2376,13 +2377,13 @@ std::string Client::MailBoxName() { if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1))) { - _log(UCS__ERROR, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return ""; } - _log(UCS__TRACE, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index b73a50711..8caa5ef5d 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) { client->GetAccountID()); auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); return; } - _log(UCS__TRACE, "GetAccountStatus Query: %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); if(results.RowCount() != 1) { - _log(UCS__ERROR, "Error in GetAccountStatus"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); return; } @@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) { client->SetKarma(atoi(row[2])); client->SetRevoked((atoi(row[3])==1?true:false)); - _log(UCS__TRACE, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); } int Database::FindAccount(const char *characterName, Client *client) { - _log(UCS__TRACE, "FindAccount for character %s", characterName); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); client->ClearCharacters(); @@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) { characterName); auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "FindAccount query failed: %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); return -1; } if (results.RowCount() != 1) { - _log(UCS__ERROR, "Bad result from query"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); return -1; } @@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) { int accountID = atoi(row[1]); - _log(UCS__TRACE, "Account ID for %s is %i", characterName, accountID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` " "WHERE `account_id` = %i AND `name` != '%s'", @@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri characterName.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); return false; } @@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri else sprintf(combinedKey, "%s", MailKey.c_str()); - _log(UCS__TRACE, "DB key is [%s], Client key is [%s]", row[0], combinedKey); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); return !strcmp(row[0], combinedKey); } @@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } safe_delete(safeCharName); if (results.RowCount() != 1) { - _log(UCS__ERROR, "Bad result from FindCharacter query for character %s", characterName); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); return -1; } @@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ bool Database::LoadChatChannels() { - _log(UCS__INIT, "Loading chat channels from the database."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -267,25 +267,25 @@ bool Database::LoadChatChannels() { void Database::SetChannelPassword(std::string channelName, std::string password) { - _log(UCS__TRACE, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - _log(UCS__ERROR, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::SetChannelOwner(std::string channelName, std::string owner) { - _log(UCS__TRACE, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - _log(UCS__ERROR, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) { int unknownField3 = 1; int characterID = FindCharacter(client->MailBoxName().c_str()); - _log(UCS__TRACE, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) { int characterID = FindCharacter(client->MailBoxName().c_str()); - _log(UCS__TRACE, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) { auto row = results.begin(); - _log(UCS__TRACE, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]); @@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub characterID = FindCharacter(characterName.c_str()); - _log(UCS__TRACE, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); if(characterID <= 0) return false; @@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - _log(UCS__ERROR, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } - _log(UCS__TRACE, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); Client *client = CL->IsCharacterOnline(characterName); @@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub void Database::SetMessageStatus(int messageNumber, int status) { - _log(UCS__TRACE, "SetMessageStatus %i %i", messageNumber, status); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); if(status == 0) { std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber); @@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - _log(UCS__ERROR, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::ExpireMail() { - _log(UCS__INIT, "Expiring mail..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } auto row = results.begin(); - _log(UCS__INIT, "There are %s messages in the database.", row[0]); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { @@ -524,9 +524,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); if(results.Success()) - _log(UCS__INIT, "Expired %i trash messages.", results.RowsAffected()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - _log(UCS__ERROR, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -536,9 +536,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); if(results.Success()) - _log(UCS__INIT, "Expired %i read messages.", results.RowsAffected()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - _log(UCS__ERROR, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread @@ -547,9 +547,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); if(results.Success()) - _log(UCS__INIT, "Expired %i unread messages.", results.RowsAffected()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - _log(UCS__ERROR, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - _log(UCS__ERROR, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else - _log(UCS__TRACE, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } @@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - _log(UCS__ERROR, "Error removing friend/ignore, query was %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); else - _log(UCS__TRACE, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); } @@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - _log(UCS__ERROR, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends if(atoi(row[0]) == 0) { ignorees.push_back(name); - _log(UCS__TRACE, "Added Ignoree from DB %s", name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); continue; } friends.push_back(name); - _log(UCS__TRACE, "Added Friend from DB %s", name.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); } } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 6d3d8975e..2af41f71d 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -78,11 +78,11 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - _log(UCS__INIT, "Starting EQEmu Universal Chat Server."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - _log(UCS__INIT, "Loading server configuration failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); return 1; } @@ -90,13 +90,13 @@ int main() { Config = ucsconfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - _log(UCS__INIT, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - _log(UCS__INIT, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); WorldShortName = Config->ShortName; - _log(UCS__INIT, "Connecting to MySQL..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -113,13 +113,13 @@ int main() { if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - _log(UCS__ERROR, "Failed to load ruleset '%s', falling back to defaults.", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - _log(UCS__INIT, "No rule set configured, using default rules"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); } else { - _log(UCS__INIT, "Loaded default rule set 'default'", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -127,7 +127,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - _log(UCS__ERROR, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -138,11 +138,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - _log(UCS__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - _log(UCS__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index 83e1764a1..105dc3d4a 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -16,6 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include #include @@ -51,7 +52,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - _log(UCS__INIT, "Connected to World."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -66,7 +67,7 @@ void WorldServer::Process() while((pack = tcpc.PopPacket())) { - _log(UCS__TRACE, "Received Opcode: %4X", pack->opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { @@ -87,7 +88,7 @@ void WorldServer::Process() std::string Message = Buffer; - _log(UCS__TRACE, "Player: %s, Sent Message: %s", From, Message.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); Client *c = CL->FindCharacter(From); @@ -98,7 +99,7 @@ void WorldServer::Process() if(!c) { - _log(UCS__TRACE, "Client not found."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); break; } diff --git a/world/ucs.cpp b/world/ucs.cpp index 875d2be23..d2e361964 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -1,4 +1,5 @@ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "ucs.h" #include "world_config.h" #include "../common/logsys.h" @@ -17,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - _log(UCS__ERROR, "Incoming UCS Connection while we were already connected to a UCS."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); Stream->Disconnect(); } @@ -51,7 +52,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - _log(UCS__ERROR, "UCS authorization failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -63,7 +64,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - _log(UCS__ERROR, "UCS authorization failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -73,7 +74,7 @@ bool UCSConnection::Process() } else { - _log(UCS__ERROR,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -91,12 +92,12 @@ bool UCSConnection::Process() } case ServerOP_ZAAuth: { - _log(UCS__ERROR, "Got authentication from UCS when they are already authenticated."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); break; } default: { - _log(UCS__ERROR, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } From 4c50025f1371c78703cd2d4c8641d46f0e12db1f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:47:37 -0600 Subject: [PATCH 047/707] Convert 'ZoneServer' debugging _log to logger.LogDebugType --- zone/net.cpp | 66 ++++++++++++++++++++++---------------------- zone/worldserver.cpp | 4 +-- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index 31648b9f9..7ca406a96 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -151,7 +151,7 @@ int main(int argc, char** argv) { - _log(ZONE__INIT, "Loading server configuration.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { logger.Log(EQEmuLogSys::Error, "Loading server configuration failed."); return 1; @@ -159,13 +159,13 @@ int main(int argc, char** argv) { const ZoneConfig *Config=ZoneConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - _log(ZONE__INIT, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - _log(ZONE__INIT, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); worldserver.SetPassword(Config->SharedKey.c_str()); - _log(ZONE__INIT, "Connecting to MySQL..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), @@ -189,7 +189,7 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - _log(ZONE__INIT, "CURRENT_VERSION: %s", CURRENT_VERSION); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers @@ -211,84 +211,84 @@ int main(int argc, char** argv) { const char *log_ini_file = "./log.ini"; if(!load_log_settings(log_ini_file)) - _log(ZONE__INIT, "Warning: Unable to read %s", log_ini_file); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); else - _log(ZONE__INIT, "Log settings loaded from %s", log_ini_file); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); - _log(ZONE__INIT, "Mapping Incoming Opcodes"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - _log(ZONE__INIT, "Loading Variables"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); database.LoadVariables(); - _log(ZONE__INIT, "Loading zone names"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - _log(ZONE__INIT, "Loading items"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { logger.Log(EQEmuLogSys::Error, "Loading items FAILED!"); logger.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } - _log(ZONE__INIT, "Loading npc faction lists"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { logger.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - _log(ZONE__INIT, "Loading loot tables"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { logger.Log(EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - _log(ZONE__INIT, "Loading skill caps"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { logger.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - _log(ZONE__INIT, "Loading spells"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - _log(ZONE__INIT, "Loading base data"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { logger.Log(EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - _log(ZONE__INIT, "Loading guilds"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - _log(ZONE__INIT, "Loading factions"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); database.LoadFactionData(); - _log(ZONE__INIT, "Loading titles"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - _log(ZONE__INIT, "Loading AA effects"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - _log(ZONE__INIT, "Loading tributes"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); database.LoadTributes(); - _log(ZONE__INIT, "Loading corpse timers"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - _log(ZONE__INIT, "Loading commands"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) logger.Log(EQEmuLogSys::Error, "Command loading FAILED"); else - _log(ZONE__INIT, "%d commands loaded", retval); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - _log(ZONE__INIT, "Loading rule set '%s'", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { logger.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - _log(ZONE__INIT, "No rule set configured, using default rules"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); } else { - _log(ZONE__INIT, "Loaded default rule set 'default'", tmp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); } } } @@ -311,7 +311,7 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - _log(ZONE__INIT, "Loading quests"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); parse->ReloadQuests(); @@ -332,7 +332,7 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - _log(ZONE__INIT, "Entering sleep mode"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance logger.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; @@ -365,7 +365,7 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - _log(ZONE__INIT, "Starting EQ Network server on port %d",Config->ZonePort); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); // log_sys.CloseZoneLogs(); // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); @@ -522,13 +522,13 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); CheckEQEMuErrorAndPause(); - _log(ZONE__INIT, "Proper zone shutdown complete."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - _log(ZONE__INIT, "Recieved signal: %i", sig_num); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -539,7 +539,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); // safe_delete(worldserver); - _log(ZONE__INIT, "Shutting down..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); } uint32 NetConnection::GetIP() diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 68ebb51fc..2b9a47ecf 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - _log(ZONE__WORLD_TRACE,"Got 0x%04x from world:",pack->opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server,"Got 0x%04x from world:",pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,7 +155,7 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - _log(ZONE__WORLD,"World indicated port %d for this zone.",sci->port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server,"World indicated port %d for this zone.",sci->port); ZoneConfig::SetZonePort(sci->port); break; } From 49ecd69b34286c6251a8213437e8e00955776e9d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:50:09 -0600 Subject: [PATCH 048/707] Convert 'LAUNCHER' debugging _log to logger.LogDebugType --- eqlaunch/eqlaunch.cpp | 18 +++++++-------- eqlaunch/worldserver.cpp | 19 ++++++++-------- eqlaunch/zone_launch.cpp | 47 ++++++++++++++++++++-------------------- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 89e2b0670..11ad0686f 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -47,13 +47,13 @@ int main(int argc, char *argv[]) { launcher_name = argv[1]; } if(launcher_name.length() < 1) { - _log(LAUNCHER__ERROR, "You must specfify a launcher name as the first argument to this program."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); return 1; } - _log(LAUNCHER__INIT, "Loading server configuration.."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); if (!EQEmuConfig::LoadConfig()) { - _log(LAUNCHER__ERROR, "Loading server configuration failed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); return 1; } const EQEmuConfig *Config = EQEmuConfig::get(); @@ -62,16 +62,16 @@ int main(int argc, char *argv[]) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - _log(LAUNCHER__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - _log(LAUNCHER__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - _log(LAUNCHER__ERROR, "Could not set signal handler"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::map zones; WorldServer world(zones, launcher_name.c_str(), Config); if (!world.Connect()) { - _log(LAUNCHER__ERROR, "worldserver.Connect() FAILED! Will retry."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); } std::map::iterator zone, zend; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - _log(LAUNCHER__INIT, "Starting main loop..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); // zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1"); @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { void CatchSignal(int sig_num) { - _log(LAUNCHER__STATUS, "Caught signal %d", sig_num); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); RunLoops = false; } diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index 920bf982e..9346879bc 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/servertalk.h" #include "../common/eqemu_config.h" #include "../common/string_util.h" @@ -73,14 +74,14 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - _log(LAUNCHER__ERROR, "World server responded 'Not Authorized', disabling reconnect"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; } case ServerOP_LauncherZoneRequest: { if(pack->size != sizeof(LauncherZoneRequest)) { - _log(LAUNCHER__NET, "Invalid size of LauncherZoneRequest: %d", pack->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); break; } const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer; @@ -89,9 +90,9 @@ void WorldServer::Process() { switch(ZoneRequestCommands(lzr->command)) { case ZR_Start: { if(m_zones.find(lzr->short_name) != m_zones.end()) { - _log(LAUNCHER__ERROR, "World told us to start zone %s, but it is already running.", lzr->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); } else { - _log(LAUNCHER__WORLD, "World told us to start zone %s.", lzr->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config); m_zones[lzr->short_name] = l; } @@ -100,9 +101,9 @@ void WorldServer::Process() { case ZR_Restart: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - _log(LAUNCHER__ERROR, "World told us to restart zone %s, but it is not running.", lzr->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); } else { - _log(LAUNCHER__WORLD, "World told us to restart zone %s.", lzr->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); res->second->Restart(); } break; @@ -110,9 +111,9 @@ void WorldServer::Process() { case ZR_Stop: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - _log(LAUNCHER__ERROR, "World told us to stop zone %s, but it is not running.", lzr->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); } else { - _log(LAUNCHER__WORLD, "World told us to stop zone %s.", lzr->short_name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); res->second->Stop(); } break; @@ -126,7 +127,7 @@ void WorldServer::Process() { } default: { - _log(LAUNCHER__NET, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); break; } } diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index fee133da7..2da3a6554 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include "../common/eqemu_config.h" #include "zone_launch.h" #include "worldserver.h" @@ -71,7 +72,7 @@ void ZoneLaunch::Start() { //spec is consumed, even on failure m_ref = ProcLauncher::get()->Launch(spec); if(m_ref == ProcLauncher::ProcError) { - _log(LAUNCHER__ERROR, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); m_timer.Start(m_config->RestartWait); return; } @@ -83,17 +84,17 @@ void ZoneLaunch::Start() { SendStatus(); - _log(LAUNCHER__STATUS, "Zone %s has been started.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); } void ZoneLaunch::Restart() { switch(m_state) { case StateRestartPending: - _log(LAUNCHER__STATUS, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); break; case StateStartPending: //we havent started yet, do nothing - _log(LAUNCHER__STATUS, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); break; case StateStarted: //process is running along, kill it off.. @@ -101,20 +102,20 @@ void ZoneLaunch::Restart() { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, true)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - _log(LAUNCHER__ERROR, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - _log(LAUNCHER__STATUS, "Termination signal sent to zone %s.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateRestartPending; break; case StateStopPending: - _log(LAUNCHER__STATUS, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); break; case StateStopped: //process is already stopped... nothing to do.. - _log(LAUNCHER__STATUS, "Restart requested when zone %s is already stopped.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -123,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) { switch(m_state) { case StateStartPending: //we havent started yet, transition directly to stopped. - _log(LAUNCHER__STATUS, "Stopping zone %s before it has started.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); m_state = StateStopped; break; case StateStarted: @@ -133,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, graceful)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - _log(LAUNCHER__ERROR, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - _log(LAUNCHER__STATUS, "Termination signal sent to zone %s.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateStopPending; break; case StateStopped: //process is already stopped... nothing to do.. - _log(LAUNCHER__STATUS, "Stop requested when zone %s is already stopped.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -163,17 +164,17 @@ bool ZoneLaunch::Process() { m_timer.Disable(); //actually start up the program - _log(LAUNCHER__STATUS, "Starting zone %s", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); Start(); //now update the shared timer to reflect the proper start interval. if(s_running == 1) { //we are the first zone started. wait that interval. - _log(LAUNCHER__STATUS, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); s_startTimer.Start(m_config->InitialBootWait); } else { //just some follow on zone, use that interval. - _log(LAUNCHER__STATUS, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); s_startTimer.Start(m_config->ZoneBootInterval); } @@ -186,7 +187,7 @@ bool ZoneLaunch::Process() { //waiting for notification that our child has died.. if(m_timer.Check()) { //we have timed out, try to kill the child again - _log(LAUNCHER__STATUS, "Zone %s refused to die, killing again.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Restart(); } break; @@ -196,12 +197,12 @@ bool ZoneLaunch::Process() { //we have timed out, try to kill the child again m_killFails++; if(m_killFails > 5) { //should get this number from somewhere.. - _log(LAUNCHER__STATUS, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); m_state = StateStopped; s_running--; SendStatus(); } else { - _log(LAUNCHER__STATUS, "Zone %s refused to die, killing again.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Stop(false); } } @@ -220,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche switch(m_state) { case StateStartPending: - _log(LAUNCHER__STATUS, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateStarted: //something happened to our happy process... - _log(LAUNCHER__STATUS, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateRestartPending: //it finally died, start it on up again - _log(LAUNCHER__STATUS, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); m_state = StateStartPending; break; case StateStopPending: //it finally died, transition to close. - _log(LAUNCHER__STATUS, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); m_state = StateStopped; break; case StateStopped: //we already thought it was stopped... dont care... - _log(LAUNCHER__STATUS, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); break; } From 3390164aea84a879316d9d0655391200b1b5ef82 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:51:35 -0600 Subject: [PATCH 049/707] Convert 'TRADING' debugging _log to logger.LogDebugType --- zone/client_packet.cpp | 20 +++++++-------- zone/client_process.cpp | 2 +- zone/trading.cpp | 56 ++++++++++++++++++++--------------------- zone/zonedb.cpp | 20 +++++++-------- 4 files changed, 49 insertions(+), 49 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 83d386b72..07c7de75b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3573,7 +3573,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) default: Message(13, "Unrecognised Barter action."); - _log(TRADING__BARTER, "Unrecognised Barter Action %i", Action); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); } } @@ -3636,7 +3636,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - _log(TRADING__CLIENT, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); logger.Log(EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } @@ -13435,7 +13435,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (c) c->WithCustomer(0); else - _log(TRADING__CLIENT, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); break; } @@ -13444,7 +13444,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) break; } default: { - _log(TRADING__CLIENT, "Unhandled action code in OP_Trader ShowItems_Struct"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); break; } } @@ -13530,7 +13530,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } } else { - _log(TRADING__CLIENT, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); logger.Log(EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); @@ -13542,7 +13542,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) HandleTraderPriceUpdate(app); } else { - _log(TRADING__CLIENT, "Unknown size for OP_Trader: %i\n", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); logger.Log(EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; @@ -13568,11 +13568,11 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) BuyTraderItem(tbs, Trader, app); } else { - _log(TRADING__CLIENT, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); } } else { - _log(TRADING__CLIENT, "Client::Handle_OP_TraderBuy: Struct size mismatch"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); } return; @@ -13646,7 +13646,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (app->size != sizeof(TraderClick_Struct)) { - _log(TRADING__CLIENT, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); return; } @@ -13660,7 +13660,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (Customer) outtcs->Approval = Customer->WithCustomer(GetID()); else { - _log(TRADING__CLIENT, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" " returned a nullptr pointer"); return; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 2b41d8bd2..397c71ac3 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ Client* c = entity_list.GetClientByID(CustomerID); if(!c) { - _log(TRADING__CLIENT, "Previous customer has gone away."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); CustomerID = NewCustomer; return 1; } diff --git a/zone/trading.cpp b/zone/trading.cpp index 41f9047e2..6fc82fd25 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -126,7 +126,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { inst2->SetCharges(stack_size + inst2->GetCharges()); } - _log(TRADING__HOLDER, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); if (_stack_size > 0) inst->SetCharges(_stack_size); @@ -143,7 +143,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { SendItemData(inst, trade_slot_id); - _log(TRADING__HOLDER, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); client->DeleteItemInInventory(MainCursor); @@ -1160,7 +1160,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) { const Item_Struct* item = database.GetItem(ItemID); if(!item){ - _log(TRADING__CLIENT, "Bogus item deleted in Client::SendTraderItem!\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); return; } @@ -1219,10 +1219,10 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - _log(TRADING__CLIENT, "Client::BulkSendTraderInventory nullptr inst pointer"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - _log(TRADING__CLIENT, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } @@ -1245,7 +1245,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } } } - _log(TRADING__CLIENT, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); return nullptr; } @@ -1302,7 +1302,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ } } } - _log(TRADING__CLIENT, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", SerialNumber , Quantity, this->GetName()); return 0; @@ -1311,7 +1311,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Customer,uint16 TraderSlot, int SerialNumber) { if(!Customer) return; - _log(TRADING__CLIENT, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); if(Quantity < Charges) { Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber); m_inv.DeleteItem(Slot, Quantity); @@ -1395,7 +1395,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* if(!Stackable) Quantity = (Charges > 0) ? Charges : 1; - _log(TRADING__CLIENT, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); } if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){ this->DeleteItemInInventory(SlotID, Quantity); @@ -1431,7 +1431,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* } } - _log(TRADING__CLIENT, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, Quantity,this->GetName()); } @@ -1510,13 +1510,13 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat const ItemInst* BuyItem = Trader->FindTraderItemBySerialNumber(tbs->ItemID); if(!BuyItem) { - _log(TRADING__CLIENT, "Unable to find item on trader."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); TradeRequestFailed(app); safe_delete(outapp); return; } - _log(TRADING__CLIENT, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", BuyItem->GetItem()->Name, BuyItem->IsStackable(), tbs->Quantity, BuyItem->GetCharges()); // If the item is not stackable, then we can only be buying one of them. if(!BuyItem->IsStackable()) @@ -1534,7 +1534,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat outtbs->Quantity = tbs->Quantity; } - _log(TRADING__CLIENT, "Actual quantity that will be traded is %i", outtbs->Quantity); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); @@ -1840,7 +1840,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint return; } - _log(TRADING__CLIENT, "SRCH: %s", query.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); int Size = 0; uint32 ID = 0; @@ -1887,7 +1887,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint VARSTRUCT_ENCODE_TYPE(uint32, bufptr, ID); } else{ - _log(TRADING__CLIENT, "Unable to find trader: %i\n",atoi(row[1])); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0); } Cost = atoi(row[5]); @@ -1981,7 +1981,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(inst->IsStackable()) inst->SetMerchantCount(gis->Charges[i]); - _log(TRADING__CLIENT, "Sending price update for %s, Serial No. %i with %i charges", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor? @@ -2018,7 +2018,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St if(gis->ItemID[i] == ItemID) { tdis->ItemID = gis->SerialNumber[i]; - _log(TRADING__CLIENT, "Telling customer to remove item %i with %i charges and S/N %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); _pkt(TRADING__PACKETS, outapp); @@ -2031,7 +2031,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St return; } - _log(TRADING__CLIENT, "Sending price updates to customer %s", Customer->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); ItemInst* inst = database.CreateItem(item); @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantSlot(gis->SerialNumber[i]); - _log(TRADING__CLIENT, "Sending price update for %s, Serial No. %i with %i charges", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor?? @@ -2073,7 +2073,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { // TraderPriceUpdate_Struct* tpus = (TraderPriceUpdate_Struct*)app->pBuffer; - _log(TRADING__CLIENT, "Received Price Update for %s, Item Serial No. %i, New Price %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", GetName(), tpus->SerialNumber, tpus->NewPrice); // Pull the items this Trader currently has for sale from the trader table. @@ -2101,7 +2101,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((gis->ItemID[i] > 0) && (gis->SerialNumber[i] == tpus->SerialNumber)) { // We found the item that the Trader wants to change the price of (or add back up for sale). // - _log(TRADING__CLIENT, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); IDOfItemToUpdate = gis->ItemID[i]; @@ -2127,7 +2127,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { return ; } - _log(TRADING__CLIENT, "Unable to find item to update price for. Rechecking trader satchels"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); // Find what is in their Trader Satchels GetItems_Struct* newgis=GetTraderItems(); @@ -2140,7 +2140,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((newgis->Items[i] > 0) && (newgis->SerialNumber[i] == tpus->SerialNumber)) { - _log(TRADING__CLIENT, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], newgis->Charges[i]); IDOfItemToAdd = newgis->Items[i]; @@ -2158,7 +2158,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if(!IDOfItemToAdd || !item) { - _log(TRADING__CLIENT, "Item not found in Trader Satchels either."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); @@ -2203,7 +2203,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { gis->SerialNumber[i] = newgis->SerialNumber[i]; gis->ItemCost[i] = tpus->NewPrice; - _log(TRADING__CLIENT, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", GetName(), newgis->Items[i], newgis->SerialNumber[i], newgis->Charges[i], tpus->NewPrice, i); } @@ -2249,7 +2249,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { QueuePacket(app); if(OldPrice == tpus->NewPrice) { - _log(TRADING__CLIENT, "The new price is the same as the old one."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); safe_delete(gis); return; } @@ -2855,11 +2855,11 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { bool LoreConflict = CheckLoreConflict(item); - _log(TRADING__BARTER, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", GetName(), BuySlot, ItemID, item->Name, Quantity, ToggleOnOff, Price, ItemCount, LoreConflict); if((item->NoDrop != 0) && !LoreConflict && (Quantity > 0) && HasMoney(Quantity * Price) && ToggleOnOff && (ItemCount == 0)) { - _log(TRADING__BARTER, "Adding to database"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); database.AddBuyLine(CharacterID(), BuySlot, ItemID, ItemName, Quantity, Price); QueuePacket(app); } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index c16739e16..da24a3665 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -523,14 +523,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - _log(TRADING__CLIENT, "Failed to load trader information!\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } loadti->Code = BazaarTrader_ShowItems; for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) { - _log(TRADING__CLIENT, "Bad Slot number when trying to load trader information!\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -548,13 +548,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - _log(TRADING__CLIENT, "Failed to load trader information!\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) { - _log(TRADING__CLIENT, "Bad Slot number when trying to load trader information!\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -574,7 +574,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { return nullptr; if (results.RowCount() == 0) { - _log(TRADING__CLIENT, "Bad result from query\n"); fflush(stdout); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); return nullptr; } @@ -587,7 +587,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { const Item_Struct *item = database.GetItem(ItemID); if(!item) { - _log(TRADING__CLIENT, "Unable to create item\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); fflush(stdout); return nullptr; } @@ -597,7 +597,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { ItemInst* inst = database.CreateItem(item); if(!inst) { - _log(TRADING__CLIENT, "Unable to create item instance\n"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); fflush(stdout); return nullptr; } @@ -624,7 +624,7 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum } void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) { - _log(TRADING__CLIENT, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i", Charges, CharID, SerialNumber); @@ -637,7 +637,7 @@ void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int3 void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) { - _log(TRADING__CLIENT, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); const Item_Struct *item = database.GetItem(ItemID); @@ -645,7 +645,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg return; if(NewPrice == 0) { - _log(TRADING__CLIENT, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); From 683ff1ea6008e4b5f19ec5dab3afc304825f9aea Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:52:11 -0600 Subject: [PATCH 050/707] Convert 'SPELLS' debugging _log to logger.LogDebugType --- common/shareddb.cpp | 8 ++++---- common/spdat.cpp | 2 +- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 2 +- zone/client_process.cpp | 10 +++++----- zone/groups.cpp | 4 ++-- zone/raids.cpp | 4 ++-- zone/spells.cpp | 2 +- zone/worldserver.cpp | 12 ++++++------ 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 0a8148c8d..c9894abc0 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - _log(SPELLS__LOAD_ERR, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - _log(SPELLS__LOAD_ERR, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - _log(SPELLS__LOAD_ERR, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - _log(SPELLS__LOAD_ERR, "Non fatal error: spell.id >= max_spells, ignoring."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } diff --git a/common/spdat.cpp b/common/spdat.cpp index 8bceec249..22861e53e 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -838,7 +838,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - _log(SPELLS__EFFECT_VALUES, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index f7a73c4cf..0f6df5965 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - _log(SPELLS__BARDS, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 07c7de75b..08f52a4bb 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -11714,7 +11714,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - _log(SPELLS__REZ, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 397c71ac3..01c59236e 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - _log(SPELLS__REZ, "Unexpected OP_RezzAnswer. Ignoring it."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - _log(SPELLS__REZ, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - _log(SPELLS__REZ, "Unexpected Rezz from hover request."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - _log(SPELLS__REZ, "Hover Rez in zone %s for corpse %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - _log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/groups.cpp b/zone/groups.cpp index eca2884e5..ab90cddec 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - _log(SPELLS__CASTING, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - _log(SPELLS__BARDS, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 3f68f2270..7a35d91ac 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - _log(SPELLS__CASTING, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - _log(SPELLS__BARDS, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } diff --git a/zone/spells.cpp b/zone/spells.cpp index ff456fcbc..ba8431814 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3832,7 +3832,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - _log(SPELLS__REZ, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 2b9a47ecf..2166aba56 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - _log(SPELLS__REZ, "OP_RezzRequest in zone %s for %s, spellid:%i", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - _log(SPELLS__REZ, "OP_RezzComplete received in zone %s for corpse %s", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - _log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - _log(SPELLS__REZ, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - _log(SPELLS__REZ, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - _log(SPELLS__REZ, "NOT Sending player rezz packet to world"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret; From 3693868acf0cfd9577ee69825667c501af7ae9df Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:52:46 -0600 Subject: [PATCH 051/707] Convert 'SPAWNS' debugging _log to logger.LogDebugType --- zone/spawn2.cpp | 130 ++++++++++++++++++++++++------------------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 5a4f9b998..367427527 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -153,13 +153,13 @@ bool Spawn2::Process() { if (timer.Check()) { timer.Disable(); - _log(SPAWNS__MAIN, "Spawn2 %d: Timer has triggered", spawn2_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); //first check our spawn condition, if this isnt active //then we reset the timer and try again next time. if(condition_id != SC_AlwaysEnabled && !zone->spawn_conditions.Check(condition_id, condition_min_value)) { - _log(SPAWNS__CONDITIONS, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); Reset(); return(true); } @@ -170,14 +170,14 @@ bool Spawn2::Process() { } if (sg == nullptr) { - _log(SPAWNS__MAIN, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } //have the spawn group pick an NPC for us uint32 npcid = sg->GetNPCType(); if (npcid == 0) { - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); Reset(); //try again later (why?) return(true); } @@ -185,7 +185,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); if (tmp == nullptr) { - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); } @@ -194,7 +194,7 @@ bool Spawn2::Process() { { if(!entity_list.LimitCheckName(tmp->name)) { - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); timer.Start(5000); //try again in five seconds. return(true); } @@ -202,7 +202,7 @@ bool Spawn2::Process() { if(tmp->spawn_limit > 0) { if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) { - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); timer.Start(5000); //try again in five seconds. return(true); } @@ -233,10 +233,10 @@ bool Spawn2::Process() { if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && sg->min_delay) npc->AI_SetRoambox(sg->roamdist,sg->roambox[0],sg->roambox[1],sg->roambox[2],sg->roambox[3],sg->delay,sg->min_delay); if(zone->InstantGrids()) { - _log(SPAWNS__MAIN, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); LoadGrid(); } else { - _log(SPAWNS__MAIN, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); } } return true; @@ -261,7 +261,7 @@ void Spawn2::LoadGrid() { //dont set an NPC's grid until its loaded for them. npcthis->SetGrid(grid_); npcthis->AssignWaypoints(grid_); - _log(SPAWNS__MAIN, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); } @@ -272,21 +272,21 @@ void Spawn2::LoadGrid() { void Spawn2::Reset() { timer.Start(resetTimer()); npcthis = nullptr; - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { if (delay == 0) { timer.Trigger(); - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); } else { - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } npcthis = nullptr; @@ -328,7 +328,7 @@ void Spawn2::ForceDespawn() cur = despawnTimer(dtimer); } - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); timer.Start(cur); } @@ -349,7 +349,7 @@ void Spawn2::DeathReset(bool realdeath) if(spawn2_id) { database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), (cur/1000)); - _log(SPAWNS__MAIN, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); //store it to database too } } @@ -466,12 +466,12 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { if(GetSpawnCondition() != c.condition_id) return; - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); bool old_state = (old_value >= condition_min_value); bool new_state = (c.value >= condition_min_value); if(old_state == new_state) { - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); return; //no change } @@ -479,50 +479,50 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { switch(c.on_change) { case SpawnCondition::DoNothing: //that was easy. - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); break; case SpawnCondition::DoDepop: - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; case SpawnCondition::DoRepopIfReady: - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) { - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); npcthis->Depop(false); //remove the current mob npcthis = nullptr; } if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled. timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID()); - _log(SPAWNS__CONDITIONS,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); if(timer_remaining <= 0) Repop(); } else { - _log(SPAWNS__CONDITIONS,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); } break; default: if(c.on_change < SpawnCondition::DoSignalMin) { - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); return; //unknown onchange action } int signal_id = c.on_change - SpawnCondition::DoSignalMin; - _log(SPAWNS__CONDITIONS, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } void Zone::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { - _log(SPAWNS__CONDITIONS, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); LinkedListIterator iterator(spawn2_list); @@ -592,7 +592,7 @@ void SpawnConditionManager::Process() { EQTime::AddMinutes(cevent.period, &cevent.next); std::string t; EQTime::ToString(&cevent.next, t); - _log(SPAWNS__CONDITIONS, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); //save the next event time in the DB UpdateDBEvent(cevent); //find the next closest event timer. @@ -611,7 +611,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { - _log(SPAWNS__CONDITIONS, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); return; //unable to find the spawn condition to operate on } @@ -619,7 +619,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { zone->zone_time.getEQTimeOfDay(&tod); if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year)) { - _log(SPAWNS__CONDITIONS, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); return; } @@ -631,26 +631,26 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { switch(event.action) { case SpawnEvent::ActionSet: new_value = event.argument; - _log(SPAWNS__CONDITIONS, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); break; case SpawnEvent::ActionAdd: new_value += event.argument; - _log(SPAWNS__CONDITIONS, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionSubtract: new_value -= event.argument; - _log(SPAWNS__CONDITIONS, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionMultiply: new_value *= event.argument; - _log(SPAWNS__CONDITIONS, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; case SpawnEvent::ActionDivide: new_value /= event.argument; - _log(SPAWNS__CONDITIONS, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; default: - _log(SPAWNS__CONDITIONS, "Event %d: Invalid event action type %d", event.id, event.action); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); return; } @@ -727,7 +727,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: std::string timeAsString; EQTime::ToString(&event.next, timeAsString); - _log(SPAWNS__CONDITIONS, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); return true; } @@ -755,7 +755,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in cond.on_change = (SpawnCondition::OnChange) atoi(row[1]); spawn_conditions[cond.condition_id] = cond; - _log(SPAWNS__CONDITIONS, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); } //load values @@ -811,7 +811,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in spawn_events.push_back(event); - _log(SPAWNS__CONDITIONS, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); } //now we need to catch up on events that happened while we were away @@ -846,7 +846,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in //watch for special case of all 0s, which means to reset next to now if(cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 && cevent.next.minute == 0) { - _log(SPAWNS__CONDITIONS, "Initial next trigger time set for spawn event %d", cevent.id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); memcpy(&cevent.next, &tod, sizeof(cevent.next)); //add one period EQTime::AddMinutes(cevent.period, &cevent.next); @@ -857,7 +857,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in bool ran = false; while(EQTime::IsTimeBefore(&tod, &cevent.next)) { - _log(SPAWNS__CONDITIONS, "Catch up triggering on event %d", cevent.id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); //this event has been triggered. //execute the event if(!cevent.strict || StrictCheck) @@ -900,9 +900,9 @@ void SpawnConditionManager::FindNearestEvent() { } } if(next_id == -1) - _log(SPAWNS__CONDITIONS, "No spawn events enabled. Disabling next event."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); else - _log(SPAWNS__CONDITIONS, "Next event determined to be event %d", next_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); } void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update) @@ -914,14 +914,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - _log(SPAWNS__CONDITIONS, "Condition update received from world for %d, but we do not have that conditon.", condition_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - _log(SPAWNS__CONDITIONS, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -930,7 +930,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //set our local value cond.value = new_value; - _log(SPAWNS__CONDITIONS, "Condition update received from world for %d with value %d", condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -941,14 +941,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - _log(SPAWNS__CONDITIONS, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - _log(SPAWNS__CONDITIONS, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -959,7 +959,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //save it in the DB too UpdateDBCondition(zone_short, instance_id, condition_id, new_value); - _log(SPAWNS__CONDITIONS, "Local Condition update requested for %d with value %d", condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -969,7 +969,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //this is a remote spawn condition, update the DB and send //an update packet to the zone if its up - _log(SPAWNS__CONDITIONS, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); UpdateDBCondition(zone_short, instance_id, condition_id, new_value); @@ -989,7 +989,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance void SpawnConditionManager::ReloadEvent(uint32 event_id) { std::string zone_short_name; - _log(SPAWNS__CONDITIONS, "Requested to reload event %d from the database.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1002,7 +1002,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { //load the event into the old event slot if(!LoadDBEvent(event_id, cevent, zone_short_name)) { //unable to find the event in the database... - _log(SPAWNS__CONDITIONS, "Failed to reload event %d from the database.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } //sync up our nearest event @@ -1015,7 +1015,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { SpawnEvent e; if(!LoadDBEvent(event_id, e, zone_short_name)) { //unable to find the event in the database... - _log(SPAWNS__CONDITIONS, "Failed to reload event %d from the database.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } @@ -1032,7 +1032,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base) { - _log(SPAWNS__CONDITIONS, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1047,13 +1047,13 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri cevent.enabled = enabled; cevent.strict = strict; if(reset_base) { - _log(SPAWNS__CONDITIONS, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); //start with the time now zone->zone_time.getEQTimeOfDay(&cevent.next); //advance the next time by our period EQTime::AddMinutes(cevent.period, &cevent.next); } else { - _log(SPAWNS__CONDITIONS, "Spawn event %d located in this zone. State changed.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); } //save the event in the DB @@ -1062,7 +1062,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri //sync up our nearest event FindNearestEvent(); } else { - _log(SPAWNS__CONDITIONS, "Spawn event %d located in this zone but no change was needed.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); } //even if we dont change anything, we still found it return; @@ -1081,24 +1081,24 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri SpawnEvent e; std::string zone_short_name; if(!LoadDBEvent(event_id, e, zone_short_name)) { - _log(SPAWNS__CONDITIONS, "Unable to find spawn event %d in the database.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); //unable to find the event in the database... return; } if(e.enabled == enabled && !reset_base) { - _log(SPAWNS__CONDITIONS, "Spawn event %d is not located in this zone but no change was needed.", event_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); return; //no changes. } e.enabled = enabled; if(reset_base) { - _log(SPAWNS__CONDITIONS, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); //start with the time now zone->zone_time.getEQTimeOfDay(&e.next); //advance the next time by our period EQTime::AddMinutes(e.period, &e.next); } else { - _log(SPAWNS__CONDITIONS, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); } //save the event in the DB UpdateDBEvent(e); @@ -1123,7 +1123,7 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - _log(SPAWNS__CONDITIONS, "Unable to find local condition %d in Get request.", condition_id); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); return(0); //unable to find the spawn condition } @@ -1138,12 +1138,12 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc zone_short, instance_id, condition_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - _log(SPAWNS__CONDITIONS, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } if (results.RowCount() == 0) { - _log(SPAWNS__CONDITIONS, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } From eaf2da1171ab6a704adc558d22683867f1d157cf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:53:17 -0600 Subject: [PATCH 052/707] Convert 'TRIBUTE' debugging _log to logger.LogDebugType --- zone/client_packet.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 08f52a4bb..09f2b1da6 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -9814,7 +9814,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_OpenGuildTributeMaster of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9846,7 +9846,7 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_OpenTributeMaster of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -11782,7 +11782,7 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_SelectTribute of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this @@ -13757,7 +13757,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_TributeItem of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates an item... @@ -13776,7 +13776,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); - _log(TRIBUTE__OUT, "Sending tribute item reply with %d points", t->tribute_points); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13786,7 +13786,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_TributeMoney of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates money @@ -13805,7 +13805,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); - _log(TRIBUTE__OUT, "Sending tribute money reply with %d points", t->tribute_points); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13815,7 +13815,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_TributeNPC of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); _pkt(TRIBUTE__IN, app); return; @@ -13823,7 +13823,7 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_TributeToggle of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) @@ -13837,7 +13837,7 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { - _log(TRIBUTE__IN, "Received OP_TributeUpdate of length %d", app->size); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... From 463b358992c8352acbaa7ddd406e46df6b6316ff Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:53:46 -0600 Subject: [PATCH 053/707] Convert 'INVENTORY' debugging _log to logger.LogDebugType --- zone/inventory.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 19fca9f47..898a0b833 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer; - _log(INVENTORY__BANDOLIER, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name); const ItemInst* InvItem = nullptr; @@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { InvItem = GetInv()[WeaponSlot]; if(InvItem) { BaseItem = InvItem->GetItem(); - _log(INVENTORY__BANDOLIER, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon; database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name); } else { - _log(INVENTORY__BANDOLIER, "Char: %s no item in slot %i", GetName(), WeaponSlot); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0; } @@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { void Client::RemoveBandolier(const EQApplicationPacket *app) { BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer; - _log(INVENTORY__BANDOLIER, "Char: %s removing set", GetName(), bds->number); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); memset(m_pp.bandoliers[bds->number].name, 0, 32); for(int i = bandolierMainHand; i <= bandolierAmmo; i++) { m_pp.bandoliers[bds->number].items[i].item_id = 0; @@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // any items currently in the weapon slots to inventory. BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer; - _log(INVENTORY__BANDOLIER, "Char: %s activating set %i", GetName(), bss->number); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); int16 slot; int16 WeaponSlot; ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory @@ -2585,11 +2585,11 @@ void Client::SetBandolier(const EQApplicationPacket *app) { else { // The player doesn't have the required weapon with them. BandolierItems[BandolierSlot] = 0; if (slot == INVALID_INDEX) { - _log(INVENTORY__BANDOLIER, "Character does not have required bandolier item for slot %i", WeaponSlot); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { // If there was an item in that weapon slot, put it in the inventory - _log(INVENTORY__BANDOLIER, "returning item %s in weapon slot %i to inventory", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); @@ -2640,7 +2640,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // put it in the player's inventory. ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { - _log(INVENTORY__BANDOLIER, "Bandolier has no item for slot %i, returning item %s to inventory", + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name); // If there was an item in that weapon slot, put it in the inventory if(MoveItemToInventory(InvItem)) @@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { if(!ItemToReturn) return false; - _log(INVENTORY__SLOTS,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); uint32 ItemID = ItemToReturn->GetItem()->ID; @@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(i), i); - _log(INVENTORY__SLOTS, "Char: %s Storing in main inventory slot %i", GetName(), i); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); return true; } @@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot); - _log(INVENTORY__SLOTS, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); return true; } @@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // Store on the cursor // - _log(INVENTORY__SLOTS, "Char: %s No space, putting on the cursor", GetName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); PushItemOnCursor(*ItemToReturn, UpdateClient); From 53db4771f75a1610d0477a8181349dc9faac96dd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:54:16 -0600 Subject: [PATCH 054/707] Convert 'DOORS' debugging _log to logger.LogDebugType --- zone/doors.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/doors.cpp b/zone/doors.cpp index a4d3f80f2..3bc0101b1 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -145,9 +145,9 @@ bool Doors::Process() void Doors::HandleClick(Client* sender, uint8 trigger) { //door debugging info dump - _log(DOORS__INFO, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); - _log(DOORS__INFO, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); - _log(DOORS__INFO, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct)); MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer; From 509bd2d652a5a593386ad627d0796a040348b8b7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:55:44 -0600 Subject: [PATCH 055/707] Convert 'TRADESKILLS' debugging _log to logger.LogDebugType --- common/eqemu_logsys.cpp | 1 + common/eqemu_logsys.h | 1 + zone/tradeskills.cpp | 16 ++++++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 857d0ed63..d2e839ddf 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -91,6 +91,7 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Spells", "Tasks", "Trading", + "Tradeskills", "Tribute", }; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index ecf3fecf7..f99273313 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -68,6 +68,7 @@ public: Spells, Tasks, Trading, + Tradeskills, Tribute, MaxCategoryID /* Don't Remove this*/ }; diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index b249e2c28..ad85d23df 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { //handle caps if(spec->nofail) { chance = 100; //cannot fail. - _log(TRADESKILLS__TRACE, "...This combine cannot fail."); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); } else if(over_trivial >= 0) { // At reaching trivial the chance goes to 95% going up an additional // percent for every 40 skillpoints above the trivial. @@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { chance = 95; } - _log(TRADESKILLS__TRACE, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); - _log(TRADESKILLS__TRACE, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); float res = zone->random.Real(0, 99); int aa_chance = 0; @@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); - _log(TRADESKILLS__TRACE, "Tradeskill success"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); itr = spec->onsuccess.begin(); while(itr != spec->onsuccess.end() && !spec->quest) { @@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(MT_Emote,TRADESKILL_FAILED); - _log(TRADESKILLS__TRACE, "Tradeskill failed"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); @@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float NotifyNewTitlesAvailable(); } - _log(TRADESKILLS__TRACE, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); - _log(TRADESKILLS__TRACE, "...Stage1 chance was: %f percent", chance_stage1); - _log(TRADESKILLS__TRACE, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); } bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, From 44b6e9aa3f5612f4ee7a74e8c315517782d2a8d6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:57:04 -0600 Subject: [PATCH 056/707] Convert 'AA' debugging _log to logger.LogDebugType --- zone/bonuses.cpp | 6 +++--- zone/bot.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index a47c1f38b..48102b120 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -77,9 +77,9 @@ void Client::CalcBonuses() CalcSpellBonuses(&spellbonuses); - _log(AA__BONUSES, "Calculating AA Bonuses for %s.", this->GetCleanName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); CalcAABonuses(&aabonuses); //we're not quite ready for this - _log(AA__BONUSES, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); RecalcWeight(); @@ -638,7 +638,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - _log(AA__BONUSES, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) diff --git a/zone/bot.cpp b/zone/bot.cpp index 1f0cc6062..608cad996 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - _log(AA__BONUSES, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) From ae6bf5a227879039e66bb4335bbee69bfc02d1c5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:57:38 -0600 Subject: [PATCH 057/707] Convert 'Skills' debugging _log to logger.LogDebugType --- zone/client.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index abb7725ba..d65354d0e 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -2242,13 +2242,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha if(zone->random.Real(0, 99) < Chance) { SetSkill(skillid, GetRawSkill(skillid) + 1); - _log(SKILLS__GAIN, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); return true; } else { - _log(SKILLS__GAIN, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); } } else { - _log(SKILLS__GAIN, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); } return false; } @@ -2269,10 +2269,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) { if(zone->random.Real(0,100) < Chance) { // if they make the roll IncreaseLanguageSkill(langid); // increase the language skill by 1 - _log(SKILLS__GAIN, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); } else - _log(SKILLS__GAIN, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); } } From 6d8f64da57f936f418378781bedfad20853b1473 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 22:58:13 -0600 Subject: [PATCH 058/707] Convert 'TASKS' debugging _log to logger.LogDebugType --- zone/tasks.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 67f137d64..1cd2588e1 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -115,7 +115,7 @@ bool TaskManager::LoadSingleTask(int TaskID) { void TaskManager::ReloadGoalLists() { if(!GoalListManager.LoadLists()) - _log(TASKS__GLOBALLOAD,"TaskManager::LoadTasks LoadLists failed"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); } bool TaskManager::LoadTasks(int singleTask) { @@ -126,10 +126,10 @@ bool TaskManager::LoadTasks(int singleTask) { std::string query; if(singleTask == 0) { if(!GoalListManager.LoadLists()) - _log(TASKS__GLOBALLOAD,"TaskManager::LoadTasks LoadLists failed"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); if(!LoadTaskSets()) - _log(TASKS__GLOBALLOAD,"TaskManager::LoadTasks LoadTaskSets failed"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, " "`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, " @@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { int characterID = c->CharacterID(); - _log(TASKS__CLIENTSAVE,"TaskManager::SaveClientState for character ID %d", characterID); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { for(int task=0; task Date: Mon, 12 Jan 2015 23:01:01 -0600 Subject: [PATCH 059/707] Convert 'COMMON' debugging _log to logger.LogDebugType --- common/eq_stream_factory.cpp | 8 ++++---- common/spdat.cpp | 1 + common/tcp_connection.cpp | 4 ++-- common/tcp_server.cpp | 4 ++-- zone/net.cpp | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 0b940c18f..22412e0fe 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -25,13 +25,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - _log(COMMON__THREADS, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif fs->ReaderLoop(); #ifndef WIN32 - _log(COMMON__THREADS, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); @@ -42,13 +42,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - _log(COMMON__THREADS, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif fs->WriterLoop(); #ifndef WIN32 - _log(COMMON__THREADS, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/spdat.cpp b/common/spdat.cpp index 22861e53e..08081c8d8 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -72,6 +72,7 @@ #include "../common/logsys.h" #include "../common/logtypes.h" +#include "../common/eqemu_logsys.h" #include "classes.h" #include "spdat.h" diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 890a46adc..3f1e30a46 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -899,7 +899,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - _log(COMMON__THREADS, "Starting TCPConnectionLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -926,7 +926,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - _log(COMMON__THREADS, "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index f99fb256d..2313b9e7c 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -67,7 +67,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #ifndef WIN32 - _log(COMMON__THREADS, "Starting TCPServerLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Starting TCPServerLoop with thread ID %d", pthread_self()); #endif tcps->MLoopRunning.lock(); @@ -78,7 +78,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #ifndef WIN32 - _log(COMMON__THREADS, "Ending TCPServerLoop with thread ID %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/zone/net.cpp b/zone/net.cpp index 7ca406a96..df17ff73e 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #ifndef WIN32 - _log(COMMON__THREADS, "Main thread running with thread id %d", pthread_self()); + logger.LogDebug(EQEmuLogSys::Detail, "Main thread running with thread id %d", pthread_self()); #endif Timer quest_timers(100); From b219d7316301c748f1f24190efbc2477dcac2281 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 12 Jan 2015 23:08:35 -0600 Subject: [PATCH 060/707] _log replacements in various spots --- common/misc_functions.h | 2 +- common/patches/ss_define.h | 8 ++++---- zone/exp.cpp | 4 ++-- zone/tasks.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/misc_functions.h b/common/misc_functions.h index 610a86b04..7900bc855 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - _log(NET__ERROR, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 23d5dbbad..fbaee3689 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - _log(NET__STRUCTS, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - _log(NET__STRUCTS, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - _log(NET__STRUCTS, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - _log(NET__STRUCTS, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/zone/exp.cpp b/zone/exp.cpp index a96b9a9a0..c1ceeeae2 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - _log(CLIENT__EXP, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + logger.LogDebug(EQEmuLogSys::Detail, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - _log(CLIENT__EXP, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + logger.LogDebug(EQEmuLogSys::Detail, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 1cd2588e1..37dc89fc2 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -2262,7 +2262,7 @@ void Client::SendTaskComplete(int TaskIndex) { // I suspect this is the type field to indicate this is a quest task, as opposed to other types. tcs->unknown04 = 0x00000002; - _log("[TASKS]SendTasksComplete"); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks, "SendTasksComplete"); DumpPacket(outapp); fflush(stdout); QueuePacket(outapp); From 4bf2bfc8e36af5072d633ec71c0f1bb751c25519 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 13 Jan 2015 13:43:41 -0600 Subject: [PATCH 061/707] Debug message function updates --- common/eqemu_logsys.cpp | 29 +++++++++++++++++++++++------ common/eqemu_logsys.h | 5 +++-- zone/client_logs.cpp | 13 ++++++++++++- 3 files changed, 38 insertions(+), 9 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index d2e839ddf..a0220e282 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -136,7 +136,7 @@ void EQEmuLogSys::StartLogs(const std::string log_name) } } -void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...) +void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...) { if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } @@ -145,7 +145,19 @@ void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_type, std::str std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); + + std::string category_string = ""; + if (log_category > 0 && LogCategoryName[log_category]){ + category_string = StringFormat("[%s]", LogCategoryName[log_category]); + } + + std::string output_debug_message = StringFormat("%s %s", category_string.c_str(), output_message.c_str()); + + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + on_log_gmsay_hook(EQEmuLogSys::LogType::Debug, output_debug_message); + } + + EQEmuLogSys::ConsoleMessage(EQEmuLogSys::Debug, log_category, output_message); } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) @@ -197,7 +209,7 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) on_log_gmsay_hook(log_type, output_message); } - EQEmuLogSys::ConsoleMessage(log_type, output_message); + EQEmuLogSys::ConsoleMessage(log_type, 0, output_message); char time_stamp[80]; EQEmuLogSys::SetCurrentTimeStamp(time_stamp); @@ -206,11 +218,11 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) process_log << time_stamp << " " << StringFormat("[%s] ", TypeNames[log_type]).c_str() << output_message << std::endl; } else{ - std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; + // std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; } } -void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) +void EQEmuLogSys::ConsoleMessage(uint16 log_type, uint16 log_category, const std::string message) { if (log_type > EQEmuLogSys::MaxLogID){ return; @@ -220,6 +232,11 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) } if (!RuleB(Logging, ConsoleLogCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } + std::string category = ""; + if (log_category > 0 && LogCategoryName[log_category]){ + category = StringFormat("[%s] ", LogCategoryName[log_category]); + } + #ifdef _WINDOWS HANDLE console_handle; console_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -237,7 +254,7 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) } #endif - std::cout << "[N::" << TypeNames[log_type] << "] " << message << "\n"; + std::cout << "[N::" << TypeNames[log_type] << "] " << category << message << "\n"; #ifdef _WINDOWS /* Always set back to white*/ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index f99273313..3440f5a5e 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -74,11 +74,11 @@ public: }; void CloseZoneLogs(); - void ConsoleMessage(uint16 log_type, const std::string message); + void ConsoleMessage(uint16 log_type, uint16 log_category, const std::string message); void LoadLogSettings(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); - void LogDebugType(DebugLevel debug_level, uint16 log_type, std::string message, ...); + void LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartLogs(const std::string log_name); @@ -98,6 +98,7 @@ public: private: bool zone_general_init = false; std::function on_log_gmsay_hook; + }; extern EQEmuLogSys logger; diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index f2ead3a59..15079df60 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" #include "../common/features.h" +#include "../common/eqemu_logsys.h" #ifdef CLIENT_LOGS #include "client_logs.h" @@ -135,8 +136,18 @@ void ClientLogs::EQEmuIO_pva(EQEmuLog::LogIDs id, const char *prefix, const char client_logs.msg(id, _buffer); } +static uint32 gmsay_log_message_colors[EQEmuLogSys::MaxLogID] = { + 15, // "Status", - Yellow + 15, // "Normal", - Yellow + 3, // "Error", - Red + 14, // "Debug", - Light Green + 4, // "Quest", + 5, // "Command", + 3 // "Crash" +}; + void ClientLogs::ClientMessage(uint16 log_type, std::string& message){ - entity_list.MessageStatus(0, 80, 7, "%s", message.c_str()); + entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_type], "%s", message.c_str()); } #endif //CLIENT_LOGS From 72b53ee2a56b89498a06e19e507c7d1cd1b037bd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 13 Jan 2015 15:11:01 -0600 Subject: [PATCH 062/707] EQEmuLogSys internal function consolidation --- common/eqemu_logsys.cpp | 65 +++++++++++++++++++++-------------------- common/eqemu_logsys.h | 5 +++- 2 files changed, 38 insertions(+), 32 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index a0220e282..2dd2aed14 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -136,6 +136,14 @@ void EQEmuLogSys::StartLogs(const std::string log_name) } } +std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, std::string in_message){ + std::string category_string = ""; + if (log_category > 0 && LogCategoryName[log_category]){ + category_string = StringFormat("[%s] ", LogCategoryName[log_category]); + } + return StringFormat("%s%s", category_string.c_str(), in_message.c_str()); +} + void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...) { if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } @@ -145,19 +153,29 @@ void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std: std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - - std::string category_string = ""; - if (log_category > 0 && LogCategoryName[log_category]){ - category_string = StringFormat("[%s]", LogCategoryName[log_category]); - } + std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); - std::string output_debug_message = StringFormat("%s %s", category_string.c_str(), output_message.c_str()); + EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ConsoleMessage(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_debug_message); +} +void EQEmuLogSys::ProcessGMSay(uint16 log_type, std::string message){ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - on_log_gmsay_hook(EQEmuLogSys::LogType::Debug, output_debug_message); + on_log_gmsay_hook(log_type, message); } +} - EQEmuLogSys::ConsoleMessage(EQEmuLogSys::Debug, log_category, output_message); +void EQEmuLogSys::ProcessLogWrite(uint16 log_type, std::string message){ + char time_stamp[80]; + EQEmuLogSys::SetCurrentTimeStamp(time_stamp); + + if (process_log){ + process_log << time_stamp << " " << StringFormat("[%s] ", TypeNames[log_type]).c_str() << message << std::endl; + } + else{ + // std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; + } } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) @@ -169,7 +187,9 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - EQEmuLogSys::Log(EQEmuLogSys::LogType::Debug, output_message); + EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_message); + EQEmuLogSys::ConsoleMessage(EQEmuLogSys::Debug, output_message); + EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_message); } void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ @@ -205,24 +225,12 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - on_log_gmsay_hook(log_type, output_message); - } - - EQEmuLogSys::ConsoleMessage(log_type, 0, output_message); - - char time_stamp[80]; - EQEmuLogSys::SetCurrentTimeStamp(time_stamp); - - if (process_log){ - process_log << time_stamp << " " << StringFormat("[%s] ", TypeNames[log_type]).c_str() << output_message << std::endl; - } - else{ - // std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; - } + EQEmuLogSys::ProcessGMSay(log_type, output_message); + EQEmuLogSys::ConsoleMessage(log_type, output_message); + EQEmuLogSys::ProcessLogWrite(log_type, output_message); } -void EQEmuLogSys::ConsoleMessage(uint16 log_type, uint16 log_category, const std::string message) +void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) { if (log_type > EQEmuLogSys::MaxLogID){ return; @@ -232,11 +240,6 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, uint16 log_category, const std } if (!RuleB(Logging, ConsoleLogCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } - std::string category = ""; - if (log_category > 0 && LogCategoryName[log_category]){ - category = StringFormat("[%s] ", LogCategoryName[log_category]); - } - #ifdef _WINDOWS HANDLE console_handle; console_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -254,7 +257,7 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, uint16 log_category, const std } #endif - std::cout << "[N::" << TypeNames[log_type] << "] " << category << message << "\n"; + std::cout << "[N::" << TypeNames[log_type] << "] " << message << "\n"; #ifdef _WINDOWS /* Always set back to white*/ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 3440f5a5e..d4a055260 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -74,7 +74,7 @@ public: }; void CloseZoneLogs(); - void ConsoleMessage(uint16 log_type, uint16 log_category, const std::string message); + void ConsoleMessage(uint16 log_type, const std::string message); void LoadLogSettings(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); @@ -99,6 +99,9 @@ private: bool zone_general_init = false; std::function on_log_gmsay_hook; + void ProcessGMSay(uint16 log_type, std::string message); + void ProcessLogWrite(uint16 log_type, std::string message); + std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); }; extern EQEmuLogSys logger; From 99a0012bddd37f0908e043a1fc14855cb0f1b054 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 13 Jan 2015 15:13:12 -0600 Subject: [PATCH 063/707] Removal of rule based settings, moving to separate DB table --- common/eqemu_logsys.cpp | 14 -------------- common/ruletypes.h | 12 ------------ 2 files changed, 26 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 2dd2aed14..cfd7ab372 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -19,7 +19,6 @@ #include "eqemu_logsys.h" #include "string_util.h" -#include "rulesys.h" #include "platform.h" #include @@ -146,7 +145,6 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...) { - if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } va_list args; va_start(args, message); @@ -180,8 +178,6 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_type, std::string message){ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) { - if (RuleI(Logging, DebugLogLevel) < debug_level){ return; } - va_list args; va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); @@ -210,15 +206,9 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { - if (log_type > EQEmuLogSys::MaxLogID){ return; } - if (!RuleB(Logging, LogFileCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } - - if (!RuleB(Logging, EnableFileLogging)){ - return; - } va_list args; va_start(args, message); @@ -235,10 +225,6 @@ void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) if (log_type > EQEmuLogSys::MaxLogID){ return; } - if (!RuleB(Logging, EnableConsoleLogging)){ - return; - } - if (!RuleB(Logging, ConsoleLogCommands) && log_type == EQEmuLogSys::LogType::Commands){ return; } #ifdef _WINDOWS HANDLE console_handle; diff --git a/common/ruletypes.h b/common/ruletypes.h index c16590783..ad04cdbff 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -596,18 +596,6 @@ RULE_CATEGORY( Client ) RULE_BOOL( Client, UseLiveFactionMessage, false) // Allows players to see faction adjustments like Live RULE_CATEGORY_END() -RULE_CATEGORY(Logging) -RULE_BOOL(Logging, ConsoleLogCommands, false) /* Turns on or off console logs */ -RULE_BOOL(Logging, LogFileCommands, false) - -RULE_INT(Logging, DebugLogLevel, 0) /* Sets Debug Level, -1 = OFF, 0 = Low Level, 1 = Info, 2 = Extreme */ - -RULE_BOOL(Logging, EnableConsoleLogging, true) /* Turns on or off ALL logging to console */ -RULE_BOOL(Logging, EnableFileLogging, true) /* Turns on or off ALL forms of file logging */ - -RULE_CATEGORY_END() - - #undef RULE_CATEGORY #undef RULE_INT #undef RULE_REAL From bdd170df6ceb8545d740e56ce98cfdd93091d902 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 14 Jan 2015 05:12:01 -0600 Subject: [PATCH 064/707] More moving around of internal EQEmuLogSys functions --- common/eqemu_logsys.cpp | 145 ++++++++++++++++++++-------------------- common/eqemu_logsys.h | 10 +-- zone/zone.cpp | 4 +- 3 files changed, 81 insertions(+), 78 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index cfd7ab372..4883b94a6 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -18,8 +18,8 @@ #include "eqemu_logsys.h" -#include "string_util.h" #include "platform.h" +#include "string_util.h" #include #include @@ -126,15 +126,6 @@ void EQEmuLogSys::LoadLogSettings() log_settings_loaded = true; } -void EQEmuLogSys::StartLogs(const std::string log_name) -{ - if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - std::cout << "Starting Zone Logs..." << std::endl; - EQEmuLogSys::MakeDirectory("logs/zone"); - process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); - } -} - std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, std::string in_message){ std::string category_string = ""; if (log_category > 0 && LogCategoryName[log_category]){ @@ -143,20 +134,7 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s return StringFormat("%s%s", category_string.c_str(), in_message.c_str()); } -void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...) -{ - va_list args; - va_start(args, message); - std::string output_message = vStringFormat(message.c_str(), args); - va_end(args); - - std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); - - EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_debug_message); - EQEmuLogSys::ConsoleMessage(EQEmuLogSys::Debug, output_debug_message); - EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_debug_message); -} void EQEmuLogSys::ProcessGMSay(uint16 log_type, std::string message){ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ @@ -176,6 +154,51 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_type, std::string message){ } } +void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, const std::string message) +{ + if (log_type > EQEmuLogSys::MaxLogID){ + return; + } + + #ifdef _WINDOWS + HANDLE console_handle; + console_handle = GetStdHandle(STD_OUTPUT_HANDLE); + CONSOLE_FONT_INFOEX info = { 0 }; + info.cbSize = sizeof(info); + info.dwFontSize.Y = 12; // leave X as zero + info.FontWeight = FW_NORMAL; + wcscpy(info.FaceName, L"Lucida Console"); + SetCurrentConsoleFontEx(console_handle, NULL, &info); + if (LogColors[log_type]){ + SetConsoleTextAttribute(console_handle, LogColors[log_type]); + } + else{ + SetConsoleTextAttribute(console_handle, Console::Color::White); + } + #endif + + std::cout << "[N::" << TypeNames[log_type] << "] " << message << "\n"; + + #ifdef _WINDOWS + /* Always set back to white*/ + SetConsoleTextAttribute(console_handle, Console::Color::White); + #endif +} + +void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...) +{ + va_list args; + va_start(args, message); + std::string output_message = vStringFormat(message.c_str(), args); + va_end(args); + + std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); + + EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_debug_message); +} + void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) { va_list args; @@ -183,11 +206,27 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); + EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, output_message); EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_message); - EQEmuLogSys::ConsoleMessage(EQEmuLogSys::Debug, output_message); EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_message); } +void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) +{ + if (log_type > EQEmuLogSys::MaxLogID){ + return; + } + + va_list args; + va_start(args, message); + std::string output_message = vStringFormat(message.c_str(), args); + va_end(args); + + EQEmuLogSys::ProcessConsoleMessage(log_type, output_message); + EQEmuLogSys::ProcessGMSay(log_type, output_message); + EQEmuLogSys::ProcessLogWrite(log_type, output_message); +} + void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ time_t raw_time; struct tm * time_info; @@ -204,57 +243,19 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ #endif } -void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) -{ - if (log_type > EQEmuLogSys::MaxLogID){ - return; - } - - va_list args; - va_start(args, message); - std::string output_message = vStringFormat(message.c_str(), args); - va_end(args); - - EQEmuLogSys::ProcessGMSay(log_type, output_message); - EQEmuLogSys::ConsoleMessage(log_type, output_message); - EQEmuLogSys::ProcessLogWrite(log_type, output_message); -} - -void EQEmuLogSys::ConsoleMessage(uint16 log_type, const std::string message) -{ - if (log_type > EQEmuLogSys::MaxLogID){ - return; - } - -#ifdef _WINDOWS - HANDLE console_handle; - console_handle = GetStdHandle(STD_OUTPUT_HANDLE); - CONSOLE_FONT_INFOEX info = { 0 }; - info.cbSize = sizeof(info); - info.dwFontSize.Y = 12; // leave X as zero - info.FontWeight = FW_NORMAL; - wcscpy(info.FaceName, L"Lucida Console"); - SetCurrentConsoleFontEx(console_handle, NULL, &info); - if (LogColors[log_type]){ - SetConsoleTextAttribute(console_handle, LogColors[log_type]); - } - else{ - SetConsoleTextAttribute(console_handle, Console::Color::White); - } -#endif - - std::cout << "[N::" << TypeNames[log_type] << "] " << message << "\n"; - -#ifdef _WINDOWS - /* Always set back to white*/ - SetConsoleTextAttribute(console_handle, Console::Color::White); -#endif -} - -void EQEmuLogSys::CloseZoneLogs() +void EQEmuLogSys::CloseFileLogs() { if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ std::cout << "Closing down zone logs..." << std::endl; process_log.close(); } +} + +void EQEmuLogSys::StartFileLogs(const std::string log_name) +{ + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + std::cout << "Starting Zone Logs..." << std::endl; + EQEmuLogSys::MakeDirectory("logs/zone"); + process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); + } } \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d4a055260..b52f3ecd6 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -73,15 +73,15 @@ public: MaxCategoryID /* Don't Remove this*/ }; - void CloseZoneLogs(); - void ConsoleMessage(uint16 log_type, const std::string message); + void CloseFileLogs(); + void LoadLogSettings(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); void LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); - void StartLogs(const std::string log_name); + void StartFileLogs(const std::string log_name); struct LogSettings{ uint8 log_to_file; @@ -99,9 +99,11 @@ private: bool zone_general_init = false; std::function on_log_gmsay_hook; + std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); + + void ProcessConsoleMessage(uint16 log_type, const std::string message); void ProcessGMSay(uint16 log_type, std::string message); void ProcessLogWrite(uint16 log_type, std::string message); - std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); }; extern EQEmuLogSys logger; diff --git a/zone/zone.cpp b/zone/zone.cpp index 98eb41ee3..6098a61c5 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -152,7 +152,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { /* Set Logging */ - logger.StartLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + logger.StartFileLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); return true; } @@ -720,7 +720,7 @@ void Zone::Shutdown(bool quite) parse->ReloadQuests(true); UpdateWindowTitle(); - logger.CloseZoneLogs(); + logger.CloseFileLogs(); } void Zone::LoadZoneDoors(const char* zone, int16 version) From 6eae464211b626962a7bc869291befe82b2a1dcd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 22:17:37 -0600 Subject: [PATCH 065/707] Some EQEmuLogSys changes --- common/eqemu_logsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 4883b94a6..b47ccef65 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -138,7 +138,7 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s void EQEmuLogSys::ProcessGMSay(uint16 log_type, std::string message){ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - on_log_gmsay_hook(log_type, message); + // on_log_gmsay_hook(log_type, message); } } From 1e10e088ad2439a175ce4588d14529cd013676a7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 22:35:58 -0600 Subject: [PATCH 066/707] Add category to ProcessGMSay --- common/eqemu_logsys.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index b47ccef65..7c3ef2cb7 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -136,7 +136,8 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s -void EQEmuLogSys::ProcessGMSay(uint16 log_type, std::string message){ +void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string message) +{ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ // on_log_gmsay_hook(log_type, message); } @@ -195,7 +196,7 @@ void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std: std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, output_debug_message); - EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_debug_message); EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_debug_message); } @@ -207,7 +208,7 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) va_end(args); EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, output_message); - EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, output_message); + EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_message); EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_message); } @@ -223,7 +224,7 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) va_end(args); EQEmuLogSys::ProcessConsoleMessage(log_type, output_message); - EQEmuLogSys::ProcessGMSay(log_type, output_message); + EQEmuLogSys::ProcessGMSay(log_type, 0, output_message); EQEmuLogSys::ProcessLogWrite(log_type, output_message); } From 723b87bba4b73faf4d822e32dcefc77db1869804 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 22:37:36 -0600 Subject: [PATCH 067/707] Add category to ProcessConsoleMessage --- common/eqemu_logsys.cpp | 8 ++++---- common/eqemu_logsys.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 7c3ef2cb7..cf452d7bf 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -155,7 +155,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_type, std::string message){ } } -void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, const std::string message) +void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message) { if (log_type > EQEmuLogSys::MaxLogID){ return; @@ -195,7 +195,7 @@ void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std: std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); - EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_debug_message); EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_debug_message); EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_debug_message); } @@ -207,7 +207,7 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, output_message); + EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_message); EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_message); EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_message); } @@ -223,7 +223,7 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - EQEmuLogSys::ProcessConsoleMessage(log_type, output_message); + EQEmuLogSys::ProcessConsoleMessage(log_type, 0, output_message); EQEmuLogSys::ProcessGMSay(log_type, 0, output_message); EQEmuLogSys::ProcessLogWrite(log_type, output_message); } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index b52f3ecd6..471be0846 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -101,8 +101,8 @@ private: std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); - void ProcessConsoleMessage(uint16 log_type, const std::string message); - void ProcessGMSay(uint16 log_type, std::string message); + void ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message); + void ProcessGMSay(uint16 log_type, uint16 log_category, std::string message); void ProcessLogWrite(uint16 log_type, std::string message); }; From dbdfb23cc39642089e3a4ed6f1839dbbdf6d972a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 22:38:24 -0600 Subject: [PATCH 068/707] Add category to ProcessLogWrite --- common/eqemu_logsys.cpp | 9 +++++---- common/eqemu_logsys.h | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index cf452d7bf..d0d7887e4 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -143,7 +143,8 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string } } -void EQEmuLogSys::ProcessLogWrite(uint16 log_type, std::string message){ +void EQEmuLogSys::ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message) +{ char time_stamp[80]; EQEmuLogSys::SetCurrentTimeStamp(time_stamp); @@ -197,7 +198,7 @@ void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std: EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_debug_message); EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_debug_message); - EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_debug_message); + EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, 0, output_debug_message); } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) @@ -209,7 +210,7 @@ void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_message); EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_message); - EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, output_message); + EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, 0, output_message); } void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) @@ -225,7 +226,7 @@ void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) EQEmuLogSys::ProcessConsoleMessage(log_type, 0, output_message); EQEmuLogSys::ProcessGMSay(log_type, 0, output_message); - EQEmuLogSys::ProcessLogWrite(log_type, output_message); + EQEmuLogSys::ProcessLogWrite(log_type, 0, output_message); } void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 471be0846..5eed3e181 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -103,7 +103,7 @@ private: void ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message); void ProcessGMSay(uint16 log_type, uint16 log_category, std::string message); - void ProcessLogWrite(uint16 log_type, std::string message); + void ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message); }; extern EQEmuLogSys logger; From 362de5084ff6b725a5e1ef4640dbe13a0a00e31e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 22:44:27 -0600 Subject: [PATCH 069/707] Add category processing to ProcessGMSay so we don't get a zone crash from feedback loop of GMSay outputting packets, then those packets going to GMSay. This would make a log inside of a log inside of a log, I call it, log inception --- common/eqemu_logsys.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index d0d7887e4..b60687300 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -138,8 +138,12 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string message) { + /* Enabling Netcode based GMSay output creates a feedback loop that ultimately ends in a crash */ + if (log_category == EQEmuLogSys::LogCategory::Netcode) + return; + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - // on_log_gmsay_hook(log_type, message); + on_log_gmsay_hook(log_type, message); } } @@ -196,9 +200,9 @@ void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std: std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); - EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_debug_message); - EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_debug_message); - EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, 0, output_debug_message); + EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, log_category, output_debug_message); + EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, log_category, output_debug_message); + EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, log_category, output_debug_message); } void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) From 3a24372009bdf592bd243336a57728ad96b8fa0d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 23:10:45 -0600 Subject: [PATCH 070/707] Added 2015_1_15_logsys_categories_table.sql --- .../2015_1_15_logsys_categories_table.sql | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 utils/sql/git/required/2015_1_15_logsys_categories_table.sql diff --git a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql new file mode 100644 index 000000000..2ed16f5aa --- /dev/null +++ b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql @@ -0,0 +1,36 @@ +-- ---------------------------- +-- Table structure for logsys_categories +-- ---------------------------- +DROP TABLE IF EXISTS `logsys_categories`; +CREATE TABLE `logsys_categories` ( + `log_category_id` int(11) NOT NULL, + `log_category_description` varchar(150) DEFAULT NULL, + `log_to_console` smallint(11) DEFAULT '0', + `log_to_file` smallint(11) DEFAULT '0', + `log_to_gmsay` smallint(11) DEFAULT '0', + PRIMARY KEY (`log_category_id`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1; + +-- ---------------------------- +-- Records of logsys_categories +-- ---------------------------- +INSERT INTO `logsys_categories` VALUES ('0', 'Zone_Server', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('1', 'World_Server', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('2', 'UCS_Server', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('3', 'QS_Server', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('4', 'WebInterface_Server', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('5', 'AA', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('6', 'Doors', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('7', 'Guilds', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('8', 'Inventory', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('9', 'Launcher', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('10', 'Netcode - Does not log to gmsay for loop reasons', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('11', 'Object', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('12', 'Rules', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('13', 'Skills', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('14', 'Spawns', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('15', 'Spells', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('16', 'Tasks', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('17', 'Trading', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('18', 'Tradeskills', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('19', 'Tribute', '0', '0', '0'); From 44b65d1ee50e1c6acaabc98c7d00351da27127f3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Thu, 15 Jan 2015 23:49:20 -0600 Subject: [PATCH 071/707] Add Database::LoadLogSysSettings function --- common/database.cpp | 25 +++++++++++++++++++++++++ common/database.h | 3 +++ common/eqemu_logsys.cpp | 27 ++------------------------- common/eqemu_logsys.h | 25 ++++++++++++++++++++++++- zone/zonedb.h | 1 + 5 files changed, 55 insertions(+), 26 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index f852ae37e..dd95103ba 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4257,3 +4257,28 @@ uint32 Database::GetGuildIDByCharID(uint32 char_id) auto row = results.begin(); return atoi(row[0]); } + +void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ + std::string query = + "SELECT " + "log_category_id, " + "log_category_description, " + "log_to_console, " + "log_to_file, " + "log_to_gmsay " + "FROM " + "logsys_categories " + "ORDER BY log_category_id"; + auto results = QueryDatabase(query); + int log_category = 0; + for (auto row = results.begin(); row != results.end(); ++row) { + log_category = atoi(row[0]); + log_settings[log_category].log_to_console = atoi(row[2]); + log_settings[log_category].log_to_file = atoi(row[3]); + log_settings[log_category].log_to_gmsay = atoi(row[4]); + std::cout << "Setting log settings for " << log_category << " " << LogCategoryName[log_category] << " " << std::endl; + std::cout << "--- log_to_console = " << atoi(row[2]) << std::endl; + std::cout << "--- log_to_file = " << atoi(row[3]) << std::endl; + std::cout << "--- log_to_gmsay = " << atoi(row[4]) << std::endl; + } +} \ No newline at end of file diff --git a/common/database.h b/common/database.h index f45b83600..424a0dfa9 100644 --- a/common/database.h +++ b/common/database.h @@ -645,6 +645,9 @@ public: void SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon); void AddReport(std::string who, std::string against, std::string lines); + /* EQEmuLogSys */ + void LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings); + private: void DBInitVars(); diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index b60687300..5b13438d1 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -20,6 +20,7 @@ #include "eqemu_logsys.h" #include "platform.h" #include "string_util.h" +#include "database.h" #include #include @@ -70,30 +71,6 @@ static const char* TypeNames[EQEmuLogSys::MaxLogID] = { "Crash", }; -/* If you add to this, make sure you update LogCategory in eqemu_logsys.h */ -static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { - "Zone", - "World", - "UCS", - "QueryServer", - "WebInterface", - "AA", - "Doors", - "Guild", - "Inventory", - "Launcher", - "Netcode", - "Object", - "Rules", - "Skills", - "Spawns", - "Spells", - "Tasks", - "Trading", - "Tradeskills", - "Tribute", -}; - static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { Console::Color::Yellow, // "Status", Console::Color::Yellow, // "Normal", @@ -121,7 +98,7 @@ void EQEmuLogSys::LoadLogSettings() log_settings[i].log_to_console = 1; log_settings[i].log_to_file = 1; log_settings[i].log_to_gmsay = 1; - std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl; + // std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl; } log_settings_loaded = true; } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 5eed3e181..669d06ea9 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -48,7 +48,7 @@ public: Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; - /* If you add to this, make sure you update LogCategoryName in eqemu_logsys.cpp */ + /* If you add to this, make sure you update LogCategoryName */ enum LogCategory { Zone_Server = 0, World_Server, @@ -108,5 +108,28 @@ private: extern EQEmuLogSys logger; +/* If you add to this, make sure you update LogCategory */ +static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { + "Zone", + "World", + "UCS", + "QueryServer", + "WebInterface", + "AA", + "Doors", + "Guild", + "Inventory", + "Launcher", + "Netcode", + "Object", + "Rules", + "Skills", + "Spawns", + "Spells", + "Tasks", + "Trading", + "Tradeskills", + "Tribute", +}; #endif \ No newline at end of file diff --git a/zone/zonedb.h b/zone/zonedb.h index 1c103074a..56d9a2b25 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -4,6 +4,7 @@ #include "../common/shareddb.h" #include "../common/eq_packet_structs.h" #include "../common/faction.h" +#include "../common/eqemu_logsys.h" class Client; class Corpse; From 0d2c3966809db0df72c1a71251ea95ea34dcc518 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:06:12 -0600 Subject: [PATCH 072/707] zone LoadLogSysSettings --- zone/net.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index df17ff73e..8d18daba1 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -115,8 +115,7 @@ extern void MapOpcodes(); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformZone); - logger.LoadLogSettings(); - logger.OnLogHookCallBackZone(&ClientLogs::ClientMessage); + set_exception_handler(); const char *zone_name; @@ -149,8 +148,6 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { logger.Log(EQEmuLogSys::Error, "Loading server configuration failed."); @@ -175,6 +172,12 @@ int main(int argc, char** argv) { logger.Log(EQEmuLogSys::Error, "Cannot continue without a database connection."); return 1; } + + /* Register Log System and Settings */ + logger.LoadLogSettings(); + logger.OnLogHookCallBackZone(&ClientLogs::ClientMessage); + database.LoadLogSysSettings(logger.log_settings); + guild_mgr.SetDatabase(&database); GuildBanks = nullptr; From 70fbf23d2736fe7e3db7ba3f67f38d2708ae7259 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:07:30 -0600 Subject: [PATCH 073/707] Rename LoadLogSettings to LoadLogSettingsDefaults --- client_files/export/main.cpp | 2 +- client_files/import/main.cpp | 2 +- common/eqemu_logsys.cpp | 2 +- common/eqemu_logsys.h | 2 +- eqlaunch/eqlaunch.cpp | 2 +- queryserv/queryserv.cpp | 2 +- shared_memory/main.cpp | 2 +- ucs/ucs.cpp | 2 +- world/net.cpp | 2 +- zone/net.cpp | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 550446cb2..18136fcf4 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -35,7 +35,7 @@ void ExportBaseData(SharedDatabase *db); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientExport); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); logger.Log(EQEmuLogSys::Status, "Client Files Export Utility"); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 381889d93..492e7b901 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -33,7 +33,7 @@ void ImportBaseData(SharedDatabase *db); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientImport); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); logger.Log(EQEmuLogSys::Status, "Client Files Import Utility"); diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 5b13438d1..61f4f81bd 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -89,7 +89,7 @@ EQEmuLogSys::EQEmuLogSys(){ EQEmuLogSys::~EQEmuLogSys(){ } -void EQEmuLogSys::LoadLogSettings() +void EQEmuLogSys::LoadLogSettingsDefaults() { log_platform = GetExecutablePlatformInt(); std::cout << "PLATFORM " << log_platform << std::endl; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 669d06ea9..29315c74c 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -75,7 +75,7 @@ public: void CloseFileLogs(); - void LoadLogSettings(); + void LoadLogSettingsDefaults(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); void LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...); diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 11ad0686f..861f536fa 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -39,7 +39,7 @@ void CatchSignal(int sig_num); int main(int argc, char *argv[]) { RegisterExecutablePlatform(ExePlatformLaunch); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); std::string launcher_name; diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index a64ce9be8..25b033a24 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -50,7 +50,7 @@ void CatchSignal(int sig_num) { int main() { RegisterExecutablePlatform(ExePlatformQueryServ); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); Timer LFGuildExpireTimer(60000); Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 333d5789c..e8d7ec8b9 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -37,7 +37,7 @@ EQEmuLogSys logger; int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformSharedMemory); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); logger.Log(EQEmuLogSys::Status, "Shared Memory Loader Program"); diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 2af41f71d..74f7c0522 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -69,7 +69,7 @@ std::string GetMailPrefix() { int main() { RegisterExecutablePlatform(ExePlatformUCS); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); // Check every minute for unused channels we can delete diff --git a/world/net.cpp b/world/net.cpp index 6f3d85f5e..64a0b973b 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -113,7 +113,7 @@ void CatchSignal(int sig_num); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformWorld); - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); set_exception_handler(); /* Database Version Check */ diff --git a/zone/net.cpp b/zone/net.cpp index 8d18daba1..64c741ffc 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -174,7 +174,7 @@ int main(int argc, char** argv) { } /* Register Log System and Settings */ - logger.LoadLogSettings(); + logger.LoadLogSettingsDefaults(); logger.OnLogHookCallBackZone(&ClientLogs::ClientMessage); database.LoadLogSysSettings(logger.log_settings); From 2fb50fa5cc42b4d90177e647545a1edb4b2da4b6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:13:56 -0600 Subject: [PATCH 074/707] Implement log_settings for ProcessGMSay --- common/eqemu_logsys.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 61f4f81bd..be6cb45de 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -92,13 +92,11 @@ EQEmuLogSys::~EQEmuLogSys(){ void EQEmuLogSys::LoadLogSettingsDefaults() { log_platform = GetExecutablePlatformInt(); - std::cout << "PLATFORM " << log_platform << std::endl; /* Write defaults */ for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){ - log_settings[i].log_to_console = 1; - log_settings[i].log_to_file = 1; - log_settings[i].log_to_gmsay = 1; - // std::cout << "Setting log settings for " << i << " " << LogCategoryName[i] << " " << std::endl; + log_settings[i].log_to_console = 0; + log_settings[i].log_to_file = 0; + log_settings[i].log_to_gmsay = 0; } log_settings_loaded = true; } @@ -115,6 +113,10 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string message) { + /* Check if category enabled for process */ + if (log_settings[log_category].log_to_gmsay) + return; + /* Enabling Netcode based GMSay output creates a feedback loop that ultimately ends in a crash */ if (log_category == EQEmuLogSys::LogCategory::Netcode) return; From 0b661a634728d11625d0ea7677c8e363eac9c57e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:14:16 -0600 Subject: [PATCH 075/707] Implement log_settings for ProcessLogWrite --- common/eqemu_logsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index be6cb45de..68f1cafdf 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -128,6 +128,10 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string void EQEmuLogSys::ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message) { + /* Check if category enabled for process */ + if (log_settings[log_category].log_to_file) + return; + char time_stamp[80]; EQEmuLogSys::SetCurrentTimeStamp(time_stamp); From 73b54ffabb11fda8e1cede77d591bd6213a481f3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:14:49 -0600 Subject: [PATCH 076/707] Implement log_settings for ProcessConsoleMessage --- common/eqemu_logsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 68f1cafdf..a2316933d 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -145,6 +145,10 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_type, uint16 log_category, std::str void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message) { + /* Check if category enabled for process */ + if (log_settings[log_category].log_to_console) + return; + if (log_type > EQEmuLogSys::MaxLogID){ return; } From 829dd8ddafc5cb014da83fbe70c38034b642a455 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:15:34 -0600 Subject: [PATCH 077/707] Correct log_settings checks --- common/eqemu_logsys.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index a2316933d..ac81c106a 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -114,7 +114,7 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string message) { /* Check if category enabled for process */ - if (log_settings[log_category].log_to_gmsay) + if (log_settings[log_category].log_to_gmsay == 0) return; /* Enabling Netcode based GMSay output creates a feedback loop that ultimately ends in a crash */ @@ -129,7 +129,7 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string void EQEmuLogSys::ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message) { /* Check if category enabled for process */ - if (log_settings[log_category].log_to_file) + if (log_settings[log_category].log_to_file == 0) return; char time_stamp[80]; @@ -146,7 +146,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_type, uint16 log_category, std::str void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message) { /* Check if category enabled for process */ - if (log_settings[log_category].log_to_console) + if (log_settings[log_category].log_to_console == 0) return; if (log_type > EQEmuLogSys::MaxLogID){ From cdc249dde341e0147093e95217d1c2bb66a477dc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:37:36 -0600 Subject: [PATCH 078/707] Converted SyncWorldtime std::cout --- common/eqemu_logsys.cpp | 2 -- zone/worldserver.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index ac81c106a..8a3a49adf 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -109,8 +109,6 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s return StringFormat("%s%s", category_string.c_str(), in_message.c_str()); } - - void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string message) { /* Check if category enabled for process */ diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 2166aba56..06c4a26cb 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -748,7 +748,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - std::cout << "Received Message SyncWorldTime" << std::endl; + logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); From e69486d9058d52e332c7eabc87169ee8e2641615 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:40:43 -0600 Subject: [PATCH 079/707] Converted 'is a GM' debug --- zone/client.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index d65354d0e..69569cbf2 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1511,9 +1511,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { -#if EQDEBUG >= 5 - printf("%s is a GM\n", GetName()); -#endif + logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "%s is a GM"); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); From 055f1523c7588f1fe8cc7450d2607d305b23219d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:44:28 -0600 Subject: [PATCH 080/707] Comment defaults debugging --- common/database.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index dd95103ba..1fb4ef445 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4276,9 +4276,9 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ log_settings[log_category].log_to_console = atoi(row[2]); log_settings[log_category].log_to_file = atoi(row[3]); log_settings[log_category].log_to_gmsay = atoi(row[4]); - std::cout << "Setting log settings for " << log_category << " " << LogCategoryName[log_category] << " " << std::endl; - std::cout << "--- log_to_console = " << atoi(row[2]) << std::endl; - std::cout << "--- log_to_file = " << atoi(row[3]) << std::endl; - std::cout << "--- log_to_gmsay = " << atoi(row[4]) << std::endl; + // std::cout << "Setting log settings for " << log_category << " " << LogCategoryName[log_category] << " " << std::endl; + // std::cout << "--- log_to_console = " << atoi(row[2]) << std::endl; + // std::cout << "--- log_to_file = " << atoi(row[3]) << std::endl; + // std::cout << "--- log_to_gmsay = " << atoi(row[4]) << std::endl; } } \ No newline at end of file From cd7e9d40bf7a47a6e1a7d72492e9e5e229fcc934 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:50:16 -0600 Subject: [PATCH 081/707] Re-Index Log Categories to avoid bugginies with index references --- common/database.cpp | 8 ++-- common/eqemu_logsys.h | 2 +- .../2015_1_15_logsys_categories_table.sql | 43 ++++++++++--------- 3 files changed, 28 insertions(+), 25 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 1fb4ef445..dd95103ba 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4276,9 +4276,9 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ log_settings[log_category].log_to_console = atoi(row[2]); log_settings[log_category].log_to_file = atoi(row[3]); log_settings[log_category].log_to_gmsay = atoi(row[4]); - // std::cout << "Setting log settings for " << log_category << " " << LogCategoryName[log_category] << " " << std::endl; - // std::cout << "--- log_to_console = " << atoi(row[2]) << std::endl; - // std::cout << "--- log_to_file = " << atoi(row[3]) << std::endl; - // std::cout << "--- log_to_gmsay = " << atoi(row[4]) << std::endl; + std::cout << "Setting log settings for " << log_category << " " << LogCategoryName[log_category] << " " << std::endl; + std::cout << "--- log_to_console = " << atoi(row[2]) << std::endl; + std::cout << "--- log_to_file = " << atoi(row[3]) << std::endl; + std::cout << "--- log_to_gmsay = " << atoi(row[4]) << std::endl; } } \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 29315c74c..f3f31740e 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -50,7 +50,7 @@ public: /* If you add to this, make sure you update LogCategoryName */ enum LogCategory { - Zone_Server = 0, + Zone_Server = 1, World_Server, UCS_Server, QS_Server, diff --git a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql index 2ed16f5aa..6e6847416 100644 --- a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql +++ b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql @@ -1,3 +1,6 @@ + +SET FOREIGN_KEY_CHECKS=0; + -- ---------------------------- -- Table structure for logsys_categories -- ---------------------------- @@ -14,23 +17,23 @@ CREATE TABLE `logsys_categories` ( -- ---------------------------- -- Records of logsys_categories -- ---------------------------- -INSERT INTO `logsys_categories` VALUES ('0', 'Zone_Server', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('1', 'World_Server', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('2', 'UCS_Server', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('3', 'QS_Server', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('4', 'WebInterface_Server', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('5', 'AA', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('6', 'Doors', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('7', 'Guilds', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('8', 'Inventory', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('9', 'Launcher', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('10', 'Netcode - Does not log to gmsay for loop reasons', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('11', 'Object', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('12', 'Rules', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('13', 'Skills', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('14', 'Spawns', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('15', 'Spells', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('16', 'Tasks', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('17', 'Trading', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('18', 'Tradeskills', '0', '0', '0'); -INSERT INTO `logsys_categories` VALUES ('19', 'Tribute', '0', '0', '0'); +INSERT INTO `logsys_categories` VALUES ('1', 'Zone_Server', '1', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('2', 'World_Server', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('3', 'UCS_Server', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('4', 'QS_Server', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('5', 'WebInterface_Server', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('6', 'AA', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('7', 'Doors', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('8', 'Guilds', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('9', 'Inventory', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('10', 'Launcher', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('11', 'Netcode - Does not log to gmsay for loop reasons', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('12', 'Object', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('13', 'Rules', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('14', 'Skills', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('15', 'Spawns', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('16', 'Spells', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('17', 'Tasks', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('18', 'Trading', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('19', 'Tradeskills', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('20', 'Tribute', '0', '0', '1'); From af1fc5539331efcfe522aca3001f09b9919d1703 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:52:00 -0600 Subject: [PATCH 082/707] Comment defaults debugging --- common/database.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index dd95103ba..0246785fd 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4276,9 +4276,5 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ log_settings[log_category].log_to_console = atoi(row[2]); log_settings[log_category].log_to_file = atoi(row[3]); log_settings[log_category].log_to_gmsay = atoi(row[4]); - std::cout << "Setting log settings for " << log_category << " " << LogCategoryName[log_category] << " " << std::endl; - std::cout << "--- log_to_console = " << atoi(row[2]) << std::endl; - std::cout << "--- log_to_file = " << atoi(row[3]) << std::endl; - std::cout << "--- log_to_gmsay = " << atoi(row[4]) << std::endl; } } \ No newline at end of file From 2cb3a491e0a30a5e3be655438456a04ecf3c811f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:53:31 -0600 Subject: [PATCH 083/707] Add include to eq_stream_factory.cpp for EQEmuLogSys --- common/eq_stream_factory.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 22412e0fe..7d2a7e365 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -1,4 +1,5 @@ #include "debug.h" +#include "eqemu_logsys.h" #include "eq_stream_factory.h" #ifdef _WINDOWS From 32a3666170fe407839cbb870b50a37892555c1c9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 00:54:27 -0600 Subject: [PATCH 084/707] Add Linux chmod mask 0755 for mkdir --- common/eqemu_logsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 8a3a49adf..9204f3136 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -230,7 +230,7 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ #ifdef _WINDOWS _mkdir(directory_name.c_str()); #else - mkdir(directory_name.c_str()); + mkdir(directory_name.c_str(), 0755); #endif } From 04f13bbf4bd327a0d2e2345f6d02b2eb9431ce07 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:03:15 -0600 Subject: [PATCH 085/707] Fix for tcp_connection.cpp logger references --- common/tcp_connection.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 3f1e30a46..f0df7b197 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -17,6 +17,7 @@ */ #include "../common/debug.h" +#include "../common/eqemu_logsys.h" #include #include From 3c22b106efd6a4f17cc081a91ffe9db38868dcc6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:07:29 -0600 Subject: [PATCH 086/707] TCPConnection LogCategory Add --- common/eqemu_logsys.h | 2 ++ common/tcp_connection.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index f3f31740e..a80932edc 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -70,6 +70,7 @@ public: Trading, Tradeskills, Tribute, + TCP_Connection, MaxCategoryID /* Don't Remove this*/ }; @@ -130,6 +131,7 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Trading", "Tradeskills", "Tribute", + "TCP_Connection" }; #endif \ No newline at end of file diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index f0df7b197..4a17125a0 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Starting TCPConnectionLoop with thread ID %d", pthread_self()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { From d42a63b72dfbc2688b5c7ff021f2f66b409b5fd6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:08:26 -0600 Subject: [PATCH 087/707] TCPConnection Loop add to TCP Category --- common/tcp_connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 4a17125a0..2cba6fd88 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); From 5b51f69753a9d0df74d72e95a912189198b94843 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:16:17 -0600 Subject: [PATCH 088/707] Fix for 'is a GM' convert (Derp) --- common/eqemu_logsys.h | 1 + zone/client.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index a80932edc..18c063495 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -111,6 +111,7 @@ extern EQEmuLogSys logger; /* If you add to this, make sure you update LogCategory */ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { + "", "Zone", "World", "UCS", diff --git a/zone/client.cpp b/zone/client.cpp index 69569cbf2..0bb719e35 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1511,7 +1511,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "%s is a GM"); + logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "%s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); From 295fa30a35b01f67dc25f6d0e208c54ed60aac8e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:21:02 -0600 Subject: [PATCH 089/707] Adjust World to zone port assignment message --- zone/client.cpp | 2 +- zone/worldserver.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 0bb719e35..89a4ab75e 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1511,7 +1511,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "%s is a GM", GetName()); + logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 06c4a26cb..d75e79b38 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server,"Got 0x%04x from world:",pack->opcode); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,7 +155,7 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server,"World indicated port %d for this zone.",sci->port); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); ZoneConfig::SetZonePort(sci->port); break; } From 08d05d8aae4f3ed9656aab150d3c09444d2b89aa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:21:58 -0600 Subject: [PATCH 090/707] ServerOP_ZAAuthFailed cout message to LogDebugType --- zone/worldserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index d75e79b38..8abb308d7 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -160,7 +160,7 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - std::cout << "World server responded 'Not Authorized', disabling reconnect" << std::endl; + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; From d77ec9b46681c00e7ddd1d443343073f260099b2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:26:36 -0600 Subject: [PATCH 091/707] Add Client_Server_Packet Category --- common/eqemu_logsys.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 18c063495..62a57d682 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -71,6 +71,7 @@ public: Tradeskills, Tribute, TCP_Connection, + Client_Server_Packet, MaxCategoryID /* Don't Remove this*/ }; @@ -132,7 +133,8 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Trading", "Tradeskills", "Tribute", - "TCP_Connection" + "TCP_Connection", + "Client_Server_Packet", }; #endif \ No newline at end of file From 0c905226e1b515a4cafef7a34e9cdb4d165ad500 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 16 Jan 2015 02:32:05 -0500 Subject: [PATCH 092/707] Fix linux compile (partially) --- common/tcp_server.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index 2313b9e7c..9e0553d40 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -1,5 +1,6 @@ #include "debug.h" #include "tcp_server.h" +#include "../common/eqemu_logsys.h" #include #include From 5902330bc5d5efc3bd011e8fd678876f6be5c9e7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:46:17 -0600 Subject: [PATCH 093/707] ChannelMesssageReceived debug convert from preprocessor --- common/eqemu_logsys.h | 1 - zone/client.cpp | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 62a57d682..afcf04aab 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -76,7 +76,6 @@ public: }; void CloseFileLogs(); - void LoadLogSettingsDefaults(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); diff --git a/zone/client.cpp b/zone/client.cpp index 89a4ab75e..b05ae924c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -700,10 +700,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s char message[4096]; strn0cpy(message, orig_message, sizeof(message)); - - #if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General,"Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); - #endif + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); if (targetname == nullptr) { targetname = (!GetTarget()) ? "" : GetTarget()->GetName(); From bab8e2ef33fcfbaf72ca9d0dd2f343c0cd2139f1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:47:27 -0600 Subject: [PATCH 094/707] Removed preprocessor EQDEBUG from EQStream from unknown opcode to Application map --- common/eq_stream.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 9a957f5a7..39659e897 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -958,11 +958,10 @@ EQRawApplicationPacket *p=nullptr; if(p) { if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); -#if EQDEBUG >= 4 - if(emu_op == OP_Unknown) { + if (emu_op == OP_Unknown) { logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } -#endif + p->SetOpcode(emu_op); } } From 3c9a2702b51532ebe0cf68f182953440ca650874 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 01:48:43 -0600 Subject: [PATCH 095/707] Removed preprocessor EQDEBUG from EQStream from unknown opcode to Application map for PopRawPacket --- common/eq_stream.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 39659e897..38f2c0cdd 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -985,11 +985,10 @@ EQRawApplicationPacket *p=nullptr; if(p) { if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); -#if EQDEBUG >= 4 if(emu_op == OP_Unknown) { - logger.Log(EQEmuLogSys::Debug, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } -#endif + p->SetOpcode(emu_op); } } From ba2b91a548d20cba13dd17d91809e045ae6da02b Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Fri, 16 Jan 2015 02:56:14 -0500 Subject: [PATCH 096/707] Fix loginserver --- loginserver/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/loginserver/main.cpp b/loginserver/main.cpp index 820cc9113..31941b800 100644 --- a/loginserver/main.cpp +++ b/loginserver/main.cpp @@ -22,6 +22,7 @@ #include "../common/timer.h" #include "../common/platform.h" #include "../common/crash.h" +#include "../common/eqemu_logsys.h" #include "login_server.h" #include #include @@ -30,6 +31,7 @@ TimeoutManager timeout_manager; LoginServer server; +EQEmuLogSys logger; ErrorLog *server_log; bool run_server = true; From c23a5008e28e0d3672826fdb55204050183676f2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:04:52 -0600 Subject: [PATCH 097/707] Add 'Aggro' Category --- common/eqemu_logsys.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index afcf04aab..6dec2b6ff 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -72,6 +72,7 @@ public: Tribute, TCP_Connection, Client_Server_Packet, + Aggro, MaxCategoryID /* Don't Remove this*/ }; @@ -134,6 +135,7 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Tribute", "TCP_Connection", "Client_Server_Packet", + "Aggro", }; #endif \ No newline at end of file From f760597684e2781cfb6092613938d55c75f756a0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:06:22 -0600 Subject: [PATCH 098/707] Removed preprocessor EQDEBUG in CheckWillAggro and converted log message --- zone/aggro.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 0fe174a65..437713062 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,11 +342,8 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - - // Aggro - #if EQDEBUG>=6 - logger.LogDebug(EQEmuLogSys::General, "Check aggro for %s target %s.", GetName(), mob->GetName()); - #endif + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); + return( mod_will_aggro(mob, this) ); } } From 4851fe1791bdbfee442b6781830d63b3a3a71a02 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:07:19 -0600 Subject: [PATCH 099/707] Converted more Aggro Debugs --- zone/aggro.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 437713062..295d5c495 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,19 +342,18 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); - + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); return( mod_will_aggro(mob, this) ); } } -#if EQDEBUG >= 6 - printf("Is In zone?:%d\n", mob->InZone()); - printf("Dist^2: %f\n", dist2); - printf("Range^2: %f\n", iAggroRange2); - printf("Faction: %d\n", fv); - printf("Int: %d\n", GetINT()); - printf("Con: %d\n", GetLevelCon(mob->GetLevel())); -#endif + + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); + return(false); } From edd871353d9242a9cbd51ed68ad3b3076dde54fc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:08:04 -0600 Subject: [PATCH 100/707] Removed attack.cpp #EQDEBUG --- zone/attack.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 70ac972eb..73262fc72 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -16,10 +16,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#if EQDEBUG >= 5 -//#define ATTACK_DEBUG 20 -#endif - #include "../common/debug.h" #include "../common/eq_constants.h" #include "../common/eq_packet_structs.h" From 1e741c1b9291d778d98ba1ff342b6c3fbad4b58b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:09:13 -0600 Subject: [PATCH 101/707] Add 'Attack' Category --- common/eqemu_logsys.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 6dec2b6ff..4be510767 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -73,6 +73,7 @@ public: TCP_Connection, Client_Server_Packet, Aggro, + Attack, MaxCategoryID /* Don't Remove this*/ }; @@ -136,6 +137,7 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "TCP_Connection", "Client_Server_Packet", "Aggro", + "Attack", }; #endif \ No newline at end of file From 488e94df56fa7997239032eaeda3722f49845d44 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:10:10 -0600 Subject: [PATCH 102/707] Removed #EQDEBUG Mob::AttackAnimation --- zone/attack.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 73262fc72..ecb6b1746 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -56,9 +56,9 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w int type = 0; if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); -#if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General, "Weapon skill:%i", item->ItemType); -#endif + + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); + switch (item->ItemType) { case ItemType1HSlash: // 1H Slashing From f957d27fa5d088890aea936dcc5dd5f918604bff Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:11:28 -0600 Subject: [PATCH 103/707] Removed #EQDEBUG Mob::CheckHitChance and converted debug --- zone/attack.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index ecb6b1746..1101375ea 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -329,9 +329,9 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //I dont know the best way to handle a garunteed hit discipline being used //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - #if EQDEBUG>=11 - logger.LogDebug(EQEmuLogSys::General, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); - #endif + + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + // // Did we hit? From c10f5b2cbc5807e303973ea22b5864f1ee871993 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:12:19 -0600 Subject: [PATCH 104/707] Removed #ATTACK_DEBUG Mob::CheckHitChance and converted debug --- zone/attack.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 1101375ea..eacee46fe 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -187,9 +187,8 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC() && !attacker->IsPet()) chancetohit += RuleR(Combat, NPCBonusHitChance); -#if ATTACK_DEBUG>=11 - logger.LogDebug(EQEmuLogSys::General, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); -#endif + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + mlog(COMBAT__TOHIT,"CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); bool pvpmode = false; From 2828d513084835c6a44895cd3f7945c9dcb4baa3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:16:07 -0600 Subject: [PATCH 105/707] Converted mlogs in Mob::CheckHitChance to new logs --- zone/attack.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index eacee46fe..e7f4f08f8 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -189,8 +189,6 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); - mlog(COMBAT__TOHIT,"CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); - bool pvpmode = false; if(IsClient() && other->IsClient()) pvpmode = true; @@ -210,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate the level difference - mlog(COMBAT__TOHIT, "Chance to hit before level diff calc %.2f", chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); double level_difference = attacker_level - defender_level; double range = defender->GetLevel(); @@ -238,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference); } - mlog(COMBAT__TOHIT, "Chance to hit after level diff calc %.2f", chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor)); - mlog(COMBAT__TOHIT, "Chance to hit after agil calc %.2f", chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); if(attacker->IsClient()) { chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse))); - mlog(COMBAT__TOHIT, "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); } if(defender->IsClient()) { chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))); - mlog(COMBAT__TOHIT, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); } //I dont think this is 100% correct, but at least it does something... if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->spellbonuses.MeleeSkillCheck; - mlog(COMBAT__TOHIT, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->itembonuses.MeleeSkillCheck; - mlog(COMBAT__TOHIT, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } //Avoidance Bonuses on defender decreases baseline hit chance by percent. @@ -310,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate final chance to hit chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f); - mlog(COMBAT__TOHIT, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker); @@ -338,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c float tohit_roll = zone->random.Real(0, 100); - mlog(COMBAT__TOHIT, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); return(tohit_roll <= chancetohit); } From 59f90aede9987381d4b1337db467b594580f9e1f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:18:30 -0600 Subject: [PATCH 106/707] Another convert --- zone/attack.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index e7f4f08f8..35b410412 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -2028,9 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if (IsEngaged()) { zone->DelAggroMob(); -#if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General,"NPC::Death() Mobs currently Aggro %i", zone->MobsAggroCount()); -#endif + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); } SetHP(0); SetPet(0); From 00bab967173ac5554f8ae9940305b0607c6c475a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:25:04 -0600 Subject: [PATCH 107/707] Convert Bot::CalcBotFocusEffect Debug to new --- zone/bonuses.cpp | 6 +----- zone/bot.cpp | 4 +--- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 48102b120..a1db65930 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -538,11 +538,7 @@ void Client::AddItemBonuses(const ItemInst *inst, StatBonuses* newbon, bool isAu } void Client::CalcEdibleBonuses(StatBonuses* newbon) { -//#if EQDEBUG >= 11 -// std::cout<<"Client::CalcEdibleBonuses(StatBonuses* newbon)"<= 6 //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); -#endif + logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); } } //Check for spell skill limits. From 168e6ec80d303887437d8f8f765aa2edc7e8287a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:26:19 -0600 Subject: [PATCH 108/707] Convert Client::SendAllPackets to new debug log --- zone/client.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index b05ae924c..ed832a208 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -650,9 +650,7 @@ bool Client::SendAllPackets() { if(eqs) eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); -#if EQDEBUG >= 6 - logger.Log(EQEmuLogSys::Normal, "Transmitting a packet"); -#endif + logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); } return true; } From 7c8e5645f0ce9a92ffabeb26552ec9b6807b2863 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:43:24 -0600 Subject: [PATCH 109/707] Remove command_log --- zone/command.cpp | 54 ------------------------------------------------ zone/command.h | 1 - 2 files changed, 55 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index f79e7e385..abd2dda9d 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -164,7 +164,6 @@ int command_init(void) { command_add("getvariable","[varname] - Get the value of a variable from the database",200,command_getvariable) || command_add("chat","[channel num] [message] - Send a channel message to all zones",200,command_chat) || command_add("npcloot","[show/money/add/remove] [itemid/all/money: pp gp sp cp] - Manipulate the loot an NPC is carrying",80,command_npcloot) || - command_add("log","- Search character event log",80,command_log) || command_add("gm","- Turn player target's or your GM flag on or off",80,command_gm) || command_add("summon","[charname] - Summons your player/npc/corpse target, or charname if specified",80,command_summon) || command_add("zone","[zonename] [x] [y] [z] - Go to specified zone (coords optional)",50,command_zone) || @@ -969,59 +968,6 @@ void command_npcloot(Client *c, const Seperator *sep) c->Message(0, "Usage: #npcloot [show/money/add/remove] [itemid/all/money: pp gp sp cp]"); } -void command_log(Client *c, const Seperator *sep) -{ - if(strlen(sep->arg[4]) == 0 || strlen(sep->arg[1]) == 0 || strlen(sep->arg[2]) == 0 || (strlen(sep->arg[3]) == 0 && atoi(sep->arg[3]) == 0)) - { - c->Message(0,"#log
"); - c->Message(0,"(Req.) Types: 1) Command, 2) Merchant Buying, 3) Merchant Selling, 4) Loot, 5) Money Loot 6) Trade"); - c->Message(0,"(Req.) byaccountid/bycharname: choose either byaccountid or bycharname and then set querytype to effect it"); - c->Message(0,"(Req.) Details are information about the event, for example, partially an items name, or item id."); - c->Message(0,"Timestamp allows you to set a date to when the event occured: YYYYMMDDHHMMSS (Year,Month,Day,Hour,Minute,Second). It can be a partial timestamp."); - c->Message(0,"Note: when specifying a target, spaces in EQEMu use '_'"); - return; - // help - } - CharacterEventLog_Struct* cel = new CharacterEventLog_Struct; - memset(cel,0,sizeof(CharacterEventLog_Struct)); - if(strcasecmp(sep->arg[2], "byaccountid") == 0) - database.GetEventLogs("",sep->arg[5],atoi(sep->arg[3]),atoi(sep->arg[1]),sep->arg[4],sep->arg[6],cel); - else if(strcasecmp(sep->arg[2], "bycharname") == 0) - database.GetEventLogs(sep->arg[3],sep->arg[5],0,atoi(sep->arg[1]),sep->arg[4],sep->arg[6],cel); - else - { - c->Message(0,"Incorrect query type, use either byaccountid or bycharname"); - safe_delete(cel); - return; - } - if(cel->count != 0) - { - uint32 count = 0; - bool cont = true; - while(cont) - { - if(count >= cel->count) - cont = false; - else if(cel->eld[count].id != 0) - { - c->Message(0,"ID: %i AccountName: %s AccountID: %i Status: %i CharacterName: %s TargetName: %s",cel->eld[count].id,cel->eld[count].accountname,cel->eld[count].account_id,cel->eld[count].status,cel->eld[count].charactername,cel->eld[count].targetname); - - c->Message(0,"LogType: %s Timestamp: %s LogDetails: %s",cel->eld[count].descriptiontype,cel->eld[count].timestamp,cel->eld[count].details); - } - else - cont = false; - count++; - if(count > 20) - { - c->Message(0,"Please refine search."); - cont = false; - } - } - } - c->Message(0,"End of Query"); - safe_delete(cel); -} - void command_gm(Client *c, const Seperator *sep) { bool state=atobool(sep->arg[1]); diff --git a/zone/command.h b/zone/command.h index 088c83510..d487a2105 100644 --- a/zone/command.h +++ b/zone/command.h @@ -87,7 +87,6 @@ void command_chat(Client *c, const Seperator *sep); void command_showpetspell(Client *c, const Seperator *sep); void command_ipc(Client *c, const Seperator *sep); void command_npcloot(Client *c, const Seperator *sep); -void command_log(Client *c, const Seperator *sep); void command_gm(Client *c, const Seperator *sep); void command_summon(Client *c, const Seperator *sep); void command_zone(Client *c, const Seperator *sep); From 82407ba86d3a693b76ab731cd385e0ca9afa791d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:44:30 -0600 Subject: [PATCH 110/707] Remove command_nologs --- zone/command.cpp | 32 -------------------------------- zone/command.h | 1 - 2 files changed, 33 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index abd2dda9d..e153c20a4 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -348,7 +348,6 @@ int command_init(void) { command_add("opcode","- opcode management",250,command_opcode) || command_add("logs","[status|normal|error|debug|quest|all] - Subscribe to a log type",250,command_logs) || - command_add("nologs","[status|normal|error|debug|quest|all] - Unsubscribe to a log type",250,command_nologs) || command_add("ban","[name] [reason]- Ban by character name",150,command_ban) || command_add("suspend","[name] [days] [reason] - Suspend by character name and for specificed number of days",150,command_suspend) || command_add("ipban","[IP address] - Ban IP by character name",200,command_ipban) || @@ -6779,37 +6778,6 @@ void command_logs(Client *c, const Seperator *sep) #endif } -void command_nologs(Client *c, const Seperator *sep) -{ -#ifdef CLIENT_LOGS - Client *t = c; - if(c->GetTarget() && c->GetTarget()->IsClient()) { - t = c; - } - - if(!strcasecmp(sep->arg[1], "status" ) ) - client_logs.unsubscribe(EQEmuLog::Status, t); - else if(!strcasecmp(sep->arg[1], "normal" ) ) - client_logs.unsubscribe(EQEmuLog::Normal, t); - else if(!strcasecmp(sep->arg[1], "error" ) ) - client_logs.unsubscribe(EQEmuLog::Error, t); - else if(!strcasecmp(sep->arg[1], "debug" ) ) - client_logs.unsubscribe(EQEmuLog::Debug, t); - else if(!strcasecmp(sep->arg[1], "quest" ) ) - client_logs.unsubscribe(EQEmuLog::Quest, t); - else if(!strcasecmp(sep->arg[1], "all" ) ) - client_logs.unsubscribeAll(t); - else { - c->Message(0, "Usage: #logs [status|normal|error|debug|quest|all]"); - return; - } - - c->Message(0, "You have been unsubscribed from %s logs.", sep->arg[1]); -#else - c->Message(0, "Client logs are disabled in this server's build."); -#endif -} - void command_qglobal(Client *c, const Seperator *sep) { //In-game switch for qglobal column if(sep->arg[1][0] == 0) { diff --git a/zone/command.h b/zone/command.h index d487a2105..dd7968fd0 100644 --- a/zone/command.h +++ b/zone/command.h @@ -259,7 +259,6 @@ void command_undyeme(Client *c, const Seperator *sep); void command_hp(Client *c, const Seperator *sep); void command_ginfo(Client *c, const Seperator *sep); void command_logs(Client *c, const Seperator *sep); -void command_nologs(Client *c, const Seperator *sep); void command_logsql(Client *c, const Seperator *sep); void command_qglobal(Client *c, const Seperator *sep); void command_path(Client *c, const Seperator *sep); From 7173fc5db357b8daa63c193f09150a41b9ad0130 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:45:18 -0600 Subject: [PATCH 111/707] Remove command_logs --- zone/command.cpp | 33 --------------------------------- zone/command.h | 1 - 2 files changed, 34 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index e153c20a4..12f79a2a6 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -347,7 +347,6 @@ int command_init(void) { #endif command_add("opcode","- opcode management",250,command_opcode) || - command_add("logs","[status|normal|error|debug|quest|all] - Subscribe to a log type",250,command_logs) || command_add("ban","[name] [reason]- Ban by character name",150,command_ban) || command_add("suspend","[name] [days] [reason] - Suspend by character name and for specificed number of days",150,command_suspend) || command_add("ipban","[IP address] - Ban IP by character name",200,command_ipban) || @@ -6746,38 +6745,6 @@ void command_logsql(Client *c, const Seperator *sep) { } } -void command_logs(Client *c, const Seperator *sep) -{ -#ifdef CLIENT_LOGS - Client *t = c; - if(c->GetTarget() && c->GetTarget()->IsClient()) { - t = c->GetTarget()->CastToClient(); - } - - if(!strcasecmp(sep->arg[1], "status" ) ) - client_logs.subscribe(EQEmuLog::Status, t); - else if(!strcasecmp(sep->arg[1], "normal" ) ) - client_logs.subscribe(EQEmuLog::Normal, t); - else if(!strcasecmp(sep->arg[1], "error" ) ) - client_logs.subscribe(EQEmuLog::Error, t); - else if(!strcasecmp(sep->arg[1], "debug" ) ) - client_logs.subscribe(EQEmuLog::Debug, t); - else if(!strcasecmp(sep->arg[1], "quest" ) ) - client_logs.subscribe(EQEmuLog::Quest, t); - else if(!strcasecmp(sep->arg[1], "all" ) ) - client_logs.subscribeAll(t); - else { - c->Message(0, "Usage: #logs [status|normal|error|debug|quest|all]"); - return; - } - if(c != t) - c->Message(0, "%s have been subscribed to %s logs.", t->GetName(), sep->arg[1]); - t->Message(0, "You have been subscribed to %s logs.", sep->arg[1]); -#else - c->Message(0, "Client logs are disabled in this server's build."); -#endif -} - void command_qglobal(Client *c, const Seperator *sep) { //In-game switch for qglobal column if(sep->arg[1][0] == 0) { diff --git a/zone/command.h b/zone/command.h index dd7968fd0..c3825a66a 100644 --- a/zone/command.h +++ b/zone/command.h @@ -258,7 +258,6 @@ void command_undye(Client *c, const Seperator *sep); void command_undyeme(Client *c, const Seperator *sep); void command_hp(Client *c, const Seperator *sep); void command_ginfo(Client *c, const Seperator *sep); -void command_logs(Client *c, const Seperator *sep); void command_logsql(Client *c, const Seperator *sep); void command_qglobal(Client *c, const Seperator *sep); void command_path(Client *c, const Seperator *sep); From d9626e392edd0f224bca0c5e79300e78497c42ba Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:49:23 -0600 Subject: [PATCH 112/707] Rip out Client Log Callbacks from zone --- zone/net.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index 64c741ffc..11f5a6038 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -317,12 +317,6 @@ int main(int argc, char** argv) { logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); parse->ReloadQuests(); - -#ifdef CLIENT_LOGS - LogFile->SetAllCallbacks(ClientLogs::EQEmuIO_buf); - LogFile->SetAllCallbacks(ClientLogs::EQEmuIO_fmt); - LogFile->SetAllCallbacks(ClientLogs::EQEmuIO_pva); -#endif if (!worldserver.Connect()) { logger.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } From a1df2b8f641932813e796f723f1fb89f80e14a92 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:51:29 -0600 Subject: [PATCH 113/707] Rip out Client Log functions that were used in Callbacks --- zone/client_logs.cpp | 31 ------------------------------- zone/client_logs.h | 3 --- 2 files changed, 34 deletions(-) diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index 15079df60..16f90c1c1 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -105,37 +105,6 @@ void ClientLogs::msg(EQEmuLog::LogIDs id, const char *buf) { } } -void ClientLogs::EQEmuIO_buf(EQEmuLog::LogIDs id, const char *buf, uint8 size, uint32 count) { - if(size != 1) - return; //cannot print multibyte data - if(buf[0] == '\n' || buf[0] == '\r') - return; //skip new lines... - if(count > MAX_CLIENT_LOG_MESSAGE_LENGTH) - count = MAX_CLIENT_LOG_MESSAGE_LENGTH; - memcpy(_buffer, buf, count); - _buffer[count] = '\0'; - client_logs.msg(id, _buffer); -} - -void ClientLogs::EQEmuIO_fmt(EQEmuLog::LogIDs id, const char *fmt, va_list ap) { - if(fmt[0] == '\n' || fmt[0] == '\r') - return; //skip new lines... - vsnprintf(_buffer, MAX_CLIENT_LOG_MESSAGE_LENGTH, fmt, ap); - _buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH] = '\0'; - client_logs.msg(id, _buffer); -} - -void ClientLogs::EQEmuIO_pva(EQEmuLog::LogIDs id, const char *prefix, const char *fmt, va_list ap) { - if(fmt[0] == '\n' || fmt[0] == '\r') - return; //skip new lines... - char *buf = _buffer; - int plen = snprintf(buf, MAX_CLIENT_LOG_MESSAGE_LENGTH, "%s", prefix); - buf += plen; - vsnprintf(buf, MAX_CLIENT_LOG_MESSAGE_LENGTH-plen, fmt, ap); - _buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH] = '\0'; - client_logs.msg(id, _buffer); -} - static uint32 gmsay_log_message_colors[EQEmuLogSys::MaxLogID] = { 15, // "Status", - Yellow 15, // "Normal", - Yellow diff --git a/zone/client_logs.h b/zone/client_logs.h index 547c49641..86802f391 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -35,9 +35,6 @@ class Client; class ClientLogs { public: - static void EQEmuIO_buf(EQEmuLog::LogIDs id, const char *buf, uint8 size, uint32 count); - static void EQEmuIO_fmt(EQEmuLog::LogIDs id, const char *fmt, va_list ap); - static void EQEmuIO_pva(EQEmuLog::LogIDs id, const char *prefix, const char *fmt, va_list ap); void subscribe(EQEmuLog::LogIDs id, Client *c); void unsubscribe(EQEmuLog::LogIDs id, Client *c); From 78e08e532717c96dac7d224d8403e941854b66b1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 02:56:39 -0600 Subject: [PATCH 114/707] Move GMSayHookCallBackProcess out of client logs and into Zone Class --- zone/client_logs.cpp | 12 ------------ zone/client_logs.h | 1 - zone/net.cpp | 2 +- zone/zone.h | 12 ++++++++++++ 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index 16f90c1c1..de6278dcd 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -105,19 +105,7 @@ void ClientLogs::msg(EQEmuLog::LogIDs id, const char *buf) { } } -static uint32 gmsay_log_message_colors[EQEmuLogSys::MaxLogID] = { - 15, // "Status", - Yellow - 15, // "Normal", - Yellow - 3, // "Error", - Red - 14, // "Debug", - Light Green - 4, // "Quest", - 5, // "Command", - 3 // "Crash" -}; -void ClientLogs::ClientMessage(uint16 log_type, std::string& message){ - entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_type], "%s", message.c_str()); -} #endif //CLIENT_LOGS diff --git a/zone/client_logs.h b/zone/client_logs.h index 86802f391..aacefdba9 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -43,7 +43,6 @@ public: void clear(); //unsubscribes everybody void msg(EQEmuLog::LogIDs id, const char *buf); - static void ClientMessage(uint16 log_type, std::string& message); protected: diff --git a/zone/net.cpp b/zone/net.cpp index 11f5a6038..d343d14b6 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -175,7 +175,7 @@ int main(int argc, char** argv) { /* Register Log System and Settings */ logger.LoadLogSettingsDefaults(); - logger.OnLogHookCallBackZone(&ClientLogs::ClientMessage); + logger.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); database.LoadLogSysSettings(logger.log_settings); guild_mgr.SetDatabase(&database); diff --git a/zone/zone.h b/zone/zone.h index bbf273069..38c3d4a05 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -67,6 +67,16 @@ struct item_tick_struct { std::string qglobal; }; +static uint32 gmsay_log_message_colors[EQEmuLogSys::MaxLogID] = { + 15, // "Status", - Yellow + 15, // "Normal", - Yellow + 3, // "Error", - Red + 14, // "Debug", - Light Green + 4, // "Quest", + 5, // "Command", + 3 // "Crash" +}; + class Client; class Map; class Mob; @@ -261,6 +271,8 @@ public: // random object that provides random values for the zone EQEmu::Random random; + void GMSayHookCallBackProcess(uint16 log_type, std::string& message){ entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_type], "%s", message.c_str()); } + //MODDING HOOKS void mod_init(); void mod_repop(); From d1d26437e50786df584e9be6d884a6bc7f5e08aa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 03:00:49 -0600 Subject: [PATCH 115/707] Cleaning up Zone net.cpp --- zone/net.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/zone/net.cpp b/zone/net.cpp index d343d14b6..771a6ea38 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -178,8 +178,8 @@ int main(int argc, char** argv) { logger.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); database.LoadLogSysSettings(logger.log_settings); + /* Guilds */ guild_mgr.SetDatabase(&database); - GuildBanks = nullptr; logger.LogDebug(EQEmuLogSys::General, "Test, Debug Log Level 0"); @@ -220,10 +220,13 @@ int main(int argc, char** argv) { logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); database.LoadVariables(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); database.LoadZoneNames(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { logger.Log(EQEmuLogSys::Error, "Loading items FAILED!"); @@ -262,16 +265,22 @@ int main(int argc, char** argv) { logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); database.LoadFactionData(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); title_manager.LoadTitles(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); database.LoadTributes(); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); + logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) From 5a3b40c503ab8b644a9c665283f4b3304154c6c2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 03:02:30 -0600 Subject: [PATCH 116/707] Remove my test code in net.cpp --- zone/net.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index 771a6ea38..2e8d77942 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -182,12 +182,6 @@ int main(int argc, char** argv) { guild_mgr.SetDatabase(&database); GuildBanks = nullptr; - logger.LogDebug(EQEmuLogSys::General, "Test, Debug Log Level 0"); - logger.LogDebug(EQEmuLogSys::Moderate, "Test, Debug Log Level 1"); - logger.LogDebug(EQEmuLogSys::Detail, "Test, Debug Log Level 2"); - - logger.LogDebug(EQEmuLogSys::General, "This is a crazy test message, database is '%s' and port is %u", Config->DatabaseDB.c_str(), Config->DatabasePort); - #ifdef _EQDEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif From 132fbbb0c6a8606a0d1830a91f199ef931bfc7ed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 03:09:02 -0600 Subject: [PATCH 117/707] Rename LogDebugType to DebugCategory --- common/eq_stream.cpp | 242 +++++++++++++++++------------------ common/eq_stream_ident.cpp | 20 +-- common/eqemu_logsys.cpp | 2 +- common/eqemu_logsys.h | 2 +- common/guild_base.cpp | 130 +++++++++---------- common/patches/rof.cpp | 34 ++--- common/patches/rof2.cpp | 34 ++--- common/patches/sod.cpp | 22 ++-- common/patches/sof.cpp | 22 ++-- common/patches/titanium.cpp | 22 ++-- common/patches/underfoot.cpp | 22 ++-- common/rulesys.cpp | 28 ++-- common/shareddb.cpp | 8 +- common/spdat.cpp | 2 +- common/struct_strategy.cpp | 4 +- common/tcp_connection.cpp | 4 +- common/worldconn.cpp | 4 +- eqlaunch/eqlaunch.cpp | 18 +-- eqlaunch/worldserver.cpp | 18 +-- eqlaunch/zone_launch.cpp | 46 +++---- queryserv/database.cpp | 56 ++++---- queryserv/lfguild.cpp | 14 +- queryserv/queryserv.cpp | 16 +-- queryserv/worldserver.cpp | 6 +- ucs/chatchannel.cpp | 32 ++--- ucs/clientlist.cpp | 78 +++++------ ucs/database.cpp | 86 ++++++------- ucs/ucs.cpp | 26 ++-- ucs/worldserver.cpp | 8 +- world/client.cpp | 48 +++---- world/cliententry.cpp | 2 +- world/clientlist.cpp | 12 +- world/console.cpp | 24 ++-- world/eqw.cpp | 2 +- world/eqw_http_handler.cpp | 14 +- world/eqw_parser.cpp | 6 +- world/launcher_link.cpp | 24 ++-- world/launcher_list.cpp | 10 +- world/login_server.cpp | 32 ++--- world/login_server_list.cpp | 2 +- world/net.cpp | 116 ++++++++--------- world/queryserv.cpp | 12 +- world/ucs.cpp | 12 +- world/wguild_mgr.cpp | 26 ++-- world/zonelist.cpp | 8 +- world/zoneserver.cpp | 8 +- zone/aggro.cpp | 14 +- zone/attack.cpp | 26 ++-- zone/bonuses.cpp | 6 +- zone/bot.cpp | 4 +- zone/client.cpp | 16 +-- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 44 +++---- zone/client_process.cpp | 12 +- zone/command.cpp | 14 +- zone/doors.cpp | 6 +- zone/entity.cpp | 2 +- zone/groups.cpp | 4 +- zone/guild_mgr.cpp | 20 +-- zone/inventory.cpp | 24 ++-- zone/net.cpp | 72 +++++------ zone/questmgr.cpp | 2 +- zone/raids.cpp | 4 +- zone/spawn2.cpp | 130 +++++++++---------- zone/spells.cpp | 2 +- zone/tasks.cpp | 184 +++++++++++++------------- zone/tradeskills.cpp | 16 +-- zone/trading.cpp | 56 ++++---- zone/worldserver.cpp | 34 ++--- zone/zonedb.cpp | 20 +-- 70 files changed, 1039 insertions(+), 1039 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 38f2c0cdd..eb95d557f 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) { OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; @@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { EQRawApplicationPacket *ap=nullptr; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; @@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processed < p->size) { subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processedsize) { EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); processed+=subpacket_length+1; } else { subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length); processed+=subpacket_length+3; } @@ -178,29 +178,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Packet: { if(!p->pBuffer || (p->Size() < 4)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); delete qp; } @@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // Check for an embedded OP_AppCombinded (protocol level 0x19) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -228,29 +228,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Fragment: { if(!p->pBuffer || (p->Size() < 4)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); delete qp; } SetNextAckToSend(seq); @@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (oversize_buffer) { memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2); oversize_offset+=p->size-2; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); if (oversize_offset==oversize_length) { if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); //_raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; } else { EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); if (ap) { ap->copyInfo(p); InboundQueuePush(ap); @@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) oversize_buffer=new unsigned char[oversize_length]; memcpy(oversize_buffer,p->pBuffer+6,p->size-6); oversize_offset=p->size-6; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); } } } @@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_KeepAlive: { #ifndef COLLECTOR NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); #endif } break; case OP_Ack: { if(!p->pBuffer || (p->Size() < 4)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionRequest: { if(p->Size() < sizeof(SessionRequest)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); break; } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case // streamactive means we identified the opcode for the stream, we cannot re-establish this connection @@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); SetMaxLen(ntohl(Request->MaxLength)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); SetState(ESTABLISHED); #ifndef COLLECTOR Key=0x11223344; @@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionResponse: { if(p->Size() < sizeof(SessionResponse)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); break; } @@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) compressed=(Response->Format&FLAG_COMPRESSED); encoded=(Response->Format&FLAG_ENCODED); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); // Kinda kludgy, but trie for now if (StreamType==UnknownStream) { @@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) EQStreamState state = GetState(); if(state == ESTABLISHED) { //client initiated disconnect? - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); _SendDisconnect(); SetState(CLOSED); } else if(state == CLOSING) { //we were waiting for this anyways, ignore pending messages, send the reply and be closed. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); _SendDisconnect(); SetState(CLOSED); } else { //we are expecting this (or have already gotten it, but dont care either way) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); SetState(CLOSED); } } @@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_OutOfOrderAck: { if(!p->pBuffer || (p->Size() < 4)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } //if the packet they got out of order is between our last acked packet and the last sent packet, then its valid. if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, seq, SequencedBase, SequencedBase+NextSequencedSend); bool retransmit_acked_packets = false; @@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if(!retransmit_acked_packets) { uint16 sqsize = SequencedQueue.size(); uint16 index = seq - SequencedBase; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); if (index < sqsize) { std::deque::iterator sitr; sitr = SequencedQueue.begin(); @@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) NextSequencedSend = 0; } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionStatRequest: { if(p->Size() < sizeof(SessionStats)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); break; } #ifndef COLLECTOR SessionStats *Stats=(SessionStats *)p->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, (unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta), (unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta), (unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta)); @@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX) retransmittimeout = RETRANSMIT_TIMEOUT_MAX; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); } } #endif } break; case OP_SessionStatResponse: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); } break; case OP_OutOfSession: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); } break; default: @@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) return; if(OpMgr == nullptr || *OpMgr == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; } @@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) // Convert the EQApplicationPacket to 1 or more EQProtocolPackets if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); @@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); SequencedPush(out); @@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) out->size=chunksize+2; SequencedPush(out); used+=chunksize; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); } delete p; delete[] tmpbuff; @@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p) #else MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); *(uint16 *)(p->pBuffer)=htons(NextOutSeq); SequencedQueue.push_back(p); NextOutSeq++; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) delete p; #else MOutboundQueue.lock(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); NonSequencedQueue.push(p); MOutboundQueue.unlock(); #endif @@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) void EQStream::SendAck(uint16 seq) { uint16 Seq=htons(seq); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); SetLastAckSent(seq); NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16))); } void EQStream::SendOutOfOrderAck(uint16 seq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); uint16 Seq=htons(seq); NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16))); } @@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd) // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " "buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend); NextSequencedSend = 0; retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet @@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // And remove it form the queue p = NonSequencedQueue.front(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); NonSequencedQueue.pop(); } else if (!p->combine(NonSequencedQueue.front())) { // Tryint to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked, so just remove this packet and it's spot in the queue - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); delete NonSequencedQueue.front(); NonSequencedQueue.pop(); } @@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd) if (sitr!=SequencedQueue.end()) { if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging... if(SequencedQueue.empty()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); SeqEmpty=true; continue; } if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) { if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); sitr++; NextSequencedSend++; } else if (!p) { // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } @@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } else { // No more sequenced packets @@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd) // We have a packet still, must have run out of both seq and non-seq, so send it if (p) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); ReadyToSend.push(p); BytesWritten+=p->size; } @@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd) if(SeqEmpty && NonSeqEmpty) { //no more data to send if(CheckState(CLOSING)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); //we are waiting for the queues to empty, now we can do our disconnect. //this packet will not actually go out until the next call to Write(). _SendDisconnect(); @@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses out->size=sizeof(SessionResponse); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no"); NonSequencedPush(out); @@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); NonSequencedPush(out); } @@ -932,7 +932,7 @@ void EQStream::_SendDisconnect() *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); } void EQStream::InboundQueuePush(EQRawApplicationPacket *p) @@ -959,7 +959,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if (emu_op == OP_Unknown) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -986,7 +986,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if(emu_op == OP_Unknown) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -1014,7 +1014,7 @@ void EQStream::InboundQueueClear() { EQApplicationPacket *p=nullptr; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); MInboundQueue.lock(); if (!InboundQueue.empty()) { @@ -1057,7 +1057,7 @@ void EQStream::OutboundQueueClear() { EQProtocolPacket *p=nullptr; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); MOutboundQueue.lock(); while(!NonSequencedQueue.empty()) { @@ -1079,7 +1079,7 @@ void EQStream::PacketQueueClear() { EQProtocolPacket *p=nullptr; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); if(!PacketQueue.empty()) { std::map::iterator itr; @@ -1111,7 +1111,7 @@ uint32 newlength=0; delete p; ProcessQueue(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); _hex(NET__NET_CREATE_HEX, buffer, length); } } @@ -1141,33 +1141,33 @@ std::deque::iterator itr, tmp; MOutboundQueue.lock(); //do a bit of sanity checking. if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } SeqOrder ord = CompareSequence(SequencedBase, seq); if(ord == SeqInOrder) { //they are not acking anything new... - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); } else if(ord == SeqPast) { //they are nacking blocks going back before our buffer, wtf? - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); //this is a good ack, we get to ack some blocks. seq++; //we stop at the block right after their ack, counting on the wrap of both numbers. while(SequencedBase != seq) { if(SequencedQueue.empty()) { -logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); +logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); SequencedBase = NextOutSeq; NextSequencedSend = 0; break; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); //clean out the acked packet delete SequencedQueue.front(); SequencedQueue.pop_front(); @@ -1178,10 +1178,10 @@ logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKET SequencedBase++; } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } @@ -1191,7 +1191,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::SetNextAckToSend(uint32 seq) { MAcks.lock(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); NextAckToSend=seq; MAcks.unlock(); } @@ -1199,7 +1199,7 @@ void EQStream::SetNextAckToSend(uint32 seq) void EQStream::SetLastAckSent(uint32 seq) { MAcks.lock(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); LastAckSent=seq; MAcks.unlock(); } @@ -1212,10 +1212,10 @@ void EQStream::ProcessQueue() EQProtocolPacket *qp=nullptr; while((qp=RemoveQueue(NextInSeq))!=nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } } @@ -1226,21 +1226,21 @@ EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } return qp; } void EQStream::SetStreamType(EQStreamType type) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); StreamType=type; switch (StreamType) { case LoginStream: app_opcode_size=1; compressed=false; encoded=false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); break; case ChatOrMailStream: case ChatStream: @@ -1248,7 +1248,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=1; compressed=false; encoded=true; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); break; case ZoneStream: case WorldStream: @@ -1256,7 +1256,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=2; compressed=true; encoded=false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); break; } } @@ -1306,7 +1306,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq) void EQStream::SetState(EQStreamState state) { MState.lock(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); State=state; MState.unlock(); } @@ -1318,29 +1318,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { EQStreamState orig_state = GetState(); if (orig_state == CLOSING && !outgoing_data) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); _SendDisconnect(); SetState(DISCONNECTING); } else if (LastPacket && (now-LastPacket) > timeout) { switch(orig_state) { case CLOSING: //if we time out in the closing state, they are not acking us, just give up - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); _SendDisconnect(); SetState(CLOSED); break; case DISCONNECTING: //we timed out waiting for them to send us the disconnect reply, just give up. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); SetState(CLOSED); break; case CLOSED: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); break; case ESTABLISHED: //we timed out during normal operation. Try to be nice about it. //we will almost certainly time out again waiting for the disconnect reply, but oh well. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); _SendDisconnect(); SetState(DISCONNECTING); break; @@ -1369,11 +1369,11 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, AVERAGE_DELTA_MAX); } } else { @@ -1381,7 +1381,7 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } @@ -1391,12 +1391,12 @@ void EQStream::AdjustRates(uint32 average_delta) void EQStream::Close() { if(HasOutgoingData()) { //there is pending data, wait for it to go out. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); SetState(CLOSING); } else { //otherwise, we are done, we can drop immediately. _SendDisconnect(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); SetState(DISCONNECTING); } } @@ -1424,19 +1424,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. if(p->size == sig->first_length) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else if(sig->first_length == 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else { //opcode matched but length did not. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); res = MatchFailed; } } else { //first opcode did not match.. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); res = MatchFailed; } } diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index 531a297ad..a550bbbd3 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -46,7 +46,7 @@ void EQStreamIdentifier::Process() { //first see if this stream has expired if(r->expire.Check(false)) { //this stream has failed to match any pattern in our timeframe. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); delete r; cur = m_streams.erase(cur); @@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() { } if(r->stream->GetState() != ESTABLISHED) { //the stream closed before it was identified. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); switch(r->stream->GetState()) { case ESTABLISHED: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); break; case CLOSING: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); break; case DISCONNECTING: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); break; case CLOSED: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); break; default: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); break; } r->stream->ReleaseFromUse(); @@ -109,7 +109,7 @@ void EQStreamIdentifier::Process() { case EQStream::MatchSuccessful: { //yay, a match. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further r->stream->SetActive(true); @@ -123,7 +123,7 @@ void EQStreamIdentifier::Process() { } case EQStream::MatchFailed: //do nothing... - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); break; } } @@ -131,7 +131,7 @@ void EQStreamIdentifier::Process() { //if we checked all patches and did not find a match. if(all_ready && !found_one) { //the stream cannot be identified. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 9204f3136..106df197a 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -176,7 +176,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, co #endif } -void EQEmuLogSys::LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...) +void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; va_start(args, message); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 4be510767..2d33e2bfe 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -81,7 +81,7 @@ public: void LoadLogSettingsDefaults(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); - void LogDebugType(DebugLevel debug_level, uint16 log_category, std::string message, ...); + void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); diff --git a/common/guild_base.cpp b/common/guild_base.cpp index b8b6206e9..deb7ea1e0 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); return(false); } @@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); continue; } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); return false; } @@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } @@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); return true; } @@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); return(false); } GuildInfo *info = res->second; @@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); if (!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; @@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); @@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } safe_delete_array(title_esc); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); return true; } uint32 BaseGuildManager::_GetFreeGuildID() { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -343,12 +343,12 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (results.RowCount() == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); return index; } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); return GUILD_NONE; } @@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) { //now store the resulting guild setup into the DB. if(!_StoreGuildDB(new_id)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); return(GUILD_NONE); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); return(new_id); } @@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id); QueryWithLogging(query, "deleting guild bank"); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); return(true); } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); return false; } @@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); safe_delete_array(esc); return false; } safe_delete_array(esc); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); info->name = name; //update our local record. @@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); return false; } @@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(!DBSetGuildRank(leader, GUILD_LEADER)) return false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); info->leader_char_id = leader; //update our local record. @@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; @@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c safe_delete_array(esc); safe_delete_array(esc_set); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); info->motd = motd; //update our local record. info->motd_setter = setter; //update our local record. @@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); info->url = URL; //update our local record. @@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); info->channel = Channel; //update our local record. @@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); return true; } @@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); return true; } @@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } @@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); return true; @@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { if(m_db == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); return false; } @@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); return true; @@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const { bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const { if(guild_id == GUILD_NONE) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); return(false); //invalid guild } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); return(char_id == res->second->leader_char_id); } @@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { if(status >= 250) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); return(true); //250+ as allowed anything } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); return(false); //invalid guild } bool granted = (res->second->minstatus <= status); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied"); return(granted); @@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const { if(rank > GUILD_MAX_RANK) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid rank } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid guild } bool granted = res->second->ranks[rank].permissions[act]; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", res->second->name.c_str(), guild_id, res->second->ranks[rank].name.c_str(), rank, GuildActionNames[act], act, @@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 32ce8f07d..4925ba3d4 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -52,7 +52,7 @@ namespace RoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -316,7 +316,7 @@ namespace RoF if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -551,7 +551,7 @@ namespace RoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -585,7 +585,7 @@ namespace RoF safe_delete_array(Serialized); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1386,7 +1386,7 @@ namespace RoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2556,7 +2556,7 @@ namespace RoF outapp->WriteUInt8(0); // Unknown - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3321,7 +3321,7 @@ namespace RoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3654,7 +3654,7 @@ namespace RoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3902,7 +3902,7 @@ namespace RoF Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); @@ -4498,7 +4498,7 @@ namespace RoF SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5455,7 +5455,7 @@ namespace RoF RoFSlot.MainSlot = TempSlot; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5496,7 +5496,7 @@ namespace RoF RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5601,7 +5601,7 @@ namespace RoF ServerSlot = INVALID_INDEX; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -5636,7 +5636,7 @@ namespace RoF ServerSlot = TempSlot; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 7548dec77..b0cdc9739 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -52,7 +52,7 @@ namespace RoF2 //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF2 - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF2 opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -382,7 +382,7 @@ namespace RoF2 if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -617,7 +617,7 @@ namespace RoF2 if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -651,7 +651,7 @@ namespace RoF2 safe_delete_array(Serialized); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1452,7 +1452,7 @@ namespace RoF2 char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType); if (!serialized) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2640,7 +2640,7 @@ namespace RoF2 // Think we need 1 byte of padding at the end outapp->WriteUInt8(0); // Unknown - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3387,7 +3387,7 @@ namespace RoF2 if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3721,7 +3721,7 @@ namespace RoF2 //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3973,7 +3973,7 @@ namespace RoF2 Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); @@ -4569,7 +4569,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5546,7 +5546,7 @@ namespace RoF2 RoF2Slot.MainSlot = TempSlot; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5587,7 +5587,7 @@ namespace RoF2 RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5696,7 +5696,7 @@ namespace RoF2 ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } @@ -5731,7 +5731,7 @@ namespace RoF2 ServerSlot = TempSlot; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 51992cc68..230316bed 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -50,7 +50,7 @@ namespace SoD //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoD - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoD opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -247,7 +247,7 @@ namespace SoD if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -359,7 +359,7 @@ namespace SoD if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -391,7 +391,7 @@ namespace SoD } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -967,7 +967,7 @@ namespace SoD char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2108,7 +2108,7 @@ namespace SoD if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2363,7 +2363,7 @@ namespace SoD //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3091,7 +3091,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 913e300b5..c84518293 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -50,7 +50,7 @@ namespace SoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoF - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -214,7 +214,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -337,7 +337,7 @@ namespace SoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -371,7 +371,7 @@ namespace SoF } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -766,7 +766,7 @@ namespace SoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1707,7 +1707,7 @@ namespace SoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1887,7 +1887,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -2429,7 +2429,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index b24021f87..e7903e304 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -48,7 +48,7 @@ namespace Titanium //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -74,7 +74,7 @@ namespace Titanium - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -89,10 +89,10 @@ namespace Titanium opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -187,7 +187,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -268,7 +268,7 @@ namespace Titanium int itemcount = in->size / sizeof(InternalSerializedItem_Struct); if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; return; } @@ -285,7 +285,7 @@ namespace Titanium safe_delete_array(serialized); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -635,7 +635,7 @@ namespace Titanium char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1157,7 +1157,7 @@ namespace Titanium if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1274,7 +1274,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -1623,7 +1623,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index f896a4c3f..a12fc66ed 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -50,7 +50,7 @@ namespace Underfoot //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace Underfoot - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace Underfoot opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -307,7 +307,7 @@ namespace Underfoot if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -494,7 +494,7 @@ namespace Underfoot if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -526,7 +526,7 @@ namespace Underfoot safe_delete_array(Serialized); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1190,7 +1190,7 @@ namespace Underfoot char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2374,7 +2374,7 @@ namespace Underfoot if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2624,7 +2624,7 @@ namespace Underfoot //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3406,7 +3406,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = UnderfootToServerSlot(eq->from_slot); emu->to_slot = UnderfootToServerSlot(eq->to_slot); diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 13c9fbf98..683697422 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); return(false); } } @@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas switch(type) { case IntRule: m_RuleIntValues [index] = atoi(rule_value); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); break; case RealRule: m_RuleRealValues[index] = atof(rule_value); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); break; case BoolRule: uint32 val = 0; if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1")) val = 1; m_RuleBoolValues[index] = val; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); break; } @@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas } void RuleManager::ResetRules() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); #define RULE_INT(cat, rule, default_value) \ m_RuleIntValues[ Int__##rule ] = default_value; #define RULE_REAL(cat, rule, default_value) \ @@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & return(true); } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); return(false); } @@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) { m_activeRuleset = _FindOrCreateRuleset(db, ruleset); if(m_activeRuleset == -1) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); return; } m_activeName = ruleset; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } int r; @@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { int rsid = GetRulesetID(db, ruleset); if(rsid < 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); return(false); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); m_activeRuleset = rsid; m_activeName = ruleset; @@ -288,7 +288,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { for(auto row = results.begin(); row != results.end(); ++row) if(!SetRule(row[0], row[1], nullptr, false)) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); return true; } @@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index c9894abc0..5efa08efe 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } diff --git a/common/spdat.cpp b/common/spdat.cpp index 08081c8d8..c6b7b26d9 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -839,7 +839,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 06ab1a5b3..97541d559 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -39,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo EQApplicationPacket *p = *in_p; *in_p = nullptr; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); delete p; } void StructStrategy::ErrorDecoder(EQApplicationPacket *p) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); p->SetOpcode(OP_Unknown); } diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 2cba6fd88..bc9df8389 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/worldconn.cpp b/common/worldconn.cpp index c0aafd19f..72e1c768e 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) { void WorldConnection::OnConnected() { const EQEmuConfig *Config=EQEmuConfig::get(); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16); MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); @@ -76,7 +76,7 @@ bool WorldConnection::Connect() { if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { return true; } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); } return false; } diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 861f536fa..1ef88d381 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -47,13 +47,13 @@ int main(int argc, char *argv[]) { launcher_name = argv[1]; } if(launcher_name.length() < 1) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); return 1; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); if (!EQEmuConfig::LoadConfig()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); return 1; } const EQEmuConfig *Config = EQEmuConfig::get(); @@ -62,16 +62,16 @@ int main(int argc, char *argv[]) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::map zones; WorldServer world(zones, launcher_name.c_str(), Config); if (!world.Connect()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); } std::map::iterator zone, zend; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); // zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1"); @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { void CatchSignal(int sig_num) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); RunLoops = false; } diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index 9346879bc..43170a9ec 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -74,14 +74,14 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; } case ServerOP_LauncherZoneRequest: { if(pack->size != sizeof(LauncherZoneRequest)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); break; } const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer; @@ -90,9 +90,9 @@ void WorldServer::Process() { switch(ZoneRequestCommands(lzr->command)) { case ZR_Start: { if(m_zones.find(lzr->short_name) != m_zones.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config); m_zones[lzr->short_name] = l; } @@ -101,9 +101,9 @@ void WorldServer::Process() { case ZR_Restart: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); res->second->Restart(); } break; @@ -111,9 +111,9 @@ void WorldServer::Process() { case ZR_Stop: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); res->second->Stop(); } break; @@ -127,7 +127,7 @@ void WorldServer::Process() { } default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); break; } } diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index 2da3a6554..532028fc6 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -72,7 +72,7 @@ void ZoneLaunch::Start() { //spec is consumed, even on failure m_ref = ProcLauncher::get()->Launch(spec); if(m_ref == ProcLauncher::ProcError) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); m_timer.Start(m_config->RestartWait); return; } @@ -84,17 +84,17 @@ void ZoneLaunch::Start() { SendStatus(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); } void ZoneLaunch::Restart() { switch(m_state) { case StateRestartPending: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); break; case StateStartPending: //we havent started yet, do nothing - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); break; case StateStarted: //process is running along, kill it off.. @@ -102,20 +102,20 @@ void ZoneLaunch::Restart() { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, true)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateRestartPending; break; case StateStopPending: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); break; case StateStopped: //process is already stopped... nothing to do.. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -124,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) { switch(m_state) { case StateStartPending: //we havent started yet, transition directly to stopped. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); m_state = StateStopped; break; case StateStarted: @@ -134,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, graceful)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateStopPending; break; case StateStopped: //process is already stopped... nothing to do.. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -164,17 +164,17 @@ bool ZoneLaunch::Process() { m_timer.Disable(); //actually start up the program - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); Start(); //now update the shared timer to reflect the proper start interval. if(s_running == 1) { //we are the first zone started. wait that interval. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); s_startTimer.Start(m_config->InitialBootWait); } else { //just some follow on zone, use that interval. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); s_startTimer.Start(m_config->ZoneBootInterval); } @@ -187,7 +187,7 @@ bool ZoneLaunch::Process() { //waiting for notification that our child has died.. if(m_timer.Check()) { //we have timed out, try to kill the child again - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Restart(); } break; @@ -197,12 +197,12 @@ bool ZoneLaunch::Process() { //we have timed out, try to kill the child again m_killFails++; if(m_killFails > 5) { //should get this number from somewhere.. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); m_state = StateStopped; s_running--; SendStatus(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Stop(false); } } @@ -221,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche switch(m_state) { case StateStartPending: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateStarted: //something happened to our happy process... - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateRestartPending: //it finally died, start it on up again - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); m_state = StateStartPending; break; case StateStopPending: //it finally died, transition to close. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); m_state = StateStopped; break; case StateStopped: //we already thought it was stopped... dont care... - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); break; } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 13206857a..244292de4 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, safe_delete_array(escapedMessage); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } @@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->char2_money.silver, QS->char2_money.copper, QS->char2_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->npc_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(members == 0) @@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ lastIndex, QS->Chars[i].char_id); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->char_id, QS->stack_size, QS->char_count, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->char_count, QS->postaction); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->char_money.copper, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { std::string query(queryBuffer); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } safe_delete(pack); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 27cf102de..01ab77312 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -40,7 +40,7 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -242,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -257,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -288,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -305,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -335,7 +335,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } @@ -348,7 +348,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 25b033a24..696224bc0 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -65,16 +65,16 @@ int main() { */ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!database.Connect( @@ -83,22 +83,22 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } /* Initialize Logging */ if (!load_log_settings(Config->LogSettingsFile.c_str())) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index 9a0c2d46d..d55da3be9 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -53,7 +53,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -66,7 +66,7 @@ void WorldServer::Process() ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { case 0: { break; @@ -148,7 +148,7 @@ void WorldServer::Process() break; } default: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); break; } break; diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 3435eeda6..13d37f9ec 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -42,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -149,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) { void ChatChannelList::RemoveChannel(ChatChannel *Channel) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); LinkedListIterator iterator(ChatChannels); @@ -170,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) { void ChatChannelList::RemoveAllChannels() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); LinkedListIterator iterator(ChatChannels); @@ -228,7 +228,7 @@ void ChatChannel::AddClient(Client *c) { if(IsClientInChannel(c)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); return; } @@ -237,7 +237,7 @@ void ChatChannel::AddClient(Client *c) { int AccountStatus = c->GetAccountStatus(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); LinkedListIterator iterator(ClientsInChannel); @@ -262,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) { if(!c) return false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); bool HideMe = c->GetHideMe(); @@ -299,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) { if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0)) return false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000); } @@ -397,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); ChannelClient->SendChannelMessage(Name, Message, Sender); } @@ -479,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client return nullptr; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); ChatChannel *RequiredChannel = FindChannel(NormalisedName); @@ -555,7 +555,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); @@ -572,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) { Invitees.push_back(Invitee); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); } } @@ -587,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) { Invitees.erase(Iterator); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); return; } @@ -613,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) { Moderators.push_back(Moderator); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); } } @@ -628,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) { Moderators.erase(Iterator); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); return; } @@ -654,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) { Voiced.push_back(inVoiced); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); } } @@ -669,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) { Voiced.erase(Iterator); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); return; } diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 48e2b1a94..a95e951e6 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -236,7 +236,7 @@ std::vector ParseRecipients(std::string RecipientString) { static void ProcessMailTo(Client *c, std::string MailMessage) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); std::vector Recipients; @@ -305,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -400,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) { static void ProcessCommandBuddy(Client *c, std::string Buddy) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); c->GeneralChannelMessage("Buddy list modified"); uint8 SubAction = 1; @@ -430,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { static void ProcessCommandIgnore(Client *c, std::string Ignoree) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); c->GeneralChannelMessage("Ignore list modified"); uint8 SubAction = 0; @@ -481,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) { exit(1); if (chatsf->Open()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); exit(1); } @@ -560,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) { if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName()) && (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); struct in_addr in; in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -586,7 +586,7 @@ void Clientlist::Process() { in.s_addr = eqs->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); eqs->SetOpcodeManager(&ChatOpMgr); @@ -606,7 +606,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -646,7 +646,7 @@ void Clientlist::Process() { if(strlen(PacketBuffer) != 9) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -667,11 +667,11 @@ void Clientlist::Process() { else CharacterName = MailBoxString.substr(LastPeriod + 1); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; @@ -703,7 +703,7 @@ void Clientlist::Process() { default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); break; } } @@ -716,7 +716,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()), KeyValid, (*Iterator)->GetForceDisconnect()); @@ -860,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) break; case CommandSetMessageStatus: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); ProcessSetMessageStatus(Parameters); break; @@ -885,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) default: c->SendHelp(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); } } @@ -896,7 +896,7 @@ void Clientlist::CloseAllConnections() { for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); (*Iterator)->CloseConnection(); } @@ -905,7 +905,7 @@ void Clientlist::CloseAllConnections() { void Client::AddCharacter(int CharID, const char *CharacterName, int Level) { if(!CharacterName) return; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); CharacterEntry NewCharacter; NewCharacter.CharID = CharID; NewCharacter.Name = CharacterName; @@ -971,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { for(int i = 0; i < MAX_JOINED_CHANNELS; i++) if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; } } @@ -1012,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) { } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); int NumberOfChannels = ChannelCount(); @@ -1113,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) { void Client::LeaveChannels(std::string ChannelNameList) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); std::string::size_type CurrentPos = 0; @@ -1292,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message) std::string ChannelName = Message.substr(1, MessageStart-1); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1435,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if(RuleB(Chat, EnableAntiSpam)) @@ -1647,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) { else Message = "Password change on channel " + ChannelName; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1702,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1790,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Invitee); @@ -1918,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Moderator); @@ -1999,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Voicee); @@ -2087,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Kickee); @@ -2196,32 +2196,32 @@ void Client::SetConnectionType(char c) { case 'S': { TypeOfConnection = ConnectionTypeCombined; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); break; } case 'U': { TypeOfConnection = ConnectionTypeCombined; UnderfootOrLater = true; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); break; } case 'M': { TypeOfConnection = ConnectionTypeMail; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); break; } case 'C': { TypeOfConnection = ConnectionTypeChat; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); break; } default: { TypeOfConnection = ConnectionTypeUnknown; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); } } } @@ -2299,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin void Client::ChangeMailBox(int NewMailBox) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); SetMailBox(NewMailBox); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); auto outapp = new EQApplicationPacket(OP_MailboxChange, 2); @@ -2377,13 +2377,13 @@ std::string Client::MailBoxName() { if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1))) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return ""; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index 8caa5ef5d..f18e12fe5 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) { client->GetAccountID()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); return; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); if(results.RowCount() != 1) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); return; } @@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) { client->SetKarma(atoi(row[2])); client->SetRevoked((atoi(row[3])==1?true:false)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); } int Database::FindAccount(const char *characterName, Client *client) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); client->ClearCharacters(); @@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) { characterName); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); return -1; } if (results.RowCount() != 1) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); return -1; } @@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) { int accountID = atoi(row[1]); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` " "WHERE `account_id` = %i AND `name` != '%s'", @@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri characterName.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); return false; } @@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri else sprintf(combinedKey, "%s", MailKey.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); return !strcmp(row[0], combinedKey); } @@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } safe_delete(safeCharName); if (results.RowCount() != 1) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); return -1; } @@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ bool Database::LoadChatChannels() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -267,25 +267,25 @@ bool Database::LoadChatChannels() { void Database::SetChannelPassword(std::string channelName, std::string password) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::SetChannelOwner(std::string channelName, std::string owner) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) { int unknownField3 = 1; int characterID = FindCharacter(client->MailBoxName().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) { int characterID = FindCharacter(client->MailBoxName().c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) { auto row = results.begin(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]); @@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub characterID = FindCharacter(characterName.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); if(characterID <= 0) return false; @@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); Client *client = CL->IsCharacterOnline(characterName); @@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub void Database::SetMessageStatus(int messageNumber, int status) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); if(status == 0) { std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber); @@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::ExpireMail() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } auto row = results.begin(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { @@ -524,9 +524,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); if(results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -536,9 +536,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); if(results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread @@ -547,9 +547,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); if(results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } @@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); } @@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends if(atoi(row[0]) == 0) { ignorees.push_back(name); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); continue; } friends.push_back(name); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); } } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 74f7c0522..6f64463f3 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -78,11 +78,11 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); return 1; } @@ -90,13 +90,13 @@ int main() { Config = ucsconfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); WorldShortName = Config->ShortName; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -104,22 +104,22 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -127,7 +127,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -138,11 +138,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index 105dc3d4a..49f4d2b48 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -52,7 +52,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -67,7 +67,7 @@ void WorldServer::Process() while((pack = tcpc.PopPacket())) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { @@ -88,7 +88,7 @@ void WorldServer::Process() std::string Message = Buffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); Client *c = CL->FindCharacter(From); @@ -99,7 +99,7 @@ void WorldServer::Process() if(!c) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); break; } diff --git a/world/client.cpp b/world/client.cpp index a2ee6638f..4a4cbb1d0 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1519,7 +1519,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) if (!cc) return false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); RaceClassCombos class_combo; bool found = false; @@ -1536,7 +1536,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); return false; } @@ -1553,7 +1553,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); return false; } @@ -1566,37 +1566,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) allocation.DefaultPointAllocation[6]; if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); return false; } if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); return false; } if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); return false; } if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); return false; } if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); return false; } if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); return false; } if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); return false; } @@ -1609,7 +1609,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) current_stats += cc->WIS - allocation.BaseStats[5]; current_stats += cc->CHA - allocation.BaseStats[6]; if (current_stats > max_stats) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); return false; } @@ -1690,7 +1690,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) if (!cc) return false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); classtemp = cc->class_ - 1; racetemp = cc->race - 1; @@ -1703,16 +1703,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // if out of range looking it up in the table would crash stuff // so we return from these if (classtemp >= PLAYER_CLASS_COUNT) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); return false; } if (racetemp >= _TABLE_RACES) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); return false; } if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs? - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); // we return from this one, since if it's an invalid combination our table // doesn't have meaningful values for the stats return false; @@ -1740,43 +1740,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // that are messed up not just the first hit if (bTOTAL + stat_points != cTOTAL) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); Charerrors++; } if (cc->STR > bSTR + stat_points || cc->STR < bSTR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); Charerrors++; } if (cc->STA > bSTA + stat_points || cc->STA < bSTA) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); Charerrors++; } if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); Charerrors++; } if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); Charerrors++; } if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); Charerrors++; } if (cc->INT > bINT + stat_points || cc->INT < bINT) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); Charerrors++; } if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); Charerrors++; } /*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of) I am NOT writing those tables - kathgar*/ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); return Charerrors == 0; } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index 8f2301f1d..d66401810 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) { int16 tmpStatus = WorldConfig::get()->DefaultStatus; paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID()); if (!paccountid) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); return false; } strn0cpy(paccountname, plsname, sizeof(paccountname)); diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 1a4237186..d8c536ca4 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -56,7 +56,7 @@ void ClientList::Process() { if (!iterator.GetData()->Process()) { struct in_addr in; in.s_addr = iterator.GetData()->GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); //the client destructor should take care of this. // iterator.GetData()->Free(); iterator.RemoveCurrent(); @@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID) if(!from) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); return; } @@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S safe_delete(output); } catch(...){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); return; } } @@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon safe_delete(pack2); } catch(...){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); return; } } @@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) { iterator.Reset(); while(iterator.MoreElements()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); if (iterator.GetData()->GetAccountID() == account_id) { Client* tmp = iterator.GetData(); return tmp; @@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) { iterator.Reset(); while(iterator.MoreElements()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); if (iterator.GetData()->GetCharName() == charname) { Client* tmp = iterator.GetData(); return tmp; diff --git a/world/console.cpp b/world/console.cpp index a6cb6027d..f9a646d07 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -88,7 +88,7 @@ void Console::Die() { state = CONSOLE_STATE_CLOSED; struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); tcpc->Disconnect(); } @@ -219,7 +219,7 @@ bool Console::Process() { if (!tcpc->Connected()) { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); return false; } //if we have not gotten the special markers after this timer, send login prompt @@ -234,7 +234,7 @@ bool Console::Process() { SendMessage(1, "Timeout, disconnecting..."); struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); return false; } @@ -243,29 +243,29 @@ bool Console::Process() { in.s_addr = GetIP(); if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) { auto zs = new ZoneServer(tcpc); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); zoneserver_list.Add(zs); numzones++; tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); launcher_list.Add(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); UCSLink.SetConnection(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); QSLink.SetConnection(tcpc); tcpc = 0; } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); } return false; } @@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) { state = CONSOLE_STATE_CLOSED; return; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); SendMessage(1, 0); SendMessage(2, "Login accepted."); state = CONSOLE_STATE_CONNECTED; @@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) { break; } case CONSOLE_STATE_CONNECTED: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); Seperator sep(command); if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) { SendMessage(1, " whoami"); @@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) { tmpname[0] = '*'; strcpy(&tmpname[1], paccountname); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0)); } } @@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) { #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); } else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) { if (strcasecmp(sep.arg[1], "list") == 0) { diff --git a/world/eqw.cpp b/world/eqw.cpp index b85720808..677aed6f9 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -269,7 +269,7 @@ void EQW::LSReconnect() { pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index ae2f18403..06660b683 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const { int16 status = 0; uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status); if(acctid == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); return(false); } if(status < httpLoginStatus) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); return(false); } @@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP } void EQWHTTPServer::Stop() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); m_running = false; Close(); } bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { if(m_running) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); return(false); } //load up our nice mime types if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); return(false); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); } //fire up the server thread char errbuf[TCPServer_ErrorBufferSize]; if(!Open(port, errbuf)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); return(false); } diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index 0a4a19ff5..09710cbff 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -65,7 +65,7 @@ EQWParser::EQWParser() { my_perl = perl_alloc(); _empty_sv = newSV(0); if(!my_perl) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); else DoInit(); } @@ -182,10 +182,10 @@ void EQWParser::DoInit() { #ifdef EMBPERL_PLUGIN - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); std::string err; if(!eval_file("world", "worldui.pl", err)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); } eval_pv( diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 4a56e4977..3baaabc92 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -79,7 +79,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -90,7 +90,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -100,7 +100,7 @@ bool LauncherLink::Process() { } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -114,25 +114,25 @@ bool LauncherLink::Process() { break; } case ServerOP_ZAAuth: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); break; } case ServerOP_LauncherConnectInfo: { const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer; if(HasName()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); break; } m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); if(config == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); std::vector result; //database.GetLauncherZones(it->name, result); @@ -146,7 +146,7 @@ bool LauncherLink::Process() { zs.port = cur->port; zs.up = false; zs.starts = 0; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); m_states[cur->name] = zs; } @@ -162,17 +162,17 @@ bool LauncherLink::Process() { std::map::iterator res; res = m_states.find(it->short_name); if(res == m_states.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); break; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); res->second.up = it->running; res->second.starts = it->start_count; break; } default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) { zs.port = port; zs.up = false; zs.starts = 0; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); m_states[short_name] = zs; StartZone(short_name); diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 1f220c8b6..01dbbd4a7 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -60,7 +60,7 @@ void LauncherList::Process() { //printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); cur = m_pendingLaunchers.erase(cur); delete l; } else if(l->HasName()) { @@ -72,10 +72,10 @@ void LauncherList::Process() { std::map::iterator res; res = m_launchers.find(name); if(res != m_launchers.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); delete res->second; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); //put the launcher in the list. m_launchers[name] = l; } else { @@ -91,7 +91,7 @@ void LauncherList::Process() { //printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); curl = m_launchers.erase(curl); delete l; } else { @@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { void LauncherList::Add(EmuTCPConnection *conn) { auto it = new LauncherLink(nextID++, conn); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); m_pendingLaunchers.push_back(it); } diff --git a/world/login_server.cpp b/world/login_server.cpp index 1a9eabda3..e526febfc 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -96,7 +96,7 @@ bool LoginServer::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { @@ -160,12 +160,12 @@ bool LoginServer::Process() { case ServerOP_LSFatalError: { #ifndef IGNORE_LS_FATAL_ERROR WorldConfig::DisableLoginserver(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); #else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); #endif if (pack->size > 1) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); } break; } @@ -177,18 +177,18 @@ bool LoginServer::Process() { case ServerOP_LSRemoteAddr: { if (!Config->WorldAddress.length()) { WorldConfig::SetWorldAddress((char *)pack->pBuffer); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); } break; } case ServerOP_LSAccountUpdate: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); CanAccountUpdate = true; break; } default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -202,10 +202,10 @@ bool LoginServer::Process() { bool LoginServer::InitLoginServer() { if(Connected() == false) { if(ConnectReady()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); Connect(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", LoginServerAddress,LoginServerPort); } } @@ -216,29 +216,29 @@ bool LoginServer::Connect() { char tmp[25]; if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){ minilogin = true; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); } else minilogin = false; if (minilogin && WorldConfig::get()->WorldAddress.length()==0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); return false; } char errbuf[TCPConnection_ErrorBufferSize]; if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); return false; } if (LoginServerIP == 0 || LoginServerPort == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); return false; } if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); if (minilogin) SendInfo(); else @@ -248,7 +248,7 @@ bool LoginServer::Connect() { return true; } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); return false; } } @@ -324,7 +324,7 @@ void LoginServer::SendStatus() { void LoginServer::SendAccountUpdate(ServerPacket* pack) { ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; if(CanUpdate()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); strn0cpy(s->worldaccount, LoginAccount, 30); strn0cpy(s->worldpassword, LoginPassword, 30); SendPacket(pack); diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index 84cb4af76..e74bc6a9a 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) { bool LoginServerList::SendAccountUpdate(ServerPacket* pack) { LinkedListIterator iterator(list); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); iterator.Reset(); while(iterator.MoreElements()){ if(iterator.GetData()->CanUpdate()) { diff --git a/world/net.cpp b/world/net.cpp index 64a0b973b..d3defb1a2 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -126,36 +126,36 @@ int main(int argc, char** argv) { } // Load server configuration - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #endif @@ -164,7 +164,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -172,19 +172,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -280,56 +280,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); database.LoadVariables(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); database.LoadZoneNames(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); database.ClearGroup(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); if (!database.LoadItems()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -338,45 +338,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -404,7 +404,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -417,19 +417,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -492,16 +492,16 @@ int main(int argc, char** argv) { } Sleep(20); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); console_list.KillAll(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); tcps.Close(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); eqsf.Close(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); CheckEQEMuErrorAndPause(); @@ -509,9 +509,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); RunLoops = false; } diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 3a7147f23..66af57d53 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); Stream->Disconnect(); } @@ -57,7 +57,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -69,7 +69,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -79,7 +79,7 @@ bool QueryServConnection::Process() } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -97,7 +97,7 @@ bool QueryServConnection::Process() } case ServerOP_ZAAuth: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); break; } case ServerOP_QueryServGeneric: @@ -114,7 +114,7 @@ bool QueryServConnection::Process() } default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/ucs.cpp b/world/ucs.cpp index d2e361964..174b71b98 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); Stream->Disconnect(); } @@ -52,7 +52,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -64,7 +64,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -74,7 +74,7 @@ bool UCSConnection::Process() } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -92,12 +92,12 @@ bool UCSConnection::Process() } case ServerOP_ZAAuth: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); break; } default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index 1a148bc08..c97f29b7a 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -34,7 +34,7 @@ WorldGuildManager guild_mgr; void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, } void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui } void WorldGuildManager::SendGuildDelete(uint32 guild_id) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!RefreshGuild(s->guild_id)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); //can we do anything? } @@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); //preform the local update client_list.UpdateClientGuild(s->char_id, s->guild_id); @@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!LocalDeleteGuild(s->guild_id)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); //can we do anything? } @@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildMemberUpdate: { if(pack->size != sizeof(ServerGuildMemberUpdate_Struct)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); return; } @@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { } default: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); break; } } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index 49d1d24eb..51962d16e 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -79,7 +79,7 @@ void ZSList::KillAll() { void ZSList::Process() { if(shutdowntimer && shutdowntimer->Check()){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); auto pack2 = new ServerPacket; pack2->opcode = ServerOP_ShutdownAll; pack2->size=0; @@ -99,10 +99,10 @@ void ZSList::Process() { ZoneServer* zs = iterator.GetData(); struct in_addr in; in.s_addr = zs->GetIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); zs->LSShutDownUpdate(zs->GetZoneID()); if (holdzones){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); if(!zs->IsStaticZone()) RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID()); else @@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip s->port = port; s->zoneid = zoneid; if(zoneid != 0) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); tmp[z]->SendPacket(pack); delete pack; safe_delete_array(tmp); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 62c7ca37a..29abeabf9 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -209,7 +209,7 @@ bool ZoneServer::Process() { } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } } @@ -708,20 +708,20 @@ bool ZoneServer::Process() { /* Zone was already running*/ if(ingress_server) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); ztz->response = 1; } /* Boot the Zone*/ else { int server_id; if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); // bootup successful, ready to rock ztz->response = 1; ingress_server = zoneserver_list.FindByID(server_id); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); // bootup failed, send back error code 0 ztz->response = 0; } diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 295d5c495..98ca3ee84 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,17 +342,17 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); return( mod_will_aggro(mob, this) ); } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); return(false); } diff --git a/zone/attack.cpp b/zone/attack.cpp index 35b410412..d284b9184 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -57,7 +57,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); switch (item->ItemType) { @@ -187,7 +187,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC() && !attacker->IsPet()) chancetohit += RuleR(Combat, NPCBonusHitChance); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); bool pvpmode = false; if(IsClient() && other->IsClient()) @@ -208,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate the level difference - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); double level_difference = attacker_level - defender_level; double range = defender->GetLevel(); @@ -236,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); if(attacker->IsClient()) { chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse))); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); } if(defender->IsClient()) { chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); } //I dont think this is 100% correct, but at least it does something... if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->spellbonuses.MeleeSkillCheck; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->itembonuses.MeleeSkillCheck; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } //Avoidance Bonuses on defender decreases baseline hit chance by percent. @@ -308,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate final chance to hit chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker); @@ -327,7 +327,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); // @@ -336,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c float tohit_roll = zone->random.Real(0, 100); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); return(tohit_roll <= chancetohit); } @@ -2028,7 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if (IsEngaged()) { zone->DelAggroMob(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); } SetHP(0); SetPet(0); diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index a1db65930..423f7742a 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -77,9 +77,9 @@ void Client::CalcBonuses() CalcSpellBonuses(&spellbonuses); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); CalcAABonuses(&aabonuses); //we're not quite ready for this - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); RecalcWeight(); @@ -634,7 +634,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) diff --git a/zone/bot.cpp b/zone/bot.cpp index b9d5ebdc9..fa4d937f2 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) @@ -7335,7 +7335,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); } } //Check for spell skill limits. diff --git a/zone/client.cpp b/zone/client.cpp index ed832a208..8ea010890 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -650,7 +650,7 @@ bool Client::SendAllPackets() { if(eqs) eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); - logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); + logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); } return true; } @@ -698,7 +698,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s char message[4096]; strn0cpy(message, orig_message, sizeof(message)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); if (targetname == nullptr) { targetname = (!GetTarget()) ? "" : GetTarget()->GetName(); @@ -1506,7 +1506,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); + logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); @@ -2235,13 +2235,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha if(zone->random.Real(0, 99) < Chance) { SetSkill(skillid, GetRawSkill(skillid) + 1); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); return true; } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); } } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); } return false; } @@ -2262,10 +2262,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) { if(zone->random.Real(0,100) < Chance) { // if they make the roll IncreaseLanguageSkill(langid); // increase the language skill by 1 - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); } else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); } } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 0f6df5965..51b73e6a5 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 09f2b1da6..a18438f5c 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3573,7 +3573,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) default: Message(13, "Unrecognised Barter action."); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); } } @@ -3636,7 +3636,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); logger.Log(EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } @@ -7196,7 +7196,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) @@ -9814,7 +9814,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9846,7 +9846,7 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -11714,7 +11714,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); @@ -11782,7 +11782,7 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this @@ -13435,7 +13435,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (c) c->WithCustomer(0); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); break; } @@ -13444,7 +13444,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) break; } default: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); break; } } @@ -13530,7 +13530,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); logger.Log(EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); @@ -13542,7 +13542,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) HandleTraderPriceUpdate(app); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); logger.Log(EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; @@ -13568,11 +13568,11 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) BuyTraderItem(tbs, Trader, app); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); } } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); } return; @@ -13646,7 +13646,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (app->size != sizeof(TraderClick_Struct)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); return; } @@ -13660,7 +13660,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (Customer) outtcs->Approval = Customer->WithCustomer(GetID()); else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" " returned a nullptr pointer"); return; } @@ -13757,7 +13757,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates an item... @@ -13776,7 +13776,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13786,7 +13786,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates money @@ -13805,7 +13805,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13815,7 +13815,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); _pkt(TRIBUTE__IN, app); return; @@ -13823,7 +13823,7 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) @@ -13837,7 +13837,7 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 01c59236e..5c9444ee0 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ Client* c = entity_list.GetClientByID(CustomerID); if(!c) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); CustomerID = NewCustomer; return 1; } @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/command.cpp b/zone/command.cpp index 12f79a2a6..35ca539e8 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -4546,10 +4546,10 @@ void command_guild(Client *c, const Seperator *sep) } if(guild_id == GUILD_NONE) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id); } @@ -4598,7 +4598,7 @@ void command_guild(Client *c, const Seperator *sep) return; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) @@ -4640,7 +4640,7 @@ void command_guild(Client *c, const Seperator *sep) uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) @@ -4679,7 +4679,7 @@ void command_guild(Client *c, const Seperator *sep) } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) @@ -4713,7 +4713,7 @@ void command_guild(Client *c, const Seperator *sep) } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) @@ -4764,7 +4764,7 @@ void command_guild(Client *c, const Seperator *sep) } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) diff --git a/zone/doors.cpp b/zone/doors.cpp index 3bc0101b1..d602fafe1 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -145,9 +145,9 @@ bool Doors::Process() void Doors::HandleClick(Client* sender, uint8 trigger) { //door debugging info dump - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct)); MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer; diff --git a/zone/entity.cpp b/zone/entity.cpp index 1854f83bf..7b85b286b 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID) // If we have been passed a TaskID, only reload the client state if they have // that Task active. if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); client->RemoveClientTaskState(); client->LoadClientTaskState(); taskmanager->SendActiveTasksToClient(client); diff --git a/zone/groups.cpp b/zone/groups.cpp index ab90cddec..3eccb7fa6 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 4a72a6d9c..4d58b1fb0 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -32,7 +32,7 @@ extern WorldServer worldserver; extern volatile bool ZoneLoaded; void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { if(guild_id == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); CharGuildInfo gci; if(!GetCharInfo(charid, gci)) { @@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID) } void ZoneGuildManager::SendGuildDelete(uint32 guild_id) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -266,7 +266,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //reload all the guild details from the database. RefreshGuild(s->guild_id); @@ -300,7 +300,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); Client *c = entity_list.GetClientByCharID(s->char_id); @@ -369,7 +369,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); //clear all the guild tags. entity_list.RefreshAllGuildInfo(s->guild_id); @@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if (!c || !c->IsInAGuild()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); break; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; @@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { VARSTRUCT_DECODE_STRING(Name, Buffer); strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName)); gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); c->QueuePacket(outapp); } safe_delete(outapp); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 898a0b833..103728e83 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name); const ItemInst* InvItem = nullptr; @@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { InvItem = GetInv()[WeaponSlot]; if(InvItem) { BaseItem = InvItem->GetItem(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon; database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0; } @@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { void Client::RemoveBandolier(const EQApplicationPacket *app) { BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); memset(m_pp.bandoliers[bds->number].name, 0, 32); for(int i = bandolierMainHand; i <= bandolierAmmo; i++) { m_pp.bandoliers[bds->number].items[i].item_id = 0; @@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // any items currently in the weapon slots to inventory. BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); int16 slot; int16 WeaponSlot; ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory @@ -2585,11 +2585,11 @@ void Client::SetBandolier(const EQApplicationPacket *app) { else { // The player doesn't have the required weapon with them. BandolierItems[BandolierSlot] = 0; if (slot == INVALID_INDEX) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { // If there was an item in that weapon slot, put it in the inventory - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); @@ -2640,7 +2640,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // put it in the player's inventory. ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name); // If there was an item in that weapon slot, put it in the inventory if(MoveItemToInventory(InvItem)) @@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { if(!ItemToReturn) return false; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); uint32 ItemID = ItemToReturn->GetItem()->ID; @@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(i), i); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); return true; } @@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); return true; } @@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // Store on the cursor // - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); PushItemOnCursor(*ItemToReturn, UpdateClient); diff --git a/zone/net.cpp b/zone/net.cpp index 2e8d77942..5cfe506cd 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -148,7 +148,7 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { logger.Log(EQEmuLogSys::Error, "Loading server configuration failed."); return 1; @@ -156,13 +156,13 @@ int main(int argc, char** argv) { const ZoneConfig *Config=ZoneConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); worldserver.SetPassword(Config->SharedKey.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), @@ -186,7 +186,7 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers @@ -208,99 +208,99 @@ int main(int argc, char** argv) { const char *log_ini_file = "./log.ini"; if(!load_log_settings(log_ini_file)) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); database.LoadVariables(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { logger.Log(EQEmuLogSys::Error, "Loading items FAILED!"); logger.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { logger.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { logger.Log(EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { logger.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { logger.Log(EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); database.LoadFactionData(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); database.LoadTributes(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) logger.Log(EQEmuLogSys::Error, "Command loading FAILED"); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { logger.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(TaskSystem, EnableTaskSystem)) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); taskmanager = new TaskManager; taskmanager->LoadTasks(); } @@ -317,7 +317,7 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); parse->ReloadQuests(); if (!worldserver.Connect()) { @@ -332,7 +332,7 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance logger.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; @@ -365,7 +365,7 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); // log_sys.CloseZoneLogs(); // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); @@ -385,7 +385,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqss->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); stream_identifier.AddStream(eqss); //takes the stream } @@ -397,7 +397,7 @@ int main(int argc, char** argv) { //now that we know what patch they are running, start up their client object struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); Client* client = new Client(eqsi); entity_list.AddClient(client); } @@ -522,13 +522,13 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); CheckEQEMuErrorAndPause(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -539,7 +539,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); // safe_delete(worldserver); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); } uint32 NetConnection::GetIP() diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 50e722d8d..0494f7f67 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2074,7 +2074,7 @@ bool QuestManager::istaskenabled(int taskid) { void QuestManager::tasksetselector(int tasksetid) { QuestManagerCurrentQuestVars(); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager) initiator->TaskSetSelector(owner, tasksetid); } diff --git a/zone/raids.cpp b/zone/raids.cpp index 7a35d91ac..9a87b539a 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 367427527..2aebb5339 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -153,13 +153,13 @@ bool Spawn2::Process() { if (timer.Check()) { timer.Disable(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); //first check our spawn condition, if this isnt active //then we reset the timer and try again next time. if(condition_id != SC_AlwaysEnabled && !zone->spawn_conditions.Check(condition_id, condition_min_value)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); Reset(); return(true); } @@ -170,14 +170,14 @@ bool Spawn2::Process() { } if (sg == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } //have the spawn group pick an NPC for us uint32 npcid = sg->GetNPCType(); if (npcid == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); Reset(); //try again later (why?) return(true); } @@ -185,7 +185,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); if (tmp == nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); } @@ -194,7 +194,7 @@ bool Spawn2::Process() { { if(!entity_list.LimitCheckName(tmp->name)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); timer.Start(5000); //try again in five seconds. return(true); } @@ -202,7 +202,7 @@ bool Spawn2::Process() { if(tmp->spawn_limit > 0) { if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); timer.Start(5000); //try again in five seconds. return(true); } @@ -233,10 +233,10 @@ bool Spawn2::Process() { if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && sg->min_delay) npc->AI_SetRoambox(sg->roamdist,sg->roambox[0],sg->roambox[1],sg->roambox[2],sg->roambox[3],sg->delay,sg->min_delay); if(zone->InstantGrids()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); LoadGrid(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); } } return true; @@ -261,7 +261,7 @@ void Spawn2::LoadGrid() { //dont set an NPC's grid until its loaded for them. npcthis->SetGrid(grid_); npcthis->AssignWaypoints(grid_); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); } @@ -272,21 +272,21 @@ void Spawn2::LoadGrid() { void Spawn2::Reset() { timer.Start(resetTimer()); npcthis = nullptr; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { if (delay == 0) { timer.Trigger(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } npcthis = nullptr; @@ -328,7 +328,7 @@ void Spawn2::ForceDespawn() cur = despawnTimer(dtimer); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); timer.Start(cur); } @@ -349,7 +349,7 @@ void Spawn2::DeathReset(bool realdeath) if(spawn2_id) { database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), (cur/1000)); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); //store it to database too } } @@ -466,12 +466,12 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { if(GetSpawnCondition() != c.condition_id) return; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); bool old_state = (old_value >= condition_min_value); bool new_state = (c.value >= condition_min_value); if(old_state == new_state) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); return; //no change } @@ -479,50 +479,50 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { switch(c.on_change) { case SpawnCondition::DoNothing: //that was easy. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); break; case SpawnCondition::DoDepop: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; case SpawnCondition::DoRepopIfReady: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); npcthis->Depop(false); //remove the current mob npcthis = nullptr; } if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled. timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); if(timer_remaining <= 0) Repop(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); } break; default: if(c.on_change < SpawnCondition::DoSignalMin) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); return; //unknown onchange action } int signal_id = c.on_change - SpawnCondition::DoSignalMin; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } void Zone::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); LinkedListIterator iterator(spawn2_list); @@ -592,7 +592,7 @@ void SpawnConditionManager::Process() { EQTime::AddMinutes(cevent.period, &cevent.next); std::string t; EQTime::ToString(&cevent.next, t); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); //save the next event time in the DB UpdateDBEvent(cevent); //find the next closest event timer. @@ -611,7 +611,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); return; //unable to find the spawn condition to operate on } @@ -619,7 +619,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { zone->zone_time.getEQTimeOfDay(&tod); if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); return; } @@ -631,26 +631,26 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { switch(event.action) { case SpawnEvent::ActionSet: new_value = event.argument; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); break; case SpawnEvent::ActionAdd: new_value += event.argument; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionSubtract: new_value -= event.argument; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionMultiply: new_value *= event.argument; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; case SpawnEvent::ActionDivide: new_value /= event.argument; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; default: - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); return; } @@ -727,7 +727,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: std::string timeAsString; EQTime::ToString(&event.next, timeAsString); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); return true; } @@ -755,7 +755,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in cond.on_change = (SpawnCondition::OnChange) atoi(row[1]); spawn_conditions[cond.condition_id] = cond; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); } //load values @@ -811,7 +811,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in spawn_events.push_back(event); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); } //now we need to catch up on events that happened while we were away @@ -846,7 +846,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in //watch for special case of all 0s, which means to reset next to now if(cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 && cevent.next.minute == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); memcpy(&cevent.next, &tod, sizeof(cevent.next)); //add one period EQTime::AddMinutes(cevent.period, &cevent.next); @@ -857,7 +857,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in bool ran = false; while(EQTime::IsTimeBefore(&tod, &cevent.next)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); //this event has been triggered. //execute the event if(!cevent.strict || StrictCheck) @@ -900,9 +900,9 @@ void SpawnConditionManager::FindNearestEvent() { } } if(next_id == -1) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); } void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update) @@ -914,14 +914,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -930,7 +930,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //set our local value cond.value = new_value; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -941,14 +941,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -959,7 +959,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //save it in the DB too UpdateDBCondition(zone_short, instance_id, condition_id, new_value); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -969,7 +969,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //this is a remote spawn condition, update the DB and send //an update packet to the zone if its up - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); UpdateDBCondition(zone_short, instance_id, condition_id, new_value); @@ -989,7 +989,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance void SpawnConditionManager::ReloadEvent(uint32 event_id) { std::string zone_short_name; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1002,7 +1002,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { //load the event into the old event slot if(!LoadDBEvent(event_id, cevent, zone_short_name)) { //unable to find the event in the database... - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } //sync up our nearest event @@ -1015,7 +1015,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { SpawnEvent e; if(!LoadDBEvent(event_id, e, zone_short_name)) { //unable to find the event in the database... - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } @@ -1032,7 +1032,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1047,13 +1047,13 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri cevent.enabled = enabled; cevent.strict = strict; if(reset_base) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); //start with the time now zone->zone_time.getEQTimeOfDay(&cevent.next); //advance the next time by our period EQTime::AddMinutes(cevent.period, &cevent.next); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); } //save the event in the DB @@ -1062,7 +1062,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri //sync up our nearest event FindNearestEvent(); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); } //even if we dont change anything, we still found it return; @@ -1081,24 +1081,24 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri SpawnEvent e; std::string zone_short_name; if(!LoadDBEvent(event_id, e, zone_short_name)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); //unable to find the event in the database... return; } if(e.enabled == enabled && !reset_base) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); return; //no changes. } e.enabled = enabled; if(reset_base) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); //start with the time now zone->zone_time.getEQTimeOfDay(&e.next); //advance the next time by our period EQTime::AddMinutes(e.period, &e.next); } else { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); } //save the event in the DB UpdateDBEvent(e); @@ -1123,7 +1123,7 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); return(0); //unable to find the spawn condition } @@ -1138,12 +1138,12 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc zone_short, instance_id, condition_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } if (results.RowCount() == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } diff --git a/zone/spells.cpp b/zone/spells.cpp index ba8431814..113c335e4 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3832,7 +3832,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 37dc89fc2..593926f38 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() { int taskID = atoi(row[1]); TaskSets[taskSet].push_back(taskID); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); } return true; @@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() { bool TaskManager::LoadSingleTask(int TaskID) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false; @@ -115,21 +115,21 @@ bool TaskManager::LoadSingleTask(int TaskID) { void TaskManager::ReloadGoalLists() { if(!GoalListManager.LoadLists()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); } bool TaskManager::LoadTasks(int singleTask) { // If TaskID !=0, then just load the task specified. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); std::string query; if(singleTask == 0) { if(!GoalListManager.LoadLists()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); if(!LoadTaskSets()) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, " "`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, " @@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->SequenceMode = ActivitiesSequential; Tasks[taskID]->LastStep = 0; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward, Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel, Tasks[taskID]->Repeatable ? "Yes" : "No"); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); } @@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]); Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " "GoalMethod: %i, GoalCount: %3i, ZoneID:%3i", Tasks[taskID]->ActivityCount, activityID, taskID, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type, @@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); Tasks[taskID]->ActivityCount++; } @@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { int characterID = c->CharacterID(); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { for(int task=0; taskActiveTasks[task].Updated) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) " "VALUES (%i, %i, %i, %i)", @@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(!state->ActiveTasks[task].Activity[activityIndex].Updated) continue; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", characterID, task, activityIndex); if(updatedActivityCount==0) @@ -358,7 +358,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(updatedActivityCount == 0) continue; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { @@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { for(unsigned int i=state->LastCompletedTaskLoaded; iCompletedTasks.size(); i++) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); int taskID = state->CompletedTasks[i].TaskID; if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr)) @@ -459,7 +459,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTaskCount = 0; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` " "FROM `character_tasks` " @@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { ++state->ActiveTaskCount; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); } // Load Activities - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` " "FROM `character_activities` " @@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); } @@ -639,7 +639,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); state->EnabledTasks.push_back(taskID); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); } // Check that there is an entry in the client task state for every activity in each task @@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); return true; } @@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { } } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); for(unsigned int i=0; iGetLevel(); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, state->EnabledTasks.size()); if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return; @@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if(TaskSets[TaskSetID][0] == 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); std::vector::iterator Iterator = TaskSets[TaskSetID].begin(); while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) { @@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) && (TaskListIndex < MAXCHOOSERENTRIES)) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex, TaskSets[TaskSetID][TaskSetIndex]); @@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task return; } // Titanium OpCode: 0x5e7c - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); char *Ptr; int PlayerLevel = c->GetLevel(); @@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); int PlayerLevel = c->GetLevel(); @@ -1275,7 +1275,7 @@ int ClientTaskState::GetActiveTaskID(int index) { static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); @@ -1284,7 +1284,7 @@ static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); } bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { @@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first // activity as active if not complete. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode); if(Task->SequenceMode == ActivitiesSequential) { @@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) { if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTasks.push_back(cti); } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); return AllActivitiesComplete; } @@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { bool CurrentStepComplete = true; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); // If CurrentStep is -1, this is the first call to this method since loading the // client state. Unlock all activities with a step number of 0 if(ActiveTasks[TaskIndex].CurrentStep == -1) { @@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // If we are only keeping one completed record per task, and the player has done // the same task again, erase the previous completed entry for this task. if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI int Ret = false; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); // If the client has no tasks, there is nothing further to check. @@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(Task->Activity[j].Type != ActivityType) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID); continue; } @@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI continue; } // We found an active task to kill this type of NPC, so increment the done count - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); IncrementDoneCount(c, Task, i, j); Ret = true; } @@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI // If the client has no tasks, there is nothing further to check. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); if(ActiveTaskCount == 0) return; @@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(Task->Activity[j].Type != (int)Type) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", c->GetName(), Type, ItemID); continue; } @@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI continue; } // We found an active task related to this item, so increment the done count - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); IncrementDoneCount(c, Task, i, j, Count); } } @@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { // If the client has no tasks, there is nothing further to check. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityExplore) continue; if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", c->GetName(), ExploreID); continue; } @@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { } // We found an active task to explore this area, so set done count to goal count // (Only a goal count of 1 makes sense for explore activities?) - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); @@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i bool Ret = false; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); if(ActiveTaskCount == 0) return false; @@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i (Task->Activity[j].Type != ActivityGiveCash)) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID); continue; } @@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i // Is the activity related to these items ? // if((Task->Activity[j].Type == ActivityGiveCash) && Cash) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); IncrementDoneCount(c, Task, i, j, Cash); Ret = true; } @@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i continue; } // We found an active task related to this item, so increment the done count - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); IncrementDoneCount(c, Task, i, j, 1); Ret = true; } @@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { // If the client has no tasks, there is nothing further to check. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityTouch) continue; if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue; if(Task->Activity[j].ZoneID != ZoneID) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", c->GetName()); continue; } // We found an active task to zone into this zone, so set done count to goal count // (Only a goal count of 1 makes sense for touch activities?) - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); } @@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { } void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count; @@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true; // Have we reached the goal count for this activity ? if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount, Task->Activity[ActivityID].GoalCount, ActivityID); @@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); // and by the 'Task Stage Completed' message c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex); // Send the updated task/activity list to the client @@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) { void ClientTaskState::FailTask(Client *c, int TaskID) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); if(ActiveTaskCount == 0) return; for(int i=0; i= Task->ActivityCount) return false; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State); @@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update); } void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0; @@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) { if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1; for(unsigned int i=0; iunknown5 = 0x00000001; tac->unknown5 = 0; // 0 for task complete or failed. - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); @@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) if(State->CompletedTasks.size() > 50) FirstTaskToSend = State->CompletedTasks.size() - 50; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend); /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { @@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, @@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, TaskComplete); @@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->SequenceNumber = SequenceNumber; cts->unknown4 = 0x00000002; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); @@ -2932,7 +2932,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { int characterID = c->CharacterID(); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); @@ -2941,7 +2941,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { logger.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); @@ -2949,7 +2949,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { if(!results.Success()) logger.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY; ActiveTaskCount--; @@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { // int FreeSlot = -1; for(int i=0; iProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } @@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() { bool TaskGoalListManager::LoadLists() { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); for(int i=0; i< NumberOfLists; i++) safe_delete_array(TaskGoalLists[i].GoalItemEntries); @@ -3093,7 +3093,7 @@ bool TaskGoalListManager::LoadLists() { } NumberOfLists = results.RowCount(); - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); TaskGoalLists = new TaskGoalList_Struct[NumberOfLists]; @@ -3207,7 +3207,7 @@ std::vector TaskGoalListManager::GetListContents(int ListID) { bool TaskGoalListManager::IsInList(int ListID, int Entry) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); int ListIndex = GetListByID(ListID); @@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) { else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry]) LastEntry = MiddleEntry - 1; else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); return true; } @@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() { bool TaskProximityManager::LoadProximities(int zoneID) { TaskProximity proximity; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); TaskProximities.clear(); std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, " @@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) { TaskProximity* P = &TaskProximities[i]; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ); if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY || diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index ad85d23df..7ac9cbaf5 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { //handle caps if(spec->nofail) { chance = 100; //cannot fail. - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); } else if(over_trivial >= 0) { // At reaching trivial the chance goes to 95% going up an additional // percent for every 40 skillpoints above the trivial. @@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { chance = 95; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); float res = zone->random.Real(0, 99); int aa_chance = 0; @@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); itr = spec->onsuccess.begin(); while(itr != spec->onsuccess.end() && !spec->quest) { @@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(MT_Emote,TRADESKILL_FAILED); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); @@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float NotifyNewTitlesAvailable(); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); } bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, diff --git a/zone/trading.cpp b/zone/trading.cpp index 6fc82fd25..12fc01a64 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -126,7 +126,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { inst2->SetCharges(stack_size + inst2->GetCharges()); } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); if (_stack_size > 0) inst->SetCharges(_stack_size); @@ -143,7 +143,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { SendItemData(inst, trade_slot_id); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); client->DeleteItemInInventory(MainCursor); @@ -1160,7 +1160,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) { const Item_Struct* item = database.GetItem(ItemID); if(!item){ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); return; } @@ -1219,10 +1219,10 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } @@ -1245,7 +1245,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); return nullptr; } @@ -1302,7 +1302,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ } } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", SerialNumber , Quantity, this->GetName()); return 0; @@ -1311,7 +1311,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Customer,uint16 TraderSlot, int SerialNumber) { if(!Customer) return; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); if(Quantity < Charges) { Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber); m_inv.DeleteItem(Slot, Quantity); @@ -1395,7 +1395,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* if(!Stackable) Quantity = (Charges > 0) ? Charges : 1; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); } if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){ this->DeleteItemInInventory(SlotID, Quantity); @@ -1431,7 +1431,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* } } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, Quantity,this->GetName()); } @@ -1510,13 +1510,13 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat const ItemInst* BuyItem = Trader->FindTraderItemBySerialNumber(tbs->ItemID); if(!BuyItem) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); TradeRequestFailed(app); safe_delete(outapp); return; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", BuyItem->GetItem()->Name, BuyItem->IsStackable(), tbs->Quantity, BuyItem->GetCharges()); // If the item is not stackable, then we can only be buying one of them. if(!BuyItem->IsStackable()) @@ -1534,7 +1534,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat outtbs->Quantity = tbs->Quantity; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); @@ -1840,7 +1840,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint return; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); int Size = 0; uint32 ID = 0; @@ -1887,7 +1887,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint VARSTRUCT_ENCODE_TYPE(uint32, bufptr, ID); } else{ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0); } Cost = atoi(row[5]); @@ -1981,7 +1981,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(inst->IsStackable()) inst->SetMerchantCount(gis->Charges[i]); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor? @@ -2018,7 +2018,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St if(gis->ItemID[i] == ItemID) { tdis->ItemID = gis->SerialNumber[i]; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); _pkt(TRADING__PACKETS, outapp); @@ -2031,7 +2031,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St return; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); ItemInst* inst = database.CreateItem(item); @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantSlot(gis->SerialNumber[i]); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor?? @@ -2073,7 +2073,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { // TraderPriceUpdate_Struct* tpus = (TraderPriceUpdate_Struct*)app->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", GetName(), tpus->SerialNumber, tpus->NewPrice); // Pull the items this Trader currently has for sale from the trader table. @@ -2101,7 +2101,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((gis->ItemID[i] > 0) && (gis->SerialNumber[i] == tpus->SerialNumber)) { // We found the item that the Trader wants to change the price of (or add back up for sale). // - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); IDOfItemToUpdate = gis->ItemID[i]; @@ -2127,7 +2127,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { return ; } - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); // Find what is in their Trader Satchels GetItems_Struct* newgis=GetTraderItems(); @@ -2140,7 +2140,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((newgis->Items[i] > 0) && (newgis->SerialNumber[i] == tpus->SerialNumber)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], newgis->Charges[i]); IDOfItemToAdd = newgis->Items[i]; @@ -2158,7 +2158,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if(!IDOfItemToAdd || !item) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); @@ -2203,7 +2203,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { gis->SerialNumber[i] = newgis->SerialNumber[i]; gis->ItemCost[i] = tpus->NewPrice; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", GetName(), newgis->Items[i], newgis->SerialNumber[i], newgis->Charges[i], tpus->NewPrice, i); } @@ -2249,7 +2249,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { QueuePacket(app); if(OldPrice == tpus->NewPrice) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); safe_delete(gis); return; } @@ -2855,11 +2855,11 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { bool LoreConflict = CheckLoreConflict(item); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", GetName(), BuySlot, ItemID, item->Name, Quantity, ToggleOnOff, Price, ItemCount, LoreConflict); if((item->NoDrop != 0) && !LoreConflict && (Quantity > 0) && HasMoney(Quantity * Price) && ToggleOnOff && (ItemCount == 0)) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); database.AddBuyLine(CharacterID(), BuySlot, ItemID, ItemName, Quantity, Price); QueuePacket(app); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 8abb308d7..3bce1101a 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,12 +155,12 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); ZoneConfig::SetZonePort(sci->port); break; } case ServerOP_ZAAuthFailed: { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -748,7 +748,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - logger.LogDebugType(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); + logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret; @@ -2005,14 +2005,14 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) { ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer; - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); switch(rts->Command) { case RELOADTASKS: entity_list.SaveAllClientsTaskState(); if(rts->Parameter == 0) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); safe_delete(taskmanager); taskmanager = new TaskManager; taskmanager->LoadTasks(); @@ -2021,7 +2021,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) entity_list.ReloadAllClientsTaskState(); } else { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); taskmanager->LoadTasks(rts->Parameter); entity_list.ReloadAllClientsTaskState(rts->Parameter); } @@ -2030,23 +2030,23 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) case RELOADTASKPROXIMITIES: if(zone) { - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); taskmanager->LoadProximities(zone->GetZoneID()); } break; case RELOADTASKGOALLISTS: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); taskmanager->ReloadGoalLists(); break; case RELOADTASKSETS: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); taskmanager->LoadTaskSets(); break; default: - logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index da24a3665..507e1ef27 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -523,14 +523,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } loadti->Code = BazaarTrader_ShowItems; for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -548,13 +548,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -574,7 +574,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { return nullptr; if (results.RowCount() == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); return nullptr; } @@ -587,7 +587,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { const Item_Struct *item = database.GetItem(ItemID); if(!item) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); fflush(stdout); return nullptr; } @@ -597,7 +597,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { ItemInst* inst = database.CreateItem(item); if(!inst) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); fflush(stdout); return nullptr; } @@ -624,7 +624,7 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum } void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i", Charges, CharID, SerialNumber); @@ -637,7 +637,7 @@ void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int3 void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); const Item_Struct *item = database.GetItem(ItemID); @@ -645,7 +645,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg return; if(NewPrice == 0) { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); From f410b270adaca3c3ec2834f7e1e5c4d0c5ef923c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 03:22:23 -0600 Subject: [PATCH 118/707] Fix Callback in zone, some stragglers in the renaming of function --- common/eqemu_logsys.h | 1 + common/misc_functions.h | 2 +- common/patches/ss_define.h | 8 ++++---- zone/zone.h | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 2d33e2bfe..d8ade655b 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -81,6 +81,7 @@ public: void LoadLogSettingsDefaults(); void Log(uint16 log_type, const std::string message, ...); void LogDebug(DebugLevel debug_level, std::string message, ...); + //void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); diff --git a/common/misc_functions.h b/common/misc_functions.h index 7900bc855..8a77972c2 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index fbaee3689..7b53f78bb 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/zone/zone.h b/zone/zone.h index 38c3d4a05..6c437bed2 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -271,7 +271,7 @@ public: // random object that provides random values for the zone EQEmu::Random random; - void GMSayHookCallBackProcess(uint16 log_type, std::string& message){ entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_type], "%s", message.c_str()); } + static void GMSayHookCallBackProcess(uint16 log_type, std::string& message){ entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_type], "%s", message.c_str()); } //MODDING HOOKS void mod_init(); From bfd73e5b96b007991038454551738ef8db60ddb4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 20:58:13 -0600 Subject: [PATCH 119/707] Remove some more old log callbacks --- common/debug.cpp | 23 ----------------------- common/debug.h | 3 --- 2 files changed, 26 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 874de6aa6..2bf685cbf 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -61,12 +61,6 @@ static const char* LogNames[EQEmuLog::MaxLogID] = { "Status", "Normal", "Error", EQEmuLog::EQEmuLog() { - for (int i = 0; i < MaxLogID; i++) { - fp[i] = 0; - logCallbackFmt[i] = nullptr; - logCallbackBuf[i] = nullptr; - logCallbackPva[i] = nullptr; - } pLogStatus[EQEmuLog::LogIDs::Status] = LOG_LEVEL_STATUS; pLogStatus[EQEmuLog::LogIDs::Normal] = LOG_LEVEL_NORMAL; pLogStatus[EQEmuLog::LogIDs::Error] = LOG_LEVEL_ERROR; @@ -166,11 +160,6 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) logger.Log(id, vStringFormat(fmt, argptr).c_str()); - if (logCallbackFmt[id]) { - msgCallbackFmt p = logCallbackFmt[id]; - va_copy(tmpargptr, argptr); - p(id, fmt, tmpargptr ); - } return true; } @@ -208,11 +197,6 @@ bool EQEmuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list va_copy(tmpargptr, argptr); vfprintf( fp[id], fmt, tmpargptr ); } - if (logCallbackPva[id]) { - msgCallbackPva p = logCallbackPva[id]; - va_copy(tmpargptr, argptr); - p(id, prefix, fmt, tmpargptr ); - } if (pLogStatus[id] & 2) { if (pLogStatus[id] & 8) { fprintf(stderr, "[%s] %s", LogNames[id], prefix); @@ -301,10 +285,6 @@ bool EQEmuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) fwrite(buf, size, count, fp[id]); fprintf(fp[id], "\n"); } - if (logCallbackBuf[id]) { - msgCallbackBuf p = logCallbackBuf[id]; - p(id, buf, size, count); - } if (pLogStatus[id] & 2) { if (pLogStatus[id] & 8) { fprintf(stderr, "[%s] ", LogNames[id]); @@ -442,7 +422,6 @@ void EQEmuLog::SetCallback(LogIDs id, msgCallbackFmt proc) if (id >= MaxLogID) { return; } - logCallbackFmt[id] = proc; } void EQEmuLog::SetCallback(LogIDs id, msgCallbackBuf proc) @@ -453,7 +432,6 @@ void EQEmuLog::SetCallback(LogIDs id, msgCallbackBuf proc) if (id >= MaxLogID) { return; } - logCallbackBuf[id] = proc; } void EQEmuLog::SetCallback(LogIDs id, msgCallbackPva proc) @@ -464,7 +442,6 @@ void EQEmuLog::SetCallback(LogIDs id, msgCallbackPva proc) if (id >= MaxLogID) { return; } - logCallbackPva[id] = proc; } void EQEmuLog::SetAllCallbacks(msgCallbackFmt proc) diff --git a/common/debug.h b/common/debug.h index da97fb0de..120b332de 100644 --- a/common/debug.h +++ b/common/debug.h @@ -123,9 +123,6 @@ private: */ uint8 pLogStatus[MaxLogID]; - msgCallbackFmt logCallbackFmt[MaxLogID]; - msgCallbackBuf logCallbackBuf[MaxLogID]; - msgCallbackPva logCallbackPva[MaxLogID]; }; extern EQEmuLog* LogFile; From ef4847555a5a64c406d5668d2c85e5f1594c5a0b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:19:19 -0600 Subject: [PATCH 120/707] Add 'Quests' Category --- common/debug.cpp | 2 +- common/eqemu_logsys.h | 2 ++ zone/embxs.cpp | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common/debug.cpp b/common/debug.cpp index 2bf685cbf..cd02b8005 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -226,7 +226,7 @@ bool EQEmuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list if (id == EQEmuLog::LogIDs::Crash){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } #endif - fprintf(stdout, "[%s] %s", LogNames[id], prefix); + fprintf(stdout, "[%s] %s", LogNames[id], prefix); vfprintf(stdout, fmt, argptr); #ifdef _WINDOWS diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d8ade655b..2ce906b41 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -74,6 +74,7 @@ public: Client_Server_Packet, Aggro, Attack, + Quests, MaxCategoryID /* Don't Remove this*/ }; @@ -139,6 +140,7 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Client_Server_Packet", "Aggro", "Attack", + "Quests" }; #endif \ No newline at end of file diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 784f8b1ba..2666665f2 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -98,6 +98,8 @@ XS(XS_EQEmuIO_PRINT) for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { LogFile->writebuf(EQEmuLog::Quest, str + pos, 1, len); + //logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + //std::cout << str << "LOLOL\n"; len = 0; pos = i+1; } else { @@ -106,6 +108,7 @@ XS(XS_EQEmuIO_PRINT) } if(len > 0) { LogFile->writebuf(EQEmuLog::Quest, str + pos, 1, len); + // logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str); } } From 1fcc1f619355a6b30f37d0360c4d1404dd666539 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:19:53 -0600 Subject: [PATCH 121/707] Convert Perl Quest Logging to the new system --- zone/embxs.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 2666665f2..e080d6a13 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -97,9 +97,7 @@ XS(XS_EQEmuIO_PRINT) int len = 0; for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { - LogFile->writebuf(EQEmuLog::Quest, str + pos, 1, len); - //logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); - //std::cout << str << "LOLOL\n"; + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); len = 0; pos = i+1; } else { @@ -107,8 +105,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - LogFile->writebuf(EQEmuLog::Quest, str + pos, 1, len); - // logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str); } } From d3de7c923780faaf7e10e6061ca5a4912d995763 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:21:53 -0600 Subject: [PATCH 122/707] Remove EQEmuLog writebuf --- common/debug.cpp | 77 ------------------------------------------------ common/debug.h | 2 -- 2 files changed, 79 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index cd02b8005..d31eb54dc 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -252,83 +252,6 @@ bool EQEmuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list return true; } -bool EQEmuLog::writebuf(LogIDs id, const char *buf, uint8 size, uint32 count) -{ - if (!logFileValid) { - return false; - } - if (id >= MaxLogID) { - return false; - } - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) { - return false; - } - LockMutex lock(&MLog[id]); - if (!logFileValid) { - return false; //check again for threading race reasons (to avoid two mutexes) - } - time_t aclock; - struct tm *newtime; - time( &aclock ); /* Get time in seconds */ - newtime = localtime( &aclock ); /* Convert time to struct */ - if (dofile) - #ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] ", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); - #else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] ", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec); - #endif - if (dofile) { - fwrite(buf, size, count, fp[id]); - fprintf(fp[id], "\n"); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "[%s] ", LogNames[id]); - fwrite(buf, size, count, stderr); - fprintf(stderr, "\n"); - } else { -#ifdef _WINDOWS - HANDLE console_handle; - console_handle = GetStdHandle(STD_OUTPUT_HANDLE); - - CONSOLE_FONT_INFOEX info = { 0 }; - info.cbSize = sizeof(info); - info.dwFontSize.Y = 12; // leave X as zero - info.FontWeight = FW_NORMAL; - wcscpy(info.FaceName, L"Lucida Console"); - SetCurrentConsoleFontEx(console_handle, NULL, &info); - - if (id == EQEmuLog::LogIDs::Status){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Error){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } - if (id == EQEmuLog::LogIDs::Normal){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightGreen); } - if (id == EQEmuLog::LogIDs::Debug){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightGreen); } - if (id == EQEmuLog::LogIDs::Quest){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightCyan); } - if (id == EQEmuLog::LogIDs::Commands){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightMagenta); } - if (id == EQEmuLog::LogIDs::Crash){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } -#endif - - fprintf(stdout, "[%s] ", LogNames[id]); - fwrite(buf, size, count, stdout); - fprintf(stdout, "\n"); - -#ifdef _WINDOWS - /* Always set back to white*/ - SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::White); -#endif - - - } - } - if (dofile) { - fflush(fp[id]); - } - return true; -} - bool EQEmuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) { va_list argptr, tmpargptr; diff --git a/common/debug.h b/common/debug.h index 120b332de..8127d85cb 100644 --- a/common/debug.h +++ b/common/debug.h @@ -102,8 +102,6 @@ public: void SetCallback(LogIDs id, msgCallbackFmt proc); void SetCallback(LogIDs id, msgCallbackBuf proc); void SetCallback(LogIDs id, msgCallbackPva proc); - - bool writebuf(LogIDs id, const char *buf, uint8 size, uint32 count); bool write(LogIDs id, const char *fmt, ...); bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args); bool Dump(LogIDs id, uint8* data, uint32 size, uint32 cols=16, uint32 skip=0); From 5161cb6bd288f6ebb05ab81f6b718247e2a91cf3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:23:50 -0600 Subject: [PATCH 123/707] Remove more old Callback code --- common/debug.cpp | 63 ------------------------------------------------ common/debug.h | 11 --------- 2 files changed, 74 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index d31eb54dc..136c4ddf0 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -337,66 +337,3 @@ bool EQEmuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 ski return true; } -void EQEmuLog::SetCallback(LogIDs id, msgCallbackFmt proc) -{ - if (!logFileValid) { - return; - } - if (id >= MaxLogID) { - return; - } -} - -void EQEmuLog::SetCallback(LogIDs id, msgCallbackBuf proc) -{ - if (!logFileValid) { - return; - } - if (id >= MaxLogID) { - return; - } -} - -void EQEmuLog::SetCallback(LogIDs id, msgCallbackPva proc) -{ - if (!logFileValid) { - return; - } - if (id >= MaxLogID) { - return; - } -} - -void EQEmuLog::SetAllCallbacks(msgCallbackFmt proc) -{ - if (!logFileValid) { - return; - } - int r; - for (r = Status; r < MaxLogID; r++) { - SetCallback((LogIDs)r, proc); - } -} - -void EQEmuLog::SetAllCallbacks(msgCallbackBuf proc) -{ - if (!logFileValid) { - return; - } - int r; - for (r = Status; r < MaxLogID; r++) { - SetCallback((LogIDs)r, proc); - } -} - -void EQEmuLog::SetAllCallbacks(msgCallbackPva proc) -{ - if (!logFileValid) { - return; - } - int r; - for (r = Status; r < MaxLogID; r++) { - SetCallback((LogIDs)r, proc); - } -} - diff --git a/common/debug.h b/common/debug.h index 8127d85cb..85894ba59 100644 --- a/common/debug.h +++ b/common/debug.h @@ -91,17 +91,6 @@ public: MaxLogID /* Max, used in functions to get the max log ID */ }; - //these are callbacks called for each - typedef void (* msgCallbackBuf)(LogIDs id, const char *buf, uint8 size, uint32 count); - typedef void (* msgCallbackFmt)(LogIDs id, const char *fmt, va_list ap); - typedef void (* msgCallbackPva)(LogIDs id, const char *prefix, const char *fmt, va_list ap); - - void SetAllCallbacks(msgCallbackFmt proc); - void SetAllCallbacks(msgCallbackBuf proc); - void SetAllCallbacks(msgCallbackPva proc); - void SetCallback(LogIDs id, msgCallbackFmt proc); - void SetCallback(LogIDs id, msgCallbackBuf proc); - void SetCallback(LogIDs id, msgCallbackPva proc); bool write(LogIDs id, const char *fmt, ...); bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args); bool Dump(LogIDs id, uint8* data, uint32 size, uint32 cols=16, uint32 skip=0); From a4dbe13c3d6412094aa2adce5a3e20b40c61ef81 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:26:37 -0600 Subject: [PATCH 124/707] Remove EQEmuLog::Dump --- common/debug.cpp | 69 +----------------------------------------------- common/debug.h | 1 - 2 files changed, 1 insertion(+), 69 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 136c4ddf0..fc7a4cc16 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -269,71 +269,4 @@ bool EQEmuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) } va_end(argptr); return true; -}; - -bool EQEmuLog::Dump(LogIDs id, uint8* data, uint32 size, uint32 cols, uint32 skip) -{ - if (!logFileValid) { - logger.LogDebug(EQEmuLogSys::Detail, "Error: Dump() from null pointer"); - return false; - } - if (size == 0) { - return true; - } - if (!LogFile) { - return false; - } - if (id >= MaxLogID) { - return false; - } - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) { - return false; - } - LockMutex lock(&MLog[id]); - if (!logFileValid) { - return false; //check again for threading race reasons (to avoid two mutexes) - } - write(id, "Dumping Packet: %i", size); - // Output as HEX - int beginningOfLineOffset = 0; - uint32 indexInData; - std::string asciiOutput; - for (indexInData = skip; indexInData < size; indexInData++) { - if ((indexInData - skip) % cols == 0) { - if (indexInData != skip) { - writeNTS(id, dofile, " | %s\n", asciiOutput.c_str()); - } - writeNTS(id, dofile, "%4i: ", indexInData - skip); - asciiOutput.clear(); - beginningOfLineOffset = 0; - } else if ((indexInData - skip) % (cols / 2) == 0) { - writeNTS(id, dofile, "- "); - } - writeNTS(id, dofile, "%02X ", (unsigned char)data[indexInData]); - if (data[indexInData] >= 32 && data[indexInData] < 127) { - // According to http://msdn.microsoft.com/en-us/library/vstudio/ee404875(v=vs.100).aspx - // Visual Studio 2010 doesn't have std::to_string(int) but it does have the long long - // version. - asciiOutput.append(std::to_string((long long)data[indexInData])); - } else { - asciiOutput.append("."); - } - } - uint32 k = ((indexInData - skip) - 1) % cols; - if (k < 8) { - writeNTS(id, dofile, " "); - } - for (uint32 h = k + 1; h < cols; h++) { - writeNTS(id, dofile, " "); - } - writeNTS(id, dofile, " | %s\n", asciiOutput.c_str()); - if (dofile) { - fflush(fp[id]); - } - return true; -} - +}; \ No newline at end of file diff --git a/common/debug.h b/common/debug.h index 85894ba59..5c32eadce 100644 --- a/common/debug.h +++ b/common/debug.h @@ -93,7 +93,6 @@ public: bool write(LogIDs id, const char *fmt, ...); bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args); - bool Dump(LogIDs id, uint8* data, uint32 size, uint32 cols=16, uint32 skip=0); private: bool open(LogIDs id); bool writeNTS(LogIDs id, bool dofile, const char *fmt, ...); // no error checking, assumes is open, no locking, no timestamp, no newline From 50b686b16283aec5994264d6d59a60ed0c6379f5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:30:41 -0600 Subject: [PATCH 125/707] Remove debug.cpp/.h files and from CMakeLists.txt --- common/CMakeLists.txt | 2 - common/debug.cpp | 272 ------------------------------------------ common/debug.h | 132 -------------------- 3 files changed, 406 deletions(-) delete mode 100644 common/debug.cpp delete mode 100644 common/debug.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2a98f5cfb..489c5e7de 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -9,7 +9,6 @@ SET(common_sources crc32.cpp database.cpp dbcore.cpp - debug.cpp emu_opcodes.cpp emu_tcp_connection.cpp emu_tcp_server.cpp @@ -107,7 +106,6 @@ SET(common_headers data_verification.h database.h dbcore.h - debug.h deity.h emu_opcodes.h emu_oplist.h diff --git a/common/debug.cpp b/common/debug.cpp deleted file mode 100644 index fc7a4cc16..000000000 --- a/common/debug.cpp +++ /dev/null @@ -1,272 +0,0 @@ -#include -#include - -#ifdef _WINDOWS - #include - - #define snprintf _snprintf - #define vsnprintf _vsnprintf - #define strncasecmp _strnicmp - #define strcasecmp _stricmp - - #include - #include - #include - -namespace ConsoleColor { - enum Colors { - Black = 0, - Blue = 1, - Green = 2, - Cyan = 3, - Red = 4, - Magenta = 5, - Brown = 6, - LightGray = 7, - DarkGray = 8, - LightBlue = 9, - LightGreen = 10, - LightCyan = 11, - LightRed = 12, - LightMagenta = 13, - Yellow = 14, - White = 15, - }; -} - -#else - - #include - #include - -#endif - -#include "eqemu_logsys.h" -#include "debug.h" -#include "misc_functions.h" -#include "platform.h" -#include "eqemu_logsys.h" -#include "string_util.h" - -#ifndef va_copy - #define va_copy(d,s) ((d) = (s)) -#endif - -static volatile bool logFileValid = false; -static EQEmuLog realLogFile; -EQEmuLog *LogFile = &realLogFile; - -static const char* FileNames[EQEmuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" }; -static const char* LogNames[EQEmuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" }; - -EQEmuLog::EQEmuLog() -{ - pLogStatus[EQEmuLog::LogIDs::Status] = LOG_LEVEL_STATUS; - pLogStatus[EQEmuLog::LogIDs::Normal] = LOG_LEVEL_NORMAL; - pLogStatus[EQEmuLog::LogIDs::Error] = LOG_LEVEL_ERROR; - pLogStatus[EQEmuLog::LogIDs::Debug] = LOG_LEVEL_DEBUG; - pLogStatus[EQEmuLog::LogIDs::Quest] = LOG_LEVEL_QUEST; - pLogStatus[EQEmuLog::LogIDs::Commands] = LOG_LEVEL_COMMANDS; - pLogStatus[EQEmuLog::LogIDs::Crash] = LOG_LEVEL_CRASH; - logFileValid = true; -} - -EQEmuLog::~EQEmuLog() -{ - logFileValid = false; - for (int i = 0; i < MaxLogID; i++) { - LockMutex lock(&MLog[i]); //to prevent termination race - if (fp[i]) { - fclose(fp[i]); - } - } -} - -bool EQEmuLog::open(LogIDs id) -{ - if (!logFileValid) { - return false; - } - if (id >= MaxLogID) { - return false; - } - LockMutex lock(&MOpen); - if (pLogStatus[id] & 4) { - return false; - } - if (fp[id]) { - //cerr<<"Warning: LogFile already open"<= MaxLogID) { - return false; - } - - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) { - return false; - } - LockMutex lock(&MLog[id]); - if (!logFileValid) { - return false; //check again for threading race reasons (to avoid two mutexes) - } - - va_list argptr, tmpargptr; - va_start(argptr, fmt); - - logger.Log(id, vStringFormat(fmt, argptr).c_str()); - - return true; -} - -//write with Prefix and a VA_list -bool EQEmuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) -{ - if (!logFileValid) { - return false; - } - if (id >= MaxLogID) { - return false; - } - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) { - return false; - } - LockMutex lock(&MLog[id]); - if (!logFileValid) { - return false; //check again for threading race reasons (to avoid two mutexes) - } - time_t aclock; - struct tm *newtime; - time( &aclock ); /* Get time in seconds */ - newtime = localtime( &aclock ); /* Convert time to struct */ - va_list tmpargptr; - if (dofile) { - #ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); - #else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] %s", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); - #endif - va_copy(tmpargptr, argptr); - vfprintf( fp[id], fmt, tmpargptr ); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "[%s] %s", LogNames[id], prefix); - vfprintf( stderr, fmt, argptr ); - } - /* Console Output */ - else { - - -#ifdef _WINDOWS - HANDLE console_handle; - console_handle = GetStdHandle(STD_OUTPUT_HANDLE); - - CONSOLE_FONT_INFOEX info = { 0 }; - info.cbSize = sizeof(info); - info.dwFontSize.Y = 12; // leave X as zero - info.FontWeight = FW_NORMAL; - wcscpy(info.FaceName, L"Lucida Console"); - SetCurrentConsoleFontEx(console_handle, NULL, &info); - - if (id == EQEmuLog::LogIDs::Status){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Error){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } - if (id == EQEmuLog::LogIDs::Normal){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightGreen); } - if (id == EQEmuLog::LogIDs::Debug){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Quest){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightCyan); } - if (id == EQEmuLog::LogIDs::Commands){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightMagenta); } - if (id == EQEmuLog::LogIDs::Crash){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } -#endif - - fprintf(stdout, "[%s] %s", LogNames[id], prefix); - vfprintf(stdout, fmt, argptr); - -#ifdef _WINDOWS - /* Always set back to white*/ - SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::White); -#endif - } - } - va_end(argptr); - if (dofile) { - fprintf(fp[id], "\n"); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "\n"); - } else { - fprintf(stdout, "\n"); - } - } - if (dofile) { - fflush(fp[id]); - } - return true; -} - -bool EQEmuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) -{ - va_list argptr, tmpargptr; - va_start(argptr, fmt); - if (dofile) { - va_copy(tmpargptr, argptr); - vfprintf( fp[id], fmt, tmpargptr ); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - vfprintf( stderr, fmt, argptr ); - } else { - vfprintf( stdout, fmt, argptr ); - } - } - va_end(argptr); - return true; -}; \ No newline at end of file diff --git a/common/debug.h b/common/debug.h deleted file mode 100644 index 5c32eadce..000000000 --- a/common/debug.h +++ /dev/null @@ -1,132 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) - - 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 -*/ - -// Debug Levels -#ifndef EQDEBUG -#define EQDEBUG 1 -#else -////// File/Console options -// 0 <= Quiet mode Errors to file Status and Normal ignored -// 1 >= Status and Normal to console, Errors to file -// 2 >= Status, Normal, and Error to console and logfile -// 3 >= Lite debug -// 4 >= Medium debug -// 5 >= Debug release (Anything higher is not recommended for regular use) -// 6 == (Reserved for special builds) Login opcode debug All packets dumped -// 7 == (Reserved for special builds) Chat Opcode debug All packets dumped -// 8 == (Reserved for special builds) World opcode debug All packets dumped -// 9 == (Reserved for special builds) Zone Opcode debug All packets dumped -// 10 >= More than you ever wanted to know -// -///// -// Add more below to reserve for file's functions ect. -///// -// Any setup code based on defines should go here -// -#endif - - -#if defined(_DEBUG) && defined(WIN32) - #ifndef _CRTDBG_MAP_ALLOC - #include - #include - #endif -#endif - -#ifndef EQDEBUG_H -#define EQDEBUG_H - -#ifndef _WINDOWS - #define DebugBreak() if(0) {} -#endif - -#define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues -#if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) ) - // Packet Collector on win32 requires winsock.h due to latest pcap.h - // winsock.h must come before windows.h - #include -#endif - -#ifdef _WINDOWS - #include - #include -#endif - -#include "logsys.h" - -#include "../common/mutex.h" -#include -#include - - -class EQEmuLog { -public: - EQEmuLog(); - ~EQEmuLog(); - - enum LogIDs { - Status = 0, /* This must stay the first entry in this list */ - Normal, /* Normal Logs */ - Error, /* Error Logs */ - Debug, /* Debug Logs */ - Quest, /* Quest Logs */ - Commands, /* Issued Comamnds */ - Crash, /* Crash Logs */ - Save, /* Client Saves */ - MaxLogID /* Max, used in functions to get the max log ID */ - }; - - bool write(LogIDs id, const char *fmt, ...); - bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args); -private: - bool open(LogIDs id); - bool writeNTS(LogIDs id, bool dofile, const char *fmt, ...); // no error checking, assumes is open, no locking, no timestamp, no newline - - Mutex MOpen; - Mutex MLog[MaxLogID]; - FILE* fp[MaxLogID]; - -/* LogStatus: bitwise variable - 1 = output to file - 2 = output to stdout - 4 = fopen error, dont retry - 8 = use stderr instead (2 must be set) -*/ - uint8 pLogStatus[MaxLogID]; - -}; - -extern EQEmuLog* LogFile; - -#ifdef _EQDEBUG -class PerformanceMonitor { -public: - PerformanceMonitor(int64* ip) { - p = ip; - QueryPerformanceCounter(&tmp); - } - ~PerformanceMonitor() { - LARGE_INTEGER tmp2; - QueryPerformanceCounter(&tmp2); - *p += tmp2.QuadPart - tmp.QuadPart; - } - LARGE_INTEGER tmp; - int64* p; -}; -#endif -#endif From 7c78cf5ab70f0b020364a0d998b1fe8fb99b268f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:39:51 -0600 Subject: [PATCH 126/707] More debug changes --- common/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 489c5e7de..2a98f5cfb 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -9,6 +9,7 @@ SET(common_sources crc32.cpp database.cpp dbcore.cpp + debug.cpp emu_opcodes.cpp emu_tcp_connection.cpp emu_tcp_server.cpp @@ -106,6 +107,7 @@ SET(common_headers data_verification.h database.h dbcore.h + debug.h deity.h emu_opcodes.h emu_oplist.h From 79ac3f9b44afe1b0a6b0cbad8b5175416b6a17ce Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:40:47 -0600 Subject: [PATCH 127/707] added debug.cpp/.h back in temporarily because of stupid dependencies --- common/debug.cpp | 272 +++++++++++++++++++++++++++++++++++++++++++++++ common/debug.h | 132 +++++++++++++++++++++++ 2 files changed, 404 insertions(+) create mode 100644 common/debug.cpp create mode 100644 common/debug.h diff --git a/common/debug.cpp b/common/debug.cpp new file mode 100644 index 000000000..fc7a4cc16 --- /dev/null +++ b/common/debug.cpp @@ -0,0 +1,272 @@ +#include +#include + +#ifdef _WINDOWS + #include + + #define snprintf _snprintf + #define vsnprintf _vsnprintf + #define strncasecmp _strnicmp + #define strcasecmp _stricmp + + #include + #include + #include + +namespace ConsoleColor { + enum Colors { + Black = 0, + Blue = 1, + Green = 2, + Cyan = 3, + Red = 4, + Magenta = 5, + Brown = 6, + LightGray = 7, + DarkGray = 8, + LightBlue = 9, + LightGreen = 10, + LightCyan = 11, + LightRed = 12, + LightMagenta = 13, + Yellow = 14, + White = 15, + }; +} + +#else + + #include + #include + +#endif + +#include "eqemu_logsys.h" +#include "debug.h" +#include "misc_functions.h" +#include "platform.h" +#include "eqemu_logsys.h" +#include "string_util.h" + +#ifndef va_copy + #define va_copy(d,s) ((d) = (s)) +#endif + +static volatile bool logFileValid = false; +static EQEmuLog realLogFile; +EQEmuLog *LogFile = &realLogFile; + +static const char* FileNames[EQEmuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" }; +static const char* LogNames[EQEmuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" }; + +EQEmuLog::EQEmuLog() +{ + pLogStatus[EQEmuLog::LogIDs::Status] = LOG_LEVEL_STATUS; + pLogStatus[EQEmuLog::LogIDs::Normal] = LOG_LEVEL_NORMAL; + pLogStatus[EQEmuLog::LogIDs::Error] = LOG_LEVEL_ERROR; + pLogStatus[EQEmuLog::LogIDs::Debug] = LOG_LEVEL_DEBUG; + pLogStatus[EQEmuLog::LogIDs::Quest] = LOG_LEVEL_QUEST; + pLogStatus[EQEmuLog::LogIDs::Commands] = LOG_LEVEL_COMMANDS; + pLogStatus[EQEmuLog::LogIDs::Crash] = LOG_LEVEL_CRASH; + logFileValid = true; +} + +EQEmuLog::~EQEmuLog() +{ + logFileValid = false; + for (int i = 0; i < MaxLogID; i++) { + LockMutex lock(&MLog[i]); //to prevent termination race + if (fp[i]) { + fclose(fp[i]); + } + } +} + +bool EQEmuLog::open(LogIDs id) +{ + if (!logFileValid) { + return false; + } + if (id >= MaxLogID) { + return false; + } + LockMutex lock(&MOpen); + if (pLogStatus[id] & 4) { + return false; + } + if (fp[id]) { + //cerr<<"Warning: LogFile already open"<= MaxLogID) { + return false; + } + + bool dofile = false; + if (pLogStatus[id] & 1) { + dofile = open(id); + } + if (!(dofile || pLogStatus[id] & 2)) { + return false; + } + LockMutex lock(&MLog[id]); + if (!logFileValid) { + return false; //check again for threading race reasons (to avoid two mutexes) + } + + va_list argptr, tmpargptr; + va_start(argptr, fmt); + + logger.Log(id, vStringFormat(fmt, argptr).c_str()); + + return true; +} + +//write with Prefix and a VA_list +bool EQEmuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) +{ + if (!logFileValid) { + return false; + } + if (id >= MaxLogID) { + return false; + } + bool dofile = false; + if (pLogStatus[id] & 1) { + dofile = open(id); + } + if (!(dofile || pLogStatus[id] & 2)) { + return false; + } + LockMutex lock(&MLog[id]); + if (!logFileValid) { + return false; //check again for threading race reasons (to avoid two mutexes) + } + time_t aclock; + struct tm *newtime; + time( &aclock ); /* Get time in seconds */ + newtime = localtime( &aclock ); /* Convert time to struct */ + va_list tmpargptr; + if (dofile) { + #ifndef NO_PIDLOG + fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); + #else + fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] %s", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); + #endif + va_copy(tmpargptr, argptr); + vfprintf( fp[id], fmt, tmpargptr ); + } + if (pLogStatus[id] & 2) { + if (pLogStatus[id] & 8) { + fprintf(stderr, "[%s] %s", LogNames[id], prefix); + vfprintf( stderr, fmt, argptr ); + } + /* Console Output */ + else { + + +#ifdef _WINDOWS + HANDLE console_handle; + console_handle = GetStdHandle(STD_OUTPUT_HANDLE); + + CONSOLE_FONT_INFOEX info = { 0 }; + info.cbSize = sizeof(info); + info.dwFontSize.Y = 12; // leave X as zero + info.FontWeight = FW_NORMAL; + wcscpy(info.FaceName, L"Lucida Console"); + SetCurrentConsoleFontEx(console_handle, NULL, &info); + + if (id == EQEmuLog::LogIDs::Status){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } + if (id == EQEmuLog::LogIDs::Error){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } + if (id == EQEmuLog::LogIDs::Normal){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightGreen); } + if (id == EQEmuLog::LogIDs::Debug){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } + if (id == EQEmuLog::LogIDs::Quest){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightCyan); } + if (id == EQEmuLog::LogIDs::Commands){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightMagenta); } + if (id == EQEmuLog::LogIDs::Crash){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } +#endif + + fprintf(stdout, "[%s] %s", LogNames[id], prefix); + vfprintf(stdout, fmt, argptr); + +#ifdef _WINDOWS + /* Always set back to white*/ + SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::White); +#endif + } + } + va_end(argptr); + if (dofile) { + fprintf(fp[id], "\n"); + } + if (pLogStatus[id] & 2) { + if (pLogStatus[id] & 8) { + fprintf(stderr, "\n"); + } else { + fprintf(stdout, "\n"); + } + } + if (dofile) { + fflush(fp[id]); + } + return true; +} + +bool EQEmuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) +{ + va_list argptr, tmpargptr; + va_start(argptr, fmt); + if (dofile) { + va_copy(tmpargptr, argptr); + vfprintf( fp[id], fmt, tmpargptr ); + } + if (pLogStatus[id] & 2) { + if (pLogStatus[id] & 8) { + vfprintf( stderr, fmt, argptr ); + } else { + vfprintf( stdout, fmt, argptr ); + } + } + va_end(argptr); + return true; +}; \ No newline at end of file diff --git a/common/debug.h b/common/debug.h new file mode 100644 index 000000000..5c32eadce --- /dev/null +++ b/common/debug.h @@ -0,0 +1,132 @@ +/* EQEMu: Everquest Server Emulator + Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) + + 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 +*/ + +// Debug Levels +#ifndef EQDEBUG +#define EQDEBUG 1 +#else +////// File/Console options +// 0 <= Quiet mode Errors to file Status and Normal ignored +// 1 >= Status and Normal to console, Errors to file +// 2 >= Status, Normal, and Error to console and logfile +// 3 >= Lite debug +// 4 >= Medium debug +// 5 >= Debug release (Anything higher is not recommended for regular use) +// 6 == (Reserved for special builds) Login opcode debug All packets dumped +// 7 == (Reserved for special builds) Chat Opcode debug All packets dumped +// 8 == (Reserved for special builds) World opcode debug All packets dumped +// 9 == (Reserved for special builds) Zone Opcode debug All packets dumped +// 10 >= More than you ever wanted to know +// +///// +// Add more below to reserve for file's functions ect. +///// +// Any setup code based on defines should go here +// +#endif + + +#if defined(_DEBUG) && defined(WIN32) + #ifndef _CRTDBG_MAP_ALLOC + #include + #include + #endif +#endif + +#ifndef EQDEBUG_H +#define EQDEBUG_H + +#ifndef _WINDOWS + #define DebugBreak() if(0) {} +#endif + +#define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues +#if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) ) + // Packet Collector on win32 requires winsock.h due to latest pcap.h + // winsock.h must come before windows.h + #include +#endif + +#ifdef _WINDOWS + #include + #include +#endif + +#include "logsys.h" + +#include "../common/mutex.h" +#include +#include + + +class EQEmuLog { +public: + EQEmuLog(); + ~EQEmuLog(); + + enum LogIDs { + Status = 0, /* This must stay the first entry in this list */ + Normal, /* Normal Logs */ + Error, /* Error Logs */ + Debug, /* Debug Logs */ + Quest, /* Quest Logs */ + Commands, /* Issued Comamnds */ + Crash, /* Crash Logs */ + Save, /* Client Saves */ + MaxLogID /* Max, used in functions to get the max log ID */ + }; + + bool write(LogIDs id, const char *fmt, ...); + bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args); +private: + bool open(LogIDs id); + bool writeNTS(LogIDs id, bool dofile, const char *fmt, ...); // no error checking, assumes is open, no locking, no timestamp, no newline + + Mutex MOpen; + Mutex MLog[MaxLogID]; + FILE* fp[MaxLogID]; + +/* LogStatus: bitwise variable + 1 = output to file + 2 = output to stdout + 4 = fopen error, dont retry + 8 = use stderr instead (2 must be set) +*/ + uint8 pLogStatus[MaxLogID]; + +}; + +extern EQEmuLog* LogFile; + +#ifdef _EQDEBUG +class PerformanceMonitor { +public: + PerformanceMonitor(int64* ip) { + p = ip; + QueryPerformanceCounter(&tmp); + } + ~PerformanceMonitor() { + LARGE_INTEGER tmp2; + QueryPerformanceCounter(&tmp2); + *p += tmp2.QuadPart - tmp.QuadPart; + } + LARGE_INTEGER tmp; + int64* p; +}; +#endif +#endif From d21466566ef11a78b56f5c146b4ea313ee160f55 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:53:56 -0600 Subject: [PATCH 128/707] Remove some mlog related functions in Mob:: --- zone/entity.cpp | 29 ----------------------------- zone/entity.h | 2 -- zone/mob.h | 6 ------ 3 files changed, 37 deletions(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 7b85b286b..d3b95e7f5 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3538,35 +3538,6 @@ bool EntityList::LimitCheckName(const char *npc_name) return true; } -void EntityList::RadialSetLogging(Mob *around, bool enabled, bool clients, - bool non_clients, float range) -{ - float range2 = range * range; - - auto it = mob_list.begin(); - while (it != mob_list.end()) { - Mob *mob = it->second; - - ++it; - - if (mob->IsClient()) { - if (!clients) - continue; - } else { - if (!non_clients) - continue; - } - - if (around->DistNoRoot(*mob) > range2) - continue; - - if (enabled) - mob->EnableLogging(); - else - mob->DisableLogging(); - } -} - void EntityList::UpdateHoTT(Mob *target) { auto it = client_list.begin(); diff --git a/zone/entity.h b/zone/entity.h index 88f5257f7..69cb0208b 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -318,8 +318,6 @@ public: void MassGroupBuff(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true); void AEBardPulse(Mob *caster, Mob *center, uint16 spell_id, bool affect_caster = true); - void RadialSetLogging(Mob *around, bool enabled, bool clients, bool non_clients, float range = 0); - //trap stuff Mob* GetTrapTrigger(Trap* trap); void SendAlarm(Trap* trap, Mob* currenttarget, uint8 kos); diff --git a/zone/mob.h b/zone/mob.h index 5997ffeae..b994f519b 100644 --- a/zone/mob.h +++ b/zone/mob.h @@ -535,12 +535,6 @@ public: bool HasProcs() const; bool IsCombatProc(uint16 spell_id); - //Logging - bool IsLoggingEnabled() const { return(logging_enabled); } - void EnableLogging() { logging_enabled = true; } - void DisableLogging() { logging_enabled = false; } - - //More stuff to sort: virtual bool IsRaidTarget() const { return false; }; virtual bool IsAttackAllowed(Mob *target, bool isSpellAttack = false); From 2bc6ed17c76e06fb0677efb54312308089e27d84 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:54:51 -0600 Subject: [PATCH 129/707] Remove command_mlog --- zone/command.cpp | 160 ----------------------------------------------- zone/command.h | 1 - 2 files changed, 161 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 35ca539e8..df31b604b 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -366,7 +366,6 @@ int command_init(void) { command_add("path","- view and edit pathing",200,command_path) || command_add("flags","- displays the flags of you or your target",0,command_flags) || command_add("flagedit","- Edit zone flags on your target",100,command_flagedit) || - command_add("mlog","- Manage log settings",250,command_mlog) || command_add("aggro","(range) [-v] - Display aggro information for all mobs 'range' distance from your target. -v is verbose faction info.",80,command_aggro) || command_add("hatelist"," - Display hate list for target.", 80,command_hatelist) || command_add("aggrozone","[aggro] - Aggro every mob in the zone with X aggro. Default is 0. Not recommend if you're not invulnerable.",100,command_aggrozone) || @@ -7444,165 +7443,6 @@ void command_flagedit(Client *c, const Seperator *sep) { c->Message(15, "Invalid action specified. use '#flagedit help' for help"); } -void command_mlog(Client *c, const Seperator *sep) { - //super-command for managing log settings - if(sep->arg[1][0] == '\0' || !strcasecmp(sep->arg[1], "help")) { - c->Message(0, "Syntax: #mlog [subcommand]."); - c->Message(0, "-- Mob Logging Togglers --"); - c->Message(0, "...target [on|off] - Set logging enabled for your target"); - c->Message(0, "...all [on|off] - Set logging enabled for all mobs and clients (prolly a bad idea)"); - c->Message(0, "...mobs [on|off] - Set logging enabled for all mobs"); - c->Message(0, "...clients [on|off] - Set logging enabled for all clients"); - c->Message(0, "...radius [on|off] [radius] - Set logging enable for all mobs and clients within `radius`"); - c->Message(0, "-------------"); - c->Message(0, "-- Log Settings --"); - c->Message(0, "...list [category] - List all log types in specified category, or all categories if none specified."); - c->Message(0, "...setcat [category] [on|off] - Enable/Disable all types in a specified category"); - c->Message(0, "...set [type] [on|off] - Enable/Disable the specified log type"); - c->Message(0, "...load [filename] - Load log type settings from the file `filename`"); - return; - } - bool onoff; - std::string on("on"); - std::string off("off"); - - if(!strcasecmp(sep->arg[1], "target")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument. Expected on/off."); return; } - - Mob *tgt = c->GetTarget(); - if(tgt == nullptr) { - c->Message(13, "You must have a target for this command."); - return; - } - - if(onoff) - tgt->EnableLogging(); - else - tgt->DisableLogging(); - - c->Message(0, "Logging has been enabled on %s", tgt->GetName()); - } else if(!strcasecmp(sep->arg[1], "all")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - entity_list.RadialSetLogging(c, onoff, true, true); - - c->Message(0, "Logging has been enabled for all entities"); - } else if(!strcasecmp(sep->arg[1], "mobs")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - entity_list.RadialSetLogging(c, onoff, false, true); - - c->Message(0, "Logging has been enabled for all mobs"); - } else if(!strcasecmp(sep->arg[1], "clients")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - entity_list.RadialSetLogging(c, onoff, true, false); - - c->Message(0, "Logging has been enabled for all clients"); - } else if(!strcasecmp(sep->arg[1], "radius")) { - if(on == sep->arg[2]) onoff = true; - else if(off == sep->arg[2]) onoff = false; - else { c->Message(13, "Invalid argument '%s'. Expected on/off.", sep->arg[2]); return; } - - float radius = atof(sep->arg[3]); - if(radius <= 0) { - c->Message(13, "Invalid radius %f", radius); - return; - } - - entity_list.RadialSetLogging(c, onoff, false, true, radius); - - c->Message(0, "Logging has been enabled for all entities within %f", radius); - } else if(!strcasecmp(sep->arg[1], "list")) { - int r; - if(sep->arg[2][0] == '\0') { - c->Message(0, "Listing all log categories:"); - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - c->Message(0, "Category %d: %s", r, log_category_names[r]); - } - } else { - //first we have to find the category ID. - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - if(!strcasecmp(log_category_names[r], sep->arg[2])) - break; - } - if(r == NUMBER_OF_LOG_CATEGORIES) { - c->Message(13, "Unable to find category '%s'", sep->arg[2]); - return; - } - int logcat = r; - c->Message(0, "Types for category %d: %s", logcat, log_category_names[logcat]); - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(log_type_info[r].category != logcat) - continue; - c->Message(0, "...%d: %s (%s)", r, log_type_info[r].name, is_log_enabled(LogType(r))?"enabled":"disabled"); - } - } - } else if(!strcasecmp(sep->arg[1], "setcat")) { - if(on == sep->arg[3]) onoff = true; - else if(off == sep->arg[3]) onoff = false; - else { c->Message(13, "Invalid argument %s. Expected on/off.", sep->arg[3]); return; } - - int r; - //first we have to find the category ID. - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - if(!strcasecmp(log_category_names[r], sep->arg[2])) - break; - } - if(r == NUMBER_OF_LOG_CATEGORIES) { - c->Message(13, "Unable to find category '%s'", sep->arg[2]); - return; - } - - LogCategory logcat = LogCategory(r); - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(log_type_info[r].category != logcat) - continue; - - if(onoff) { - log_enable(LogType(r)); - c->Message(0, "Log type %s (%d) has been enabled", log_type_info[r].name, r); - } else { - log_disable(LogType(r)); - c->Message(0, "Log type %s (%d) has been disabled", log_type_info[r].name, r); - } - } - } else if(!strcasecmp(sep->arg[1], "set")) { - if(on == sep->arg[3]) onoff = true; - else if(off == sep->arg[3]) onoff = false; - else { c->Message(13, "Invalid argument %s. Expected on/off.", sep->arg[3]); return; } - - //first we have to find the category ID. - int r; - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(!strcasecmp(log_type_info[r].name, sep->arg[2])) - break; - } - if(r == NUMBER_OF_LOG_TYPES) { - c->Message(13, "Unable to find log type %s", sep->arg[2]); - return; - } - - if(onoff) { - log_enable(LogType(r)); - c->Message(0, "Log type %s (%d) has been enabled", log_type_info[r].name, r); - } else { - log_disable(LogType(r)); - c->Message(0, "Log type %s (%d) has been disabled", log_type_info[r].name, r); - } - } else { - c->Message(15, "Invalid action specified. use '#mlog help' for help"); - } -} - void command_serverrules(Client *c, const Seperator *sep) { c->SendRules(c); diff --git a/zone/command.h b/zone/command.h index c3825a66a..ab32bfd5e 100644 --- a/zone/command.h +++ b/zone/command.h @@ -269,7 +269,6 @@ void command_aggrozone(Client *c, const Seperator *sep); void command_reloadstatic(Client *c, const Seperator *sep); void command_flags(Client *c, const Seperator *sep); void command_flagedit(Client *c, const Seperator *sep); -void command_mlog(Client *c, const Seperator *sep); void command_serverrules(Client *c, const Seperator *sep); void command_acceptrules(Client *c, const Seperator *sep); void command_guildcreate(Client *c, const Seperator *sep); From a6c521a73e88d6fcb6e8c4f1a5d2550bed2259b3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 21:58:08 -0600 Subject: [PATCH 130/707] Keep mlog happy until it is completely replaced --- common/logsys.h | 2 +- zone/zone_logsys.cpp | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/common/logsys.h b/common/logsys.h index 84741cdb4..f6a23e5db 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -159,7 +159,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); extern void log_packet_mob(LogType type, Mob *who, const BasePacket *p); #define mpkt( type, packet) \ do { \ - if(IsLoggingEnabled()) \ + if(1) \ if(log_type_info[ type ].enabled) { \ log_packet_mob(type, this, packet); \ } \ diff --git a/zone/zone_logsys.cpp b/zone/zone_logsys.cpp index 50362c6b1..10d563de7 100644 --- a/zone/zone_logsys.cpp +++ b/zone/zone_logsys.cpp @@ -25,8 +25,8 @@ #include void log_message_mob(LogType type, Mob *who, const char *fmt, ...) { - if(!who->IsLoggingEnabled()) - return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common + // if(!who->IsLoggingEnabled()) + // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common char prefix_buffer[256]; snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName()); @@ -39,8 +39,8 @@ void log_message_mob(LogType type, Mob *who, const char *fmt, ...) { } void log_message_mobVA(LogType type, Mob *who, const char *fmt, va_list args) { - if(!who->IsLoggingEnabled()) - return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common + // if(!who->IsLoggingEnabled()) + // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common char prefix_buffer[256]; snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName()); @@ -50,15 +50,15 @@ void log_message_mobVA(LogType type, Mob *who, const char *fmt, va_list args) { } void log_hex_mob(LogType type, Mob *who, const char *data, uint32 length, uint8 padding) { - if(!who->IsLoggingEnabled()) - return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common + // if(!who->IsLoggingEnabled()) + // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common log_hex(type,data,length,padding); } void log_packet_mob(LogType type, Mob *who, const BasePacket *p) { - if(!who->IsLoggingEnabled()) - return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common + // if(!who->IsLoggingEnabled()) + // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common char buffer[80]; p->build_header_dump(buffer); From 449c12d6c267395ebaed97b6b9493c3f8fd81096 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 22:04:40 -0600 Subject: [PATCH 131/707] Delete mpkt and some calls to it --- common/logsys.h | 8 -------- zone/client_packet.cpp | 4 +--- 2 files changed, 1 insertion(+), 11 deletions(-) diff --git a/common/logsys.h b/common/logsys.h index f6a23e5db..9b3da9aa2 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -156,14 +156,6 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); log_hex_mob(type, this, data, len); \ } \ } while(false) - extern void log_packet_mob(LogType type, Mob *who, const BasePacket *p); - #define mpkt( type, packet) \ - do { \ - if(1) \ - if(log_type_info[ type ].enabled) { \ - log_packet_mob(type, this, packet); \ - } \ - } while(false) #endif extern void log_enable(LogType t); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index a18438f5c..aeb689505 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -401,7 +401,6 @@ int Client::HandlePacket(const EQApplicationPacket *app) char buffer[64]; app->build_header_dump(buffer); mlog(CLIENT__NET_IN_TRACE, "Dispatch opcode: %s", buffer); - mpkt(CLIENT__NET_IN_TRACE, app); } EmuOpcode opcode = app->GetOpcode(); @@ -5835,7 +5834,6 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GetGuildMOTD"); - mpkt(GUILDS__IN_PACKET_TRACE, app); SendGuildMOTD(true); @@ -7219,7 +7217,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildDelete"); - mpkt(GUILDS__IN_PACKET_TRACE, app); + mpkt(GUILDS__IN_PACKET_TRACE, app);s if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); From 647874d424f5101d80f1bde102059f8ccfeb1513 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Fri, 16 Jan 2015 22:12:36 -0600 Subject: [PATCH 132/707] Remove occurrences of mkpt --- zone/client_packet.cpp | 16 ---------------- zone/guild.cpp | 4 ---- 2 files changed, 20 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index aeb689505..23dd11529 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1899,7 +1899,6 @@ void Client::Handle_0x0193(const EQApplicationPacket *app) void Client::Handle_OP_AAAction(const EQApplicationPacket *app) { mlog(AA__IN, "Received OP_AAAction"); - mpkt(AA__IN, app); if (app->size != sizeof(AA_Action)){ printf("Error! OP_AAAction size didnt match!\n"); @@ -5847,7 +5846,6 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GetGuildsList"); - mpkt(GUILDS__IN_PACKET_TRACE, app); SendGuildList(); } @@ -7217,7 +7215,6 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildDelete"); - mpkt(GUILDS__IN_PACKET_TRACE, app);s if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); @@ -7234,7 +7231,6 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildDemote"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size != sizeof(GuildDemoteStruct)) { mlog(GUILDS__ERROR, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); @@ -7286,7 +7282,6 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildInvite"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7359,7 +7354,6 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) gc->guildeqid = GuildID(); mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); - mpkt(GUILDS__OUT_PACKET_TRACE, app); client->QueuePacket(app); } @@ -7393,7 +7387,6 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) gc->guildeqid = GuildID(); mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); - mpkt(GUILDS__OUT_PACKET_TRACE, app); client->SetPendingGuildInvitation(true); client->QueuePacket(app); @@ -7417,7 +7410,6 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildInviteAccept"); - mpkt(GUILDS__IN_PACKET_TRACE, app); SetPendingGuildInvitation(false); @@ -7509,7 +7501,6 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildLeader"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size < 2) { mlog(GUILDS__ERROR, "Invalid length %d on OP_GuildLeader", app->size); @@ -7553,7 +7544,6 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Got OP_GuildManageBanker of len %d", app->size); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size != sizeof(GuildManageBanker_Struct)) { mlog(GUILDS__ERROR, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); return; @@ -7631,14 +7621,12 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Got OP_GuildPeace of len %d", app->size); - mpkt(GUILDS__IN_PACKET_TRACE, app); return; } void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildPromote"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size != sizeof(GuildPromoteStruct)) { mlog(GUILDS__ERROR, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); @@ -7688,7 +7676,6 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildPublicNote"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size < sizeof(GuildUpdate_PublicNote)) { // client calls for a motd on login even if they arent in a guild @@ -7725,7 +7712,6 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_GuildRemove"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7882,7 +7868,6 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) void Client::Handle_OP_GuildWar(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Got OP_GuildWar of len %d", app->size); - mpkt(GUILDS__IN_PACKET_TRACE, app); return; } @@ -11864,7 +11849,6 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) { mlog(GUILDS__IN_PACKETS, "Received OP_SetGuildMOTD"); - mpkt(GUILDS__IN_PACKET_TRACE, app); if (app->size != sizeof(GuildMOTD_Struct)) { // client calls for a motd on login even if they arent in a guild diff --git a/zone/guild.cpp b/zone/guild.cpp index 392ac8e48..0bc5186de 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -57,7 +57,6 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) { } mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMOTD of length %d", outapp->size); - mpkt(GUILDS__OUT_PACKET_TRACE, outapp); FastQueuePacket(&outapp); } @@ -177,7 +176,6 @@ void Client::SendGuildList() { } mlog(GUILDS__OUT_PACKETS, "Sending OP_ZoneGuildList of length %d", outapp->size); -// mpkt(GUILDS__OUT_PACKET_TRACE, outapp); FastQueuePacket(&outapp); } @@ -195,7 +193,6 @@ void Client::SendGuildMembers() { data = nullptr; mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMemberList of length %d", outapp->size); - mpkt(GUILDS__OUT_PACKET_TRACE, outapp); FastQueuePacket(&outapp); @@ -339,7 +336,6 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){ outgj->zoneid = gj->zoneid; mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildManageAdd for join of length %d", outapp->size); - mpkt(GUILDS__OUT_PACKET_TRACE, outapp); FastQueuePacket(&outapp); From b06d1b9050bb471707375f8175a39fd797d6a8ea Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 01:52:12 -0600 Subject: [PATCH 133/707] Strip newlines that pipe from quest logs --- zone/embxs.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zone/embxs.cpp b/zone/embxs.cpp index e080d6a13..f8a948578 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -92,6 +92,9 @@ XS(XS_EQEmuIO_PRINT) char *str = SvPV_nolen(ST(r)); char *cur = str; + /* Strip newlines from log message 'str' */ + *std::remove(str, str + strlen(str), '\n') = '\0'; + int i; int pos = 0; int len = 0; From aec39d2650fe23b3cd6f368dbfd4c2c2b5fa0154 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 01:59:18 -0600 Subject: [PATCH 134/707] Port mlog AA category to new log system --- zone/aa.cpp | 8 ++++---- zone/client_packet.cpp | 4 ++-- zone/spells.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 0e6e0aad0..db28b2dc8 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -951,7 +951,7 @@ void Client::SendAAStats() { void Client::BuyAA(AA_Action* action) { - mlog(AA__MESSAGE, "Starting to buy AA %d", action->ability); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); //find the AA information from the database SendAA_Struct* aa2 = zone->FindAA(action->ability); @@ -963,7 +963,7 @@ void Client::BuyAA(AA_Action* action) a = action->ability - i; if(a <= 0) break; - mlog(AA__MESSAGE, "Could not find AA %d, trying potential parent %d", action->ability, a); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); aa2 = zone->FindAA(a); if(aa2 != nullptr) break; @@ -980,7 +980,7 @@ void Client::BuyAA(AA_Action* action) uint32 cur_level = GetAA(aa2->id); if((aa2->id + cur_level) != action->ability) { //got invalid AA - mlog(AA__ERROR, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); return; } @@ -1011,7 +1011,7 @@ void Client::BuyAA(AA_Action* action) if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1); - mlog(AA__MESSAGE, "Set AA %d to level %d", aa2->id, cur_level + 1); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); m_pp.aapoints -= real_cost; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 23dd11529..22d63370c 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -1898,7 +1898,7 @@ void Client::Handle_0x0193(const EQApplicationPacket *app) void Client::Handle_OP_AAAction(const EQApplicationPacket *app) { - mlog(AA__IN, "Received OP_AAAction"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); if (app->size != sizeof(AA_Action)){ printf("Error! OP_AAAction size didnt match!\n"); @@ -1907,7 +1907,7 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) AA_Action* action = (AA_Action*)app->pBuffer; if (action->action == aaActionActivate) {//AA Hotkey - mlog(AA__MESSAGE, "Activating AA %d", action->ability); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); ActivateAA((aaID)action->ability); } else if (action->action == aaActionBuy) { diff --git a/zone/spells.cpp b/zone/spells.cpp index 113c335e4..0e2b1e49f 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -1391,7 +1391,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce && (IsGrouped() // still self only if not grouped || IsRaidGrouped()) && (HasProjectIllusion())){ - mlog(AA__MESSAGE, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); targetType = ST_GroupClientAndPet; } @@ -2067,11 +2067,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(IsPlayerIllusionSpell(spell_id) && IsClient() && (HasProjectIllusion())){ - mlog(AA__MESSAGE, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); SetProjectIllusion(false); } else{ - mlog(AA__MESSAGE, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); } break; } From cae6a70a2c0d39345ef156216dbacb9157fba0be Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:01:20 -0600 Subject: [PATCH 135/707] port mlog 'Spells' category to new log system --- zone/attack.cpp | 12 +- zone/bot.cpp | 16 +-- zone/client_packet.cpp | 4 +- zone/spell_effects.cpp | 16 +-- zone/spells.cpp | 308 ++++++++++++++++++++--------------------- 5 files changed, 178 insertions(+), 178 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index d284b9184..4e3aa3c2f 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage) int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; if(damage_to_reduce >= buffs[slot].melee_rune) { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); damage -= damage_to_reduce; @@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage) if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); if (spellbonuses.MitigateMeleeRune[3]) @@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune); damage -= buffs[slot].magic_rune; if(!TryFadeEffect(slot)) @@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } else { - mlog(SPELLS__EFFECT_VALUES, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); if (spellbonuses.MitigateSpellRune[3]) diff --git a/zone/bot.cpp b/zone/bot.cpp index fa4d937f2..611fb871c 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - mlog(SPELLS__CASTING, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(GetClass() != BARD) { if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t //cannot cast under deivne aura if(DivineAura()) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t } if (HasActiveSong()) { - mlog(SPELLS__BARDS, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client //_StopSong(); bardsong = 0; @@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(caster->IsBot()) { if(spells[spell_id].targettype == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { - mlog(SPELLS__RESISTS, "Bot's target is not an undead."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); return true; } } @@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3) ) { - mlog(SPELLS__RESISTS, "Bot's target is not a summoned creature."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); return true; } } } - mlog(SPELLS__RESISTS, "No bot immunities to spell %d found.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); } } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 22d63370c..65fcd4cfe 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -2970,7 +2970,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (!IsPoison) { - mlog(SPELLS__CASTING_ERR, "Item used to cast spell effect from a poison item was missing from inventory slot %d " + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " "after casting, or is not a poison!", ApplyPoisonData->inventorySlot); Message(0, "Error: item not found for inventory slot #%i or is not a poison", ApplyPoisonData->inventorySlot); @@ -3865,7 +3865,7 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*)app->pBuffer; uint32 spid = sbf->spellid; - mlog(SPELLS__BUFFS, "Client requested that buff with spell id %d be canceled.", spid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index b8d67ddaa..217172e8b 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1649,7 +1649,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - mlog(SPELLS__REZ, " corpse being rezzed using spell %i by %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", spell_id, caster->GetName()); CastToCorpse()->CastRezz(spell_id, caster); @@ -3065,7 +3065,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, int mod = caster->GetInstrumentMod(spell_id); mod = ApplySpellEffectiveness(caster, spell_id, mod, true); effect_value = effect_value * mod / 10; - mlog(SPELLS__BARDS, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); } effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster); @@ -3127,7 +3127,7 @@ snare has both of them negative, yet their range should work the same: updownsign = 1; } - mlog(SPELLS__EFFECT_VALUES, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", spell_id, formula, base, max, caster_level, updownsign); switch(formula) @@ -3351,7 +3351,7 @@ snare has both of them negative, yet their range should work the same: if (base < 0 && result > 0) result *= -1; - mlog(SPELLS__EFFECT_VALUES, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3383,18 +3383,18 @@ void Mob::BuffProcess() IsMezSpell(buffs[buffs_i].spellid) || IsBlindSpell(buffs[buffs_i].spellid)) { - mlog(SPELLS__BUFFS, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } } else if (buffs[buffs_i].ticsremaining < 0) { - mlog(SPELLS__BUFFS, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } else { - mlog(SPELLS__BUFFS, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); } } else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)) @@ -3759,7 +3759,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient() && !CastToClient()->IsDead()) CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - mlog(SPELLS__BUFFS, "Fading buff %d from slot %d", buffs[slot].spellid, slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); if(spells[buffs[slot].spellid].viral_targets > 0) { bool last_virus = true; diff --git a/zone/spells.cpp b/zone/spells.cpp index 0e2b1e49f..d3b2c3e4b 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -147,7 +147,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - mlog(SPELLS__CASTING, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -166,7 +166,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, (IsAmnesiad() && IsDiscipline(spell_id)) ) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -204,7 +204,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, //cannot cast under divine aura if(DivineAura()) { - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -234,7 +234,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - mlog(SPELLS__CASTING_ERR, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -243,7 +243,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, } if (HasActiveSong() && IsBardSong(spell_id)) { - mlog(SPELLS__BARDS, "Casting a new song while singing a song. Killing old song %d.", bardsong); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client _StopSong(); } @@ -349,7 +349,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, const SPDat_Spell_Struct &spell = spells[spell_id]; - mlog(SPELLS__CASTING, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", spell.name, spell_id, target_id, slot, cast_time, mana_cost, item_slot==0xFFFFFFFF?999:item_slot); casting_spell_id = spell_id; @@ -363,7 +363,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_type = type; SaveSpellLoc(); - mlog(SPELLS__CASTING, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); // if this spell doesn't require a target, or if it's an optional target // and a target wasn't provided, then it's us; unless TGB is on and this @@ -375,7 +375,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, spell.targettype == ST_Beam || spell.targettype == ST_TargetOptional) && target_id == 0) { - mlog(SPELLS__CASTING, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); target_id = GetID(); } @@ -392,7 +392,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, // we checked for spells not requiring targets above if(target_id == 0) { - mlog(SPELLS__CASTING_ERR, "Spell Error: no target. spell=%d\n", GetName(), spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, SPELL_NEED_TAR); @@ -430,7 +430,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { mana_cost = 0; } else { - mlog(SPELLS__CASTING_ERR, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, INSUFFICIENT_MANA); @@ -451,7 +451,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_resist_adjust = resist_adjust; - mlog(SPELLS__CASTING, "Spell %d: Casting time %d (orig %d), mana cost %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", spell_id, cast_time, orgcasttime, mana_cost); // cast time is 0, just finish it right now and be done with it @@ -517,7 +517,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); return false; @@ -756,7 +756,7 @@ bool Client::CheckFizzle(uint16 spell_id) float fizzle_roll = zone->random.Real(0, 100); - mlog(SPELLS__CASTING, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); if(fizzle_roll > fizzlechance) return(true); @@ -816,7 +816,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) ZeroCastingVars(); // resets all the state keeping stuff - mlog(SPELLS__CASTING, "Spell %d has been interrupted.", spellid); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); if(!spellid) return; @@ -893,7 +893,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? Message_StringID(13, SPELL_RECAST); - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: spell reuse timer not expired", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -907,7 +907,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { Message_StringID(13, SPELL_RECAST); - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -916,7 +916,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!IsValidSpell(spell_id)) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: invalid spell id", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); InterruptSpell(); return; } @@ -927,7 +927,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(delaytimer) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: recast too quickly", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); Message(13, "You are unable to focus."); InterruptSpell(); return; @@ -937,7 +937,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // make sure they aren't somehow casting 2 timed spells at once if (casting_spell_id != spell_id) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: already casting", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); Message_StringID(13,ALREADY_CASTING); InterruptSpell(); return; @@ -952,7 +952,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if (IsBardSong(spell_id)) { if(spells[spell_id].buffduration == 0xFFFF || spells[spell_id].recast_time != 0) { - mlog(SPELLS__BARDS, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); } else { bardsong = spell_id; bardsong_slot = slot; @@ -962,7 +962,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, else bardsong_target_id = spell_target->GetID(); bardsong_timer.Start(6000); - mlog(SPELLS__BARDS, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); bard_song_mode = true; } } @@ -1041,10 +1041,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, } } - mlog(SPELLS__CASTING, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: interrupted.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); InterruptSpell(); return; } @@ -1060,10 +1060,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(IsClient()) { int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { - mlog(SPELLS__CASTING, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { if(reg_focus > 0) - mlog(SPELLS__CASTING, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); Client *c = this->CastToClient(); int component, component_count, inv_slot_id; bool missingreags = false; @@ -1116,11 +1116,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, break; default: // some non-instrument component. Let it go, but record it in the log - mlog(SPELLS__CASTING_ERR, "Something odd happened: Song %d required component %s", spell_id, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); } if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song - mlog(SPELLS__CASTING_ERR, "Song %d: Canceled. Missing required instrument %s", spell_id, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); if(c->GetGM()) c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { @@ -1143,12 +1143,12 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, const Item_Struct *item = database.GetItem(component); if(item) { c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); - mlog(SPELLS__CASTING_ERR, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { char TempItemName[64]; strcpy((char*)&TempItemName, "UNKNOWN"); - mlog(SPELLS__CASTING_ERR, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); } } } // end bard/not bard ifs @@ -1169,7 +1169,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (component == -1) continue; component_count = spells[spell_id].component_counts[t_count]; - mlog(SPELLS__CASTING_ERR, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); // Components found, Deleting // now we go looking for and deleting the items one by one for(int s = 0; s < component_count; s++) @@ -1234,7 +1234,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { Message_StringID(13, SPELL_RECAST); - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -1253,15 +1253,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(fromaug) { charges = -1; } //Don't destroy the parent item if(charges > -1) { // charged item, expend a charge - mlog(SPELLS__CASTING, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); DeleteChargeFromSlot = inventory_slot; } else { - mlog(SPELLS__CASTING, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); } } else { - mlog(SPELLS__CASTING_ERR, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; @@ -1280,7 +1280,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // we're done casting, now try to apply the spell if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust) ) { - mlog(SPELLS__CASTING_ERR, "Casting of %d canceled: SpellFinished returned false.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); InterruptSpell(); return; } @@ -1309,7 +1309,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, this->CastToClient()->CheckSongSkillIncrease(spell_id); this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar); } - mlog(SPELLS__CASTING, "Bard song %d should be started", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); } else { @@ -1344,7 +1344,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, delaytimer = true; spellend_timer.Start(400,true); - mlog(SPELLS__CASTING, "Spell casting of %d is finished.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); } @@ -1474,7 +1474,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce ) { //invalid target - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1487,7 +1487,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3)) { //invalid target - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1501,7 +1501,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (spell_target != GetPet()) || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal)) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (summoned pet)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, body_type); Message_StringID(13, SPELL_NEED_TAR); @@ -1526,7 +1526,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || mob_body != target_bt) { //invalid target - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); if(!spell_target) Message_StringID(13,SPELL_NEED_TAR); else @@ -1544,7 +1544,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (ldon object)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1552,14 +1552,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target->IsNPC()) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (normal)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (normal)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1568,7 +1568,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (normal)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } @@ -1580,7 +1580,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target || !spell_target->IsPlayerCorpse()) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (corpse)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); uint32 message = ONLY_ON_CORPSES; if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; @@ -1596,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = GetPet(); if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (no pet)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); Message_StringID(13,NO_PET); return false; // can't cast these unless we have a target } @@ -1666,7 +1666,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (AOE)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1703,7 +1703,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1800,14 +1800,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { - mlog(SPELLS__CASTING_ERR, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } @@ -1878,7 +1878,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - mlog(SPELLS__CASTING_ERR, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; @@ -1957,7 +1957,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) return(false); - mlog(SPELLS__CASTING, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target // spell that's recast every 2500 msec for AEDuration msec. There are @@ -1968,7 +1968,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Mob *beacon_loc = spell_target ? spell_target : this; Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); - mlog(SPELLS__CASTING, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); spell_target = nullptr; ae_center = beacon; CastAction = AECaster; @@ -1977,7 +1977,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // check line of sight to target if it's a detrimental spell if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { - mlog(SPELLS__CASTING, "Spell %d: cannot see target %s", spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); Message_StringID(13,CANT_SEE_TARGET); return false; } @@ -2008,13 +2008,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range; if(dist2 > range2) { //target is out of range. - mlog(SPELLS__CASTING, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. - mlog(SPELLS__CASTING, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); Message_StringID(13, TARGET_TOO_CLOSE); return(false); } @@ -2043,7 +2043,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS if(spell_target == nullptr) { - mlog(SPELLS__CASTING, "Spell %d: Targeted spell, but we have no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } if (isproc) { @@ -2235,7 +2235,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // CastSpell already reduced the cost for it if we're a client with focus if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { - mlog(SPELLS__CASTING, "Spell %d: consuming %d mana", spell_id, mana_used); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); if (!DoHPToManaCovert(mana_used)) SetMana(GetMana() - mana_used); TryTriggerOnValueAmount(false, true); @@ -2247,7 +2247,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF) { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); - mlog(SPELLS__CASTING, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; @@ -2263,7 +2263,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(reduction) recast -= reduction; - mlog(SPELLS__CASTING, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } @@ -2301,7 +2301,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(slot == USE_ITEM_SPELL_SLOT) { //bard songs should never come from items... - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); return(false); } @@ -2309,12 +2309,12 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } if(ae_center != nullptr && ae_center->IsBeacon()) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2323,18 +2323,18 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(mana_used > 0) { if(mana_used > GetMana()) { //ran out of mana... this calls StopSong() for us - mlog(SPELLS__BARDS, "Ran out of mana while singing song %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); return(false); } - mlog(SPELLS__CASTING, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); SetMana(GetMana() - mana_used); } // check line of sight to target if it's a detrimental spell if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { - mlog(SPELLS__CASTING, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); Message_StringID(13, CANT_SEE_TARGET); return(false); } @@ -2349,7 +2349,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range2 = range * range; if(dist2 > range2) { //target is out of range. - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } @@ -2365,10 +2365,10 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case SingleTarget: { if(spell_target == nullptr) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } - mlog(SPELLS__BARDS, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); spell_target->BardPulse(spell_id, this); break; } @@ -2386,7 +2386,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { { // we can't cast an AE spell without something to center it on if(ae_center == nullptr) { - mlog(SPELLS__BARDS, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2394,9 +2394,9 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(spell_target) { // this must be an AETarget spell // affect the target too spell_target->BardPulse(spell_id, this); - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); } else { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, AE with no target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); } bool affect_caster = !IsNPC(); //NPC AE spells do not affect the NPC caster entity_list.AEBardPulse(this, ae_center, spell_id, affect_caster); @@ -2406,13 +2406,13 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case GroupSpell: { if(spell_target->IsGrouped()) { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); Group *target_group = entity_list.GetGroupByMob(spell_target); if(target_group) target_group->GroupBardPulse(this, spell_id); } else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); Raid *r = entity_list.GetRaidByClient(spell_target->CastToClient()); if(r){ uint32 gid = r->GetGroup(spell_target->GetName()); @@ -2429,7 +2429,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } } else { - mlog(SPELLS__BARDS, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); BardPulse(spell_id, this); #ifdef GROUP_BUFF_PETS if (GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) @@ -2455,13 +2455,13 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { if(buffs[buffs_i].spellid != spell_id) continue; if(buffs[buffs_i].casterid != caster->GetID()) { - mlog(SPELLS__BARDS, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); return; } //extend the spell if it will expire before the next pulse if(buffs[buffs_i].ticsremaining <= 3) { buffs[buffs_i].ticsremaining += 3; - mlog(SPELLS__BARDS, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); } //should we send this buff update to the client... seems like it would @@ -2559,7 +2559,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { //we are done... return; } - mlog(SPELLS__BARDS, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); //this spell is not affecting this mob, apply it. caster->SpellOnTarget(spell_id, this); } @@ -2601,7 +2601,7 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste res = mod_buff_duration(res, caster, target, spell_id); - mlog(SPELLS__CASTING, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", spell_id, castlevel, formula, duration, res); return(res); @@ -2695,15 +2695,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - mlog(SPELLS__STACKING, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); // Same Spells and dot exemption is set to 1 or spell is Manaburn if (spellid1 == spellid2) { if (sp1.dot_stacking_exempt == 1 && caster1 != caster2) { // same caster can refresh - mlog(SPELLS__STACKING, "Blocking spell due to dot stacking exemption."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); return -1; } else if (spellid1 == 2751) { - mlog(SPELLS__STACKING, "Blocking spell because manaburn does not stack with itself."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); return -1; } } @@ -2735,7 +2735,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { if(!IsDetrimentalSpell(spellid1) && !IsDetrimentalSpell(spellid2)) { - mlog(SPELLS__STACKING, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); return (0); } } @@ -2804,16 +2804,16 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); - mlog(SPELLS__STACKING, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value, sp1_value, (sp1_value < overwrite_below_value)?"Overwriting":"Not overwriting"); if(sp1_value < overwrite_below_value) { - mlog(SPELLS__STACKING, "Overwrite spell because sp1_value < overwrite_below_value"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); return 1; // overwrite spell if its value is less } } else { - mlog(SPELLS__STACKING, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value); } @@ -2827,22 +2827,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); - mlog(SPELLS__STACKING, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value, sp2_value, (sp2_value < blocked_below_value)?"Blocked":"Not blocked"); if (sp2_value < blocked_below_value) { - mlog(SPELLS__STACKING, "Blocking spell because sp2_Value < blocked_below_value"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); return -1; //blocked } } else { - mlog(SPELLS__STACKING, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } } } } else { - mlog(SPELLS__STACKING, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", sp1.name, spellid1, sp2.name, spellid2); } @@ -2905,13 +2905,13 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(IsNPC() && caster1 && caster2 && caster1 != caster2) { if(effect1 == SE_CurrentHP && sp1_detrimental && sp2_detrimental) { - mlog(SPELLS__STACKING, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); continue; } } if(effect1 == SE_CompleteHeal){ //SE_CompleteHeal never stacks or overwrites ever, always block. - mlog(SPELLS__STACKING, "Blocking spell because complete heal never stacks or overwries"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); return (-1); } @@ -2923,7 +2923,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(sp_det_mismatch) { - mlog(SPELLS__STACKING, "The effects are the same but the spell types are not, passing the effect"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); continue; } @@ -2932,7 +2932,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, and the effect is a dot we can go ahead and stack it */ if(effect1 == SE_CurrentHP && spellid1 != spellid2 && sp1_detrimental && sp2_detrimental) { - mlog(SPELLS__STACKING, "The spells are not the same and it is a detrimental dot, passing"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); continue; } @@ -2958,7 +2958,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, sp2_value = 0 - sp2_value; if(sp2_value < sp1_value) { - mlog(SPELLS__STACKING, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", sp2.name, sp2_value, sp1.name, sp1_value, sp2.name); return -1; // can't stack } @@ -2967,7 +2967,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //we dont return here... a better value on this one effect dosent mean they are //all better... - mlog(SPELLS__STACKING, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", sp1.name, sp1_value, sp2.name, sp2_value, sp1.name); will_overwrite = true; } @@ -2976,15 +2976,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //so now we see if this new spell is any better, or if its not related at all if(will_overwrite) { if (values_equal && effect_match && !IsGroupSpell(spellid2) && IsGroupSpell(spellid1)) { - mlog(SPELLS__STACKING, "%s (%d) appears to be the single target version of %s (%d), rejecting", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", sp2.name, spellid2, sp1.name, spellid1); return -1; } - mlog(SPELLS__STACKING, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); return(1); } - mlog(SPELLS__STACKING, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); return 0; } @@ -3043,11 +3043,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } if (duration == 0) { - mlog(SPELLS__BUFFS, "Buff %d failed to add because its duration came back as 0.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); return -2; // no duration? this isn't a buff } - mlog(SPELLS__BUFFS, "Trying to add buff %d cast by %s (cast level %d) with duration %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); // first we loop through everything checking that the spell @@ -3077,12 +3077,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid ret = CheckStackConflict(curbuf.spellid, curbuf.casterlevel, spell_id, caster_level, entity_list.GetMobID(curbuf.casterid), caster, buffslot); if (ret == -1) { // stop the spell - mlog(SPELLS__BUFFS, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); return -1; } if (ret == 1) { // set a flag to indicate that there will be overwriting - mlog(SPELLS__BUFFS, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); // If this is the first buff it would override, use its slot if (!will_overwrite) @@ -3106,7 +3106,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid for (buffslot = 0; buffslot < buff_count; buffslot++) { const Buffs_Struct &curbuf = buffs[buffslot]; if (IsBeneficialSpell(curbuf.spellid)) { - mlog(SPELLS__BUFFS, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", spell_id, curbuf.spellid, buffslot); BuffFadeBySlot(buffslot, false); emptyslot = buffslot; @@ -3114,11 +3114,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } } if(emptyslot == -1) { - mlog(SPELLS__BUFFS, "Unable to find a buff slot for detrimental buff %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); return -1; } } else { - mlog(SPELLS__BUFFS, "Unable to find a buff slot for beneficial buff %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); return -1; } } @@ -3169,7 +3169,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].UpdateClient = true; } - mlog(SPELLS__BUFFS, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); if (IsPet() && GetOwner() && GetOwner()->IsClient()) SendPetBuffsToClient(); @@ -3270,7 +3270,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // well we can't cast a spell on target without a target if(!spelltar) { - mlog(SPELLS__CASTING_ERR, "Unable to apply spell %d without a target", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); Message(13, "SOT: You must have a target for this spell."); return false; } @@ -3298,7 +3298,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r uint16 caster_level = GetCasterLevel(spell_id); - mlog(SPELLS__CASTING, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); // Actual cast action - this causes the caster animation and the particles // around the target @@ -3378,7 +3378,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Spells, EnableBlockedBuffs)) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %i not applied to %s as it is a Blocked Buff.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", spell_id, spelltar->GetName()); safe_delete(action_packet); return true; @@ -3386,7 +3386,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBlockedPetBuff(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", spell_id, spelltar->GetName(), spelltar->GetOwner()->GetName()); safe_delete(action_packet); return true; @@ -3395,7 +3395,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // invuln mobs can't be affected by any spells, good or bad if(spelltar->GetInvul() || spelltar->DivineAura()) { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3406,17 +3406,17 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Pets, UnTargetableSwarmPet)) { if (spelltar->IsNPC()) { if (!spelltar->CastToNPC()->GetSwarmOwner()) { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - mlog(SPELLS__CASTING_ERR, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } @@ -3525,9 +3525,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spells[spell_id].targettype == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold - mlog(SPELLS__CASTING_ERR, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { - mlog(SPELLS__CASTING_ERR, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); @@ -3537,7 +3537,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r } else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { - mlog(SPELLS__CASTING_ERR, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; @@ -3551,7 +3551,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsImmuneToSpell(spell_id, this)) { //the above call does the message to the client if needed - mlog(SPELLS__RESISTS, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3644,7 +3644,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spell_effectiveness == 0 || !IsPartialCapableSpell(spell_id) ) { - mlog(SPELLS__RESISTS, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); @@ -3692,7 +3692,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsAIControlled() && IsDetrimentalSpell(spell_id) && !IsHarmonySpell(spell_id)) { int32 aggro_amount = CheckAggroAmount(spell_id, isproc); - mlog(SPELLS__CASTING, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); if(aggro_amount > 0) spelltar->AddToHateList(this, aggro_amount); else{ int32 newhate = spelltar->GetHateAmount(this) + aggro_amount; @@ -3709,7 +3709,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // make sure spelltar is high enough level for the buff if(RuleB(Spells, BuffLevelRestrictions) && !spelltar->CheckSpellLevelRestriction(spell_id)) { - mlog(SPELLS__BUFFS, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); @@ -3721,7 +3721,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. - mlog(SPELLS__CASTING_ERR, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_type != 1) // AA is handled differently Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); @@ -3825,7 +3825,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r safe_delete(action_packet); safe_delete(message_packet); - mlog(SPELLS__CASTING, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); return true; } @@ -4005,7 +4005,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) //this spell like 10 times, this could easily be consolidated //into one loop through with a switch statement. - mlog(SPELLS__RESISTS, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); if(!IsValidSpell(spell_id)) return true; @@ -4016,7 +4016,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(IsMezSpell(spell_id)) { if(GetSpecialAbility(UNMEZABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Mez spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); caster->Message_StringID(MT_Shout, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4034,7 +4034,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if((GetLevel() > spells[spell_id].max[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - mlog(SPELLS__RESISTS, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL); return true; } @@ -4043,7 +4043,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // slow and haste spells if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { - mlog(SPELLS__RESISTS, "We are immune to Slow spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); caster->Message_StringID(MT_Shout, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4059,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Fear spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4070,13 +4070,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) return true; } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { - mlog(SPELLS__RESISTS, "Clients cannot fear eachother!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - mlog(SPELLS__RESISTS, "Level is %d, cannot be feared by this spell.", GetLevel()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id); if (aggro > 0) { @@ -4090,7 +4090,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) { Message(13, "Your are immune to fear."); - mlog(SPELLS__RESISTS, "Clients has WarCry effect, immune to fear!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } @@ -4100,7 +4100,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNCHARMABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Charm spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); caster->Message_StringID(MT_Shout, CANNOT_CHARM); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4113,7 +4113,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { - mlog(SPELLS__RESISTS, "You are immune to your own charms."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); caster->Message(MT_Shout, "You cannot charm yourself."); return true; } @@ -4126,7 +4126,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) assert(effect_index >= 0); if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - mlog(SPELLS__RESISTS, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_CHARM_YET); return true; } @@ -4140,7 +4140,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) ) { if(GetSpecialAbility(UNSNAREABLE)) { - mlog(SPELLS__RESISTS, "We are immune to Snare spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); caster->Message_StringID(MT_Shout, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4156,7 +4156,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - mlog(SPELLS__RESISTS, "You cannot lifetap yourself."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); caster->Message_StringID(MT_Shout, CANT_DRAIN_SELF); return true; } @@ -4166,13 +4166,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - mlog(SPELLS__RESISTS, "You cannot sacrifice yourself."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); caster->Message_StringID(MT_Shout, CANNOT_SAC_SELF); return true; } } - mlog(SPELLS__RESISTS, "No immunities to spell %d found.", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); return false; } @@ -4209,7 +4209,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use if(GetSpecialAbility(IMMUNE_MAGIC)) { - mlog(SPELLS__RESISTS, "We are immune to magic, so we fully resist the spell %d", spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); return(0); } @@ -4230,7 +4230,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int fear_resist_bonuses = CalcFearResistChance(); if(zone->random.Roll(fear_resist_bonuses)) { - mlog(SPELLS__RESISTS, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); return 0; } } @@ -4248,7 +4248,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int resist_bonuses = CalcResistChanceBonus(); if(resist_bonuses && zone->random.Roll(resist_bonuses)) { - mlog(SPELLS__RESISTS, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); return 0; } } @@ -4256,7 +4256,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get the resist chance for the target if(resist_type == RESIST_NONE) { - mlog(SPELLS__RESISTS, "Spell was unresistable"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); return 100; } @@ -5089,23 +5089,23 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; PermaProcs[i].base_spellID = base_spell_id; - mlog(SPELLS__PROCS, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - mlog(SPELLS__PROCS, "Too many perma procs for %s", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); } else { for (i = 0; i < MAX_PROCS; i++) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; SpellProcs[i].base_spellID = base_spell_id;; - mlog(SPELLS__PROCS, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - mlog(SPELLS__PROCS, "Too many procs for %s", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); } return false; } @@ -5116,7 +5116,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].chance = 0; SpellProcs[i].base_spellID = SPELL_UNKNOWN; - mlog(SPELLS__PROCS, "Removed proc %d from slot %d", spell_id, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); } } return true; @@ -5133,7 +5133,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id DefensiveProcs[i].spellID = spell_id; DefensiveProcs[i].chance = iChance; DefensiveProcs[i].base_spellID = base_spell_id; - mlog(SPELLS__PROCS, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5148,7 +5148,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) DefensiveProcs[i].spellID = SPELL_UNKNOWN; DefensiveProcs[i].chance = 0; DefensiveProcs[i].base_spellID = SPELL_UNKNOWN; - mlog(SPELLS__PROCS, "Removed defensive proc %d from slot %d", spell_id, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); } } return true; @@ -5165,7 +5165,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id) RangedProcs[i].spellID = spell_id; RangedProcs[i].chance = iChance; RangedProcs[i].base_spellID = base_spell_id; - mlog(SPELLS__PROCS, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5180,7 +5180,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) RangedProcs[i].spellID = SPELL_UNKNOWN; RangedProcs[i].chance = 0; RangedProcs[i].base_spellID = SPELL_UNKNOWN;; - mlog(SPELLS__PROCS, "Removed ranged proc %d from slot %d", spell_id, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); } } return true; @@ -5211,7 +5211,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) int Mob::GetCasterLevel(uint16 spell_id) { int level = GetLevel(); level += itembonuses.effective_casting_level + spellbonuses.effective_casting_level + aabonuses.effective_casting_level; - mlog(SPELLS__CASTING, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); return(level); } From 25642f924e2d901486e6d9ab4da4e63cacc5811c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:04:43 -0600 Subject: [PATCH 136/707] port mlog 'Inventory' category to new log system --- zone/client_process.cpp | 2 +- zone/inventory.cpp | 108 ++++++++++++++++++++-------------------- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 5c9444ee0..fe89c942d 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -836,7 +836,7 @@ void Client::BulkSendInventoryItems() { if(inst) { bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - mlog(INVENTORY__ERROR, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 103728e83..3062db265 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -215,7 +215,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are augmenting an augmentable item else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -229,7 +229,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -269,7 +269,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - mlog(INVENTORY__ERROR, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; @@ -815,7 +815,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) { - mlog(INVENTORY__SLOTS, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); m_inv.PushCursor(inst); if (client_update) { @@ -831,7 +831,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) // (Also saves changes back to the database: this may be optimized in the future) // client_update: Sends packet to client bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) { - mlog(INVENTORY__SLOTS, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); if (slot_id == MainCursor) return PushItemOnCursor(inst, client_update); @@ -858,7 +858,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data) { - mlog(INVENTORY__SLOTS, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); m_inv.PutItem(slot_id, inst); SendLootItemInPacket(&inst, slot_id); @@ -879,7 +879,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI continue; const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); - mlog(INVENTORY__SLOTS, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); safe_delete(bagitem); } @@ -1313,7 +1313,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - mlog(INVENTORY__SLOTS, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1321,7 +1321,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - mlog(INVENTORY__SLOTS, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1334,7 +1334,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->to_slot == (uint32)INVALID_INDEX) { if (move_in->from_slot == (uint32)MainCursor) { - mlog(INVENTORY__SLOTS, "Client destroyed item from cursor slot %d", move_in->from_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit ItemInst *inst = m_inv.GetItem(MainCursor); @@ -1348,7 +1348,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; // Item destroyed by client } else { - mlog(INVENTORY__SLOTS, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit DeleteItemInInventory(move_in->from_slot); return true; // Item deletion @@ -1388,7 +1388,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { ItemInst* src_inst = m_inv.GetItem(src_slot_id); ItemInst* dst_inst = m_inv.GetItem(dst_slot_id); if (src_inst){ - mlog(INVENTORY__SLOTS, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); srcitemid = src_inst->GetItem()->ID; //SetTint(dst_slot_id,src_inst->GetColor()); if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize)) @@ -1398,7 +1398,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } if (dst_inst) { - mlog(INVENTORY__SLOTS, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); dstitemid = dst_inst->GetItem()->ID; } if (Trader && srcitemid>0){ @@ -1435,7 +1435,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { move_in->from_slot = dst_slot_check; move_in->to_slot = src_slot_check; move_in->number_in_stack = dst_inst->GetCharges(); - if(!SwapItem(move_in)) { mlog(INVENTORY__ERROR, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } + if(!SwapItem(move_in)) { logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } } return false; @@ -1577,7 +1577,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return false; } if (with) { - mlog(INVENTORY__SLOTS, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor if (!m_inv[MainCursor]) { Message(13, "Error: Cursor item not located on server!"); @@ -1610,18 +1610,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->number_in_stack > 0) { // Determine if charged items can stack if(src_inst && !src_inst->IsStackable()) { - mlog(INVENTORY__ERROR, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); return false; } if (dst_inst) { if(src_inst->GetID() != dst_inst->GetID()) { - mlog(INVENTORY__ERROR, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); return(false); } if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) { //we have a chance of stacking. - mlog(INVENTORY__SLOTS, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); // Charges can be emptied into dst uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges(); if (usedcharges > move_in->number_in_stack) @@ -1633,15 +1633,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Depleted all charges? if (src_inst->GetCharges() < 1) { - mlog(INVENTORY__SLOTS, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); database.SaveInventory(CharacterID(),nullptr,src_slot_id); m_inv.DeleteItem(src_slot_id); all_to_stack = true; } else { - mlog(INVENTORY__SLOTS, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); } } else { - mlog(INVENTORY__ERROR, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); return false; } } @@ -1650,12 +1650,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) { // Move entire stack if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - mlog(INVENTORY__SLOTS, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); } else { // Split into two src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack); - mlog(INVENTORY__SLOTS, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack); m_inv.PutItem(dst_slot_id, *inst); safe_delete(inst); @@ -1680,7 +1680,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { SetMaterial(dst_slot_id,src_inst->GetItem()->ID); } if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - mlog(INVENTORY__SLOTS, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) { if(src_inst) { @@ -1739,7 +1739,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { // resync the 'from' and 'to' slots on an as-needed basis // Not as effective as the full process, but less intrusive to gameplay -U - mlog(INVENTORY__ERROR, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Message(15, "Inventory Desyncronization detected: Resending slot data..."); if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) { @@ -2071,7 +2071,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2080,7 +2080,7 @@ void Client::RemoveNoRent(bool client_update) { for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2089,7 +2089,7 @@ void Client::RemoveNoRent(bool client_update) { if (m_inv[MainPowerSource]) { const ItemInst* inst = m_inv[MainPowerSource]; if (inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent } } @@ -2098,7 +2098,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2107,7 +2107,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots } } @@ -2116,7 +2116,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots } } @@ -2125,7 +2125,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots } } @@ -2134,7 +2134,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots } } @@ -2155,7 +2155,7 @@ void Client::RemoveNoRent(bool client_update) { inst = *iter; // should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U if (!inst->GetItem()->NoRent) - mlog(INVENTORY__SLOTS, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); else m_inv.PushCursor(**iter); @@ -2178,7 +2178,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2193,7 +2193,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2208,7 +2208,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(MainPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, MainPowerSource); } else { @@ -2223,7 +2223,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2238,7 +2238,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2253,7 +2253,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2281,7 +2281,7 @@ void Client::RemoveDuplicateLore(bool client_update) { inst = *iter; // probably needs a valid pointer check -U if (CheckLoreConflict(inst->GetItem())) { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); safe_delete(*iter); iter = local.erase(iter); } @@ -2300,7 +2300,7 @@ void Client::RemoveDuplicateLore(bool client_update) { m_inv.PushCursor(**iter); } else { - mlog(INVENTORY__ERROR, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); } safe_delete(*iter); @@ -2322,7 +2322,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - mlog(INVENTORY__ERROR, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, client_update); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2335,7 +2335,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - mlog(INVENTORY__ERROR, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); From 97e87f53dbaf2ceeaa86bcbf3df14e0b053cc5cb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:16:44 -0600 Subject: [PATCH 137/707] port mlog 'Guilds' category to new log system --- zone/bot.cpp | 2 +- zone/client_packet.cpp | 68 +++++++++++++++++++++--------------------- zone/guild.cpp | 16 +++++----- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 611fb871c..2381e64f3 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8441,7 +8441,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { return; } - // mlog(GUILDS__ACTIONS, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); + // logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 65fcd4cfe..68f537ab7 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -5832,7 +5832,7 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GetGuildMOTD"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); SendGuildMOTD(true); @@ -5845,7 +5845,7 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GetGuildsList"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); SendGuildList(); } @@ -7214,12 +7214,12 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildDelete"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); else { - mlog(GUILDS__ACTIONS, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.DeleteGuild(GuildID())) Message(0, "Guild delete failed."); else { @@ -7230,10 +7230,10 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildDemote"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); if (app->size != sizeof(GuildDemoteStruct)) { - mlog(GUILDS__ERROR, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); return; } @@ -7263,7 +7263,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) uint8 rank = gci.rank - 1; - mlog(GUILDS__ACTIONS, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", demote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7281,7 +7281,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildInvite"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7322,7 +7322,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) //we could send this to the member and prompt them to see if they want to //be demoted (I guess), but I dont see a point in that. - mlog(GUILDS__ACTIONS, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7341,7 +7341,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - mlog(GUILDS__ACTIONS, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7353,7 +7353,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); client->QueuePacket(app); } @@ -7376,7 +7376,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - mlog(GUILDS__ACTIONS, "Inviting %s (%d) into guild %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7386,7 +7386,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); client->SetPendingGuildInvitation(true); client->QueuePacket(app); @@ -7409,7 +7409,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildInviteAccept"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); SetPendingGuildInvitation(false); @@ -7445,7 +7445,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) else if (!worldserver.Connected()) Message(0, "Error: World server disconnected"); else { - mlog(GUILDS__ACTIONS, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", gj->guildeqid, gj->response, gj->inviter, gj->newmember); //we dont really care a lot about what this packet means, as long as @@ -7459,7 +7459,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) if (gj->guildeqid == GuildID()) { //only need to change rank. - mlog(GUILDS__ACTIONS, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), gj->response, guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7471,7 +7471,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) } else { - mlog(GUILDS__ACTIONS, "Adding %s (%d) to guild %s (%d) at rank %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", GetName(), CharacterID(), guild_mgr.GetGuildName(gj->guildeqid), gj->guildeqid, gj->response); @@ -7500,10 +7500,10 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildLeader"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); if (app->size < 2) { - mlog(GUILDS__ERROR, "Invalid length %d on OP_GuildLeader", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); return; } @@ -7522,7 +7522,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) Client* newleader = entity_list.GetClientByName(gml->target); if (newleader) { - mlog(GUILDS__ACTIONS, "Transfering leadership of %s (%d) to %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID(), newleader->GetName(), newleader->CharacterID()); @@ -7543,9 +7543,9 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Got OP_GuildManageBanker of len %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); if (app->size != sizeof(GuildManageBanker_Struct)) { - mlog(GUILDS__ERROR, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); return; } GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer; @@ -7620,16 +7620,16 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Got OP_GuildPeace of len %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); return; } void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildPromote"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); if (app->size != sizeof(GuildPromoteStruct)) { - mlog(GUILDS__ERROR, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); return; } @@ -7658,7 +7658,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) return; - mlog(GUILDS__ACTIONS, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", promote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7675,7 +7675,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildPublicNote"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); if (app->size < sizeof(GuildUpdate_PublicNote)) { // client calls for a motd on login even if they arent in a guild @@ -7694,7 +7694,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) return; } - mlog(GUILDS__ACTIONS, "Setting public note on %s (%d) in guild %s (%d) to: %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", gpn->target, gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID(), gpn->note); @@ -7711,7 +7711,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_GuildRemove"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7741,7 +7741,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = client->CharacterID(); - mlog(GUILDS__ACTIONS, "Removing %s (%d) from guild %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7757,7 +7757,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = gci.char_id; - mlog(GUILDS__ACTIONS, "Removing remote/offline %s (%d) into guild %s (%d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", gci.char_name.c_str(), gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7867,7 +7867,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) void Client::Handle_OP_GuildWar(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Got OP_GuildWar of len %d", app->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); return; } @@ -11848,7 +11848,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) { - mlog(GUILDS__IN_PACKETS, "Received OP_SetGuildMOTD"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); if (app->size != sizeof(GuildMOTD_Struct)) { // client calls for a motd on login even if they arent in a guild @@ -11866,7 +11866,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) GuildMOTD_Struct* gmotd = (GuildMOTD_Struct*)app->pBuffer; - mlog(GUILDS__ACTIONS, "Setting MOTD for %s (%d) to: %s - %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", guild_mgr.GetGuildName(GuildID()), GuildID(), GetName(), gmotd->motd); if (!guild_mgr.SetGuildMOTD(GuildID(), gmotd->motd, GetName())) { diff --git a/zone/guild.cpp b/zone/guild.cpp index 0bc5186de..86a4c06dd 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) { } - mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMOTD of length %d", outapp->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -144,10 +144,10 @@ void Client::SendGuildSpawnAppearance() { if (!IsInAGuild()) { // clear guildtag SendAppearancePacket(AT_GuildID, GUILD_NONE); - mlog(GUILDS__OUT_PACKETS, "Sending spawn appearance for no guild tag."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); } else { uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID()); - mlog(GUILDS__OUT_PACKETS, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); SendAppearancePacket(AT_GuildID, GuildID()); if(GetClientVersion() >= EQClientRoF) { @@ -171,11 +171,11 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size); if(outapp->pBuffer == nullptr) { - mlog(GUILDS__ERROR, "Unable to make guild list!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); return; } - mlog(GUILDS__OUT_PACKETS, "Sending OP_ZoneGuildList of length %d", outapp->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -192,7 +192,7 @@ void Client::SendGuildMembers() { outapp->pBuffer = data; data = nullptr; - mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildMemberList of length %d", outapp->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); FastQueuePacket(&outapp); @@ -223,7 +223,7 @@ void Client::RefreshGuildInfo() CharGuildInfo info; if(!guild_mgr.GetCharInfo(CharacterID(), info)) { - mlog(GUILDS__ERROR, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); return; } @@ -335,7 +335,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){ outgj->rank = gj->rank; outgj->zoneid = gj->zoneid; - mlog(GUILDS__OUT_PACKETS, "Sending OP_GuildManageAdd for join of length %d", outapp->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); FastQueuePacket(&outapp); From d4f2e0ce5f83b70a6bb4bff70ee7dbe84ca22e90 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:20:01 -0600 Subject: [PATCH 138/707] port mlog 'AI' category to new log system --- common/eqemu_logsys.h | 4 +++- zone/bot.cpp | 6 ++--- zone/botspellsai.cpp | 4 ++-- zone/merc.cpp | 4 ++-- zone/mob_ai.cpp | 12 +++++----- zone/spells.cpp | 8 +++---- zone/waypoints.cpp | 54 +++++++++++++++++++++---------------------- 7 files changed, 47 insertions(+), 45 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 2ce906b41..00090cf24 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -75,6 +75,7 @@ public: Aggro, Attack, Quests, + AI, MaxCategoryID /* Don't Remove this*/ }; @@ -140,7 +141,8 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Client_Server_Packet", "Aggro", "Attack", - "Quests" + "Quests", + "AI" }; #endif \ No newline at end of file diff --git a/zone/bot.cpp b/zone/bot.cpp index 2381e64f3..3552ec6c5 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -3362,7 +3362,7 @@ void Bot::AI_Process() { else if(!IsRooted()) { if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) { - mlog(AI__WAYPOINTS, "Returning to location prior to being summoned."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed()); SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY())); return; @@ -3689,7 +3689,7 @@ void Bot::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - mlog(AI__WAYPOINTS, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -3972,7 +3972,7 @@ void Bot::PetAIProcess() { { botPet->SetRunAnimSpeed(0); if(!botPet->IsRooted()) { - mlog(AI__WAYPOINTS, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed()); return; } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index a5be7341e..5ee57305b 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -950,7 +950,7 @@ bool Bot::AI_PursueCastCheck() { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - mlog(AI__SPELLS, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) { if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) { @@ -1055,7 +1055,7 @@ bool Bot::AI_EngagedCastCheck() { BotStanceType botStance = GetBotStance(); bool mayGetAggro = HasOrMayGetAggro(); - mlog(AI__SPELLS, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); if(botClass == CLERIC) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { diff --git a/zone/merc.cpp b/zone/merc.cpp index f482ab71a..ec5a74308 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1647,7 +1647,7 @@ void Merc::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - mlog(AI__WAYPOINTS, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -1766,7 +1766,7 @@ bool Merc::AI_EngagedCastCheck() { { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - mlog(AI__SPELLS, "Engaged autocast check triggered (MERCS)."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); int8 mercClass = GetClass(); diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index e359194b5..a42e6157b 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1404,7 +1404,7 @@ void Mob::AI_Process() { else if (AImovement_timer->Check()) { if(!IsRooted()) { - mlog(AI__WAYPOINTS, "Pursuing %s while engaged.", target->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); if(!RuleB(Pathing, Aggro) || !zone->pathing) CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed()); else @@ -1639,7 +1639,7 @@ void NPC::AI_DoMovement() { roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1); } - mlog(AI__WAYPOINTS, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y); if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true)) { @@ -1727,7 +1727,7 @@ void NPC::AI_DoMovement() { { // currently moving if (cur_wp_x == GetX() && cur_wp_y == GetY()) { // are we there yet? then stop - mlog(AI__WAYPOINTS, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); SetWaypointPause(); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1809,7 +1809,7 @@ void NPC::AI_DoMovement() { if (!CP2Moved) { if(moved) { - mlog(AI__WAYPOINTS, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); ClearFeignMemory(); moved=false; SetMoving(false); @@ -1934,7 +1934,7 @@ bool NPC::AI_EngagedCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - mlog(AI__SPELLS, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); // try casting a heal or gate if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) { @@ -1957,7 +1957,7 @@ bool NPC::AI_PursueCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - mlog(AI__SPELLS, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) { //no spell cast, try again soon. AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false); diff --git a/zone/spells.cpp b/zone/spells.cpp index d3b2c3e4b..9dcc8a461 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3207,7 +3207,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) { int i, ret, firstfree = -2; - mlog(AI__BUFFS, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); int buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) @@ -3231,19 +3231,19 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) if(ret == 1) { // should overwrite current slot if(iFailIfOverwrite) { - mlog(AI__BUFFS, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return(-1); } if(firstfree == -2) firstfree = i; } if(ret == -1) { - mlog(AI__BUFFS, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return -1; // stop the spell, can't stack it } } - mlog(AI__BUFFS, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); return firstfree; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 203deacfa..5437d838d 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -166,7 +166,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if (GetGrid() < 0) { // currently stopped by a quest command SetGrid( 0 - GetGrid()); // get him moving again - mlog(AI__WAYPOINTS, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); } AIwalking_timer->Disable(); // disable timer in case he is paused at a wp if (cur_wp>=0) @@ -174,14 +174,14 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) save_wp=cur_wp; // save the current waypoint cur_wp=-1; // flag this move as quest controlled } - mlog(AI__WAYPOINTS, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); } else { // not on a grid roamer=true; save_wp=0; cur_wp=-2; // flag as quest controlled w/no grid - mlog(AI__WAYPOINTS, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); } if (saveguardspot) { @@ -196,7 +196,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if(guard_heading == -1) guard_heading = this->CalculateHeadingToTarget(mtx, mty); - mlog(AI__WAYPOINTS, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } cur_wp_x = mtx; @@ -212,7 +212,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) void NPC::UpdateWaypoint(int wp_index) { if(wp_index >= static_cast(Waypoints.size())) { - mlog(AI__WAYPOINTS, "Update to waypoint %d failed. Not found.", wp_index); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); return; } std::vector::iterator cur; @@ -224,7 +224,7 @@ void NPC::UpdateWaypoint(int wp_index) cur_wp_z = cur->z; cur_wp_pause = cur->pause; cur_wp_heading = cur->heading; - mlog(AI__WAYPOINTS, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); //fix up pathing Z if(zone->HasMap() && RuleB(Map, FixPathingZAtWaypoints)) @@ -430,7 +430,7 @@ void NPC::SetWaypointPause() void NPC::SaveGuardSpot(bool iClearGuardSpot) { if (iClearGuardSpot) { - mlog(AI__WAYPOINTS, "Clearing guard order."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); guard_x = 0; guard_y = 0; guard_z = 0; @@ -443,14 +443,14 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) { guard_heading = heading; if(guard_heading == 0) guard_heading = 0.0001; //hack to make IsGuarding simpler - mlog(AI__WAYPOINTS, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } } void NPC::NextGuardPosition() { if (!CalculateNewPosition2(guard_x, guard_y, guard_z, GetMovespeed())) { SetHeading(guard_heading); - mlog(AI__WAYPOINTS, "Unable to move to next guard position. Probably rooted."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); } else if((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z)) { @@ -516,15 +516,15 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords if(z_pos-z != 0) { z_pos = z; - mlog(AI__WAYPOINTS, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); return true; } - mlog(AI__WAYPOINTS, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); return false; } else if ((ABS(x_pos - x) < 0.1) && (ABS(y_pos - y) < 0.1)) { - mlog(AI__WAYPOINTS, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); if(IsNPC()) { entity_list.ProcessMove(CastToNPC(), x, y, z); @@ -550,7 +550,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; - mlog(AI__WAYPOINTS, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); uint8 NPCFlyMode = 0; @@ -569,7 +569,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -612,7 +612,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b //pRunAnimSpeed = (int8)(speed*NPC_RUNANIM_RATIO); //speed *= NPC_SPEED_MULTIPLIER; - mlog(AI__WAYPOINTS, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -647,7 +647,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b z_pos = new_z; tar_ndx=22-numsteps; heading = CalculateHeadingToTarget(x, y); - mlog(AI__WAYPOINTS, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } else { @@ -659,7 +659,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = y; z_pos = z; - mlog(AI__WAYPOINTS, "Only a single step to get there... jumping."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); } } @@ -678,7 +678,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; heading = CalculateHeadingToTarget(x, y); - mlog(AI__WAYPOINTS, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } uint8 NPCFlyMode = 0; @@ -698,7 +698,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr); - mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -759,7 +759,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec moved=false; } SetRunAnimSpeed(0); - mlog(AI__WAYPOINTS, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); return true; } @@ -773,7 +773,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec pRunAnimSpeed = (uint8)(speed*NPC_RUNANIM_RATIO); speed *= NPC_SPEED_MULTIPLIER; - mlog(AI__WAYPOINTS, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -790,7 +790,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = x; y_pos = y; z_pos = z; - mlog(AI__WAYPOINTS, "Close enough, jumping to waypoint"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); } else { float new_x = x_pos + tar_vx*tar_vector; @@ -803,7 +803,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = new_x; y_pos = new_y; z_pos = new_z; - mlog(AI__WAYPOINTS, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); } uint8 NPCFlyMode = 0; @@ -823,7 +823,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -951,7 +951,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { x_pos = new_x; y_pos = new_y; z_pos = new_z; - mlog(AI__WAYPOINTS, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); if(flymode == FlyMode1) return; @@ -967,7 +967,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -998,7 +998,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - mlog(AI__WAYPOINTS, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; From c9589dce2173ca63d7ba83c998c8dd863b9b6cbd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:21:51 -0600 Subject: [PATCH 139/707] Add 'Combat' log category --- common/eqemu_logsys.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 00090cf24..1bc5d93f3 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -76,6 +76,7 @@ public: Attack, Quests, AI, + Combat, MaxCategoryID /* Don't Remove this*/ }; @@ -142,7 +143,8 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Aggro", "Attack", "Quests", - "AI" + "AI", + "Combat" }; #endif \ No newline at end of file From 6a567288ae0d7527df2804510c558e0584448aea Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:22:53 -0600 Subject: [PATCH 140/707] port mlog 'Combat' category to new log system --- zone/attack.cpp | 124 +++++++++++++++++++-------------------- zone/bot.cpp | 62 ++++++++++---------- zone/mob.cpp | 2 +- zone/special_attacks.cpp | 56 +++++++++--------- zone/spell_effects.cpp | 4 +- 5 files changed, 124 insertions(+), 124 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 4e3aa3c2f..1bf858cf9 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) { damage = -3; - mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - mlog(COMBAT__DAMAGE, "Final damage after all avoidances: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac damage -= (myac * zone->random.Int(0, acrandom) / 10000); } if (damage<1) damage=1; - mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); } else { - mlog(COMBAT__DAMAGE, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); } } @@ -1135,7 +1135,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(!GetTarget()) SetTarget(other); - mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( @@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b || (GetHP() < 0) || (!IsAttackAllowed(other)) ) { - mlog(COMBAT__ATTACKS, "Attack canceled, invalid circumstances."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); return false; // Only bards can attack while casting } if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm - mlog(COMBAT__ATTACKS, "Attack canceled, Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - mlog(COMBAT__ATTACKS, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - mlog(COMBAT__ATTACKS, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - mlog(COMBAT__ATTACKS, "Attacking without a weapon."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - mlog(COMBAT__ATTACKS, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - mlog(COMBAT__DAMAGE, "Berserker damage bonus increases DMG to %d", weapon_damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b damage = mod_client_damage(damage, skillinuse, Hand, weapon, other); - mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); int hit_chance_bonus = 0; @@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { - mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it other->AvoidDamage(this, damage); @@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(damage > 0) CommonOutgoingHitSuccess(other, damage, skillinuse); - mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att } int exploss = 0; - mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); /* #1: Send death packet to everyone @@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); RemoveFromHateList(other); - mlog(COMBAT__ATTACKS, "I am not allowed to attack %s", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); } return false; } @@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { - mlog(COMBAT__ATTACKS, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){ - mlog(COMBAT__ATTACKS, "Attack with shield canceled."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); return false; } @@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { - mlog(COMBAT__DAMAGE, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); damage = (min_dmg+eleBane); } if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) { - mlog(COMBAT__DAMAGE, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } @@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } if(other->IsClient() && other->CastToClient()->IsSitting()) { - mlog(COMBAT__DAMAGE, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); damage = (max_dmg+eleBane); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); @@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool hate += opts->hate_flat; } - mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list other->AddToHateList(this, hate); @@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(damage > 0) { CommonOutgoingHitSuccess(other, damage, skillinuse); } - mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list if(damage > 0) other->AddToHateList(this, hate); @@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } - mlog(COMBAT__DAMAGE, "Final damage against %s: %d", other->GetName(), damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); if(other->IsClient() && IsPet() && GetOwner()->IsClient()) { //pets do half damage to clients in pvp @@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //cant riposte a riposte if (bRiposte && damage == -3) { - mlog(COMBAT__DAMAGE, "Riposte of riposte canceled."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); return false; } @@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - mlog(COMBAT__HITS, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); parse->EventNPC(EVENT_ATTACK, this, other, "", 0); } attacked_timer.Start(CombatEventTimer_expire); @@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { - mlog(COMBAT__HITS, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; if(killerMob) { @@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { if(DS == 0 && rev_ds == 0) return; - mlog(COMBAT__HITS, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); //invert DS... spells yield negative values for a true damage shield if(DS < 0) { @@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; if(rev_ds < 0) { - mlog(COMBAT__HITS, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? } @@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == SkillAbjuration); - mlog(COMBAT__HITS, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); if (GetInvul() || DivineAura()) { - mlog(COMBAT__DAMAGE, "Avoiding %d damage due to invulnerability.", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } @@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int healed = damage; healed = attacker->GetActSpellHealing(spell_id, healed); - mlog(COMBAT__DAMAGE, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); attacker->HealDamage(healed); //we used to do a message to the client, but its gone now. @@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //see if any runes want to reduce this damage if(spell_id == SPELL_UNKNOWN) { damage = ReduceDamage(damage); - mlog(COMBAT__HITS, "Melee Damage reduced to %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); damage = ReduceAllDamage(damage); TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); } else { @@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //fade mez if we are mezzed if (IsMezzed() && attacker) { - mlog(COMBAT__HITS, "Breaking mez due to attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); @@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int stun_resist = itembonuses.StunResist + spellbonuses.StunResist; int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist; - mlog(COMBAT__HITS, "Stun passed, checking resists. Was %d chance.", stun_chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); if (IsClient()) { stun_resist += aabonuses.StunResist; frontal_stun_resist += aabonuses.FrontalStunResist; @@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (((GetBaseRace() == OGRE && IsClient()) || (frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) { - mlog(COMBAT__HITS, "Frontal stun resisted. %d chance.", frontal_stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); } else { // Normal stun resist check. if (stun_resist && zone->random.Roll(stun_resist)) { if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - mlog(COMBAT__HITS, "Stun Resisted. %d chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); } else { - mlog(COMBAT__HITS, "Stunned. %d resist chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds } } } else { - mlog(COMBAT__HITS, "Stun failed. %d chance.", stun_chance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); } } @@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //increment chances of interrupting if(IsCasting()) { //shouldnt interrupt on regular spell damage attacked_count++; - mlog(COMBAT__HITS, "Melee attack while casting. Attack count %d", attacked_count); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); } } @@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) ProcChance += ProcChance * ProcBonus / 100.0f; } - mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h ProcBonus += static_cast(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f; ProcChance = ProcChance + (ProcChance * ProcBonus); - mlog(COMBAT__PROCS, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3923,12 +3923,12 @@ void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { } if (!IsAttackAllowed(on)) { - mlog(COMBAT__PROCS, "Preventing procing off of unattackable things."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); return; } if (DivineAura()) { - mlog(COMBAT__PROCS, "Procs canceled, Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); return; } @@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on static_cast(weapon->ProcRate)) / 100.0f; if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really. if (weapon->Proc.Level > ourlevel) { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); if (IsPet()) { @@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on Message_StringID(13, PROC_TOOLOW); } } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100); ExecWeaponProc(inst, weapon->Proc.Effect, on); @@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, // Perma procs (AAs) if (PermaProcs[i].spellID != SPELL_UNKNOWN) { if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus? - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d procing spell %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); ExecWeaponProc(nullptr, PermaProcs[i].spellID, on); } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d failed to proc %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); } @@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (SpellProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(SpellProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d procing spell %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID); } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d failed to proc %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); } @@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (RangedProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(RangedProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d procing spell %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID); } else { - mlog(COMBAT__PROCS, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d failed to proc %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); } @@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Mob::DoRiposte(Mob* defender) { - mlog(COMBAT__ATTACKS, "Preforming a riposte"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) { //Live AA - Double Riposte if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - mlog(COMBAT__ATTACKS, "Preforming a double riposed (%d percent chance)", DoubleRipChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); if (HasDied()) return; } @@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) { DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - mlog(COMBAT__ATTACKS, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); if (defender->GetClass() == MONK) defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); @@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; - mlog(COMBAT__DAMAGE, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); damage += (damage*dmgbonusmod/10000); } } @@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { if (!TryFadeEffect(spellbonuses.Root[1])) { BuffFadeBySlot(spellbonuses.Root[1]); - mlog(COMBAT__HITS, "Spell broke root! BreakChance percent chance"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); return true; } } } - mlog(COMBAT__HITS, "Spell did not break root. BreakChance percent chance"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); return false; } @@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible() { //break invis when you attack if(invisible) { - mlog(COMBAT__ATTACKS, "Removing invisibility due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - mlog(COMBAT__ATTACKS, "Removing invisibility vs. undead due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - mlog(COMBAT__ATTACKS, "Removing invisibility vs. animals due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 3552ec6c5..fb3f86c90 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) { - mlog(COMBAT__RANGED, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) { if(!RangeWeapon || !Ammo) return; - mlog(COMBAT__RANGED, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); if(!IsAttackAllowed(other) || IsCasting() || @@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) { //break invis when you attack if(invisible) { - mlog(COMBAT__ATTACKS, "Removing invisibility due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - mlog(COMBAT__ATTACKS, "Removing invisibility vs. undead due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - mlog(COMBAT__ATTACKS, "Removing invisibility vs. animals due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - mlog(COMBAT__HITS, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); parse->EventNPC(EVENT_ATTACK, this, from, "", 0); } @@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ // if spell is lifetap add hp to the caster if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) { int healed = GetActSpellHealing(spell_id, damage); - mlog(COMBAT__DAMAGE, "Applying lifetap heal of %d to %s", healed, GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } @@ -6024,7 +6024,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(!GetTarget() || GetTarget() != other) SetTarget(other); - mlog(COMBAT__ATTACKS, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || other == nullptr || @@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName()); if(other) { RemoveFromHateList(other); - mlog(COMBAT__ATTACKS, "I am not allowed to attack %s", other->GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); } return false; } if(DivineAura()) {//cant attack while invulnerable - mlog(COMBAT__ATTACKS, "Attack canceled, Divine Aura is in effect."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); return false; } @@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - mlog(COMBAT__ATTACKS, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - mlog(COMBAT__ATTACKS, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - mlog(COMBAT__ATTACKS, "Attacking without a weapon."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - mlog(COMBAT__ATTACKS, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(berserk && (GetClass() == BERSERKER)){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - mlog(COMBAT__DAMAGE, "Berserker damage bonus increases DMG to %d", weapon_damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b else damage = zone->random.Int(min_hit, max_hit); - mlog(COMBAT__DAMAGE, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel()); if(opts) { @@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(other, skillinuse, Hand)) { - mlog(COMBAT__ATTACKS, "Attack missed. Damage set to 0."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; other->AddToHateList(this, 0); } else { //we hit, try to avoid it @@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b ApplyMeleeDamageBonus(skillinuse, damage); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); TryCriticalHit(other, skillinuse, damage, opts); - mlog(COMBAT__HITS, "Generating hate %d towards %s", hate, GetCleanName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); // now add done damage to the hate list //other->AddToHateList(this, hate); } else other->AddToHateList(this, 0); - mlog(COMBAT__DAMAGE, "Final damage after all reductions: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //break invis when you attack if(invisible) { - mlog(COMBAT__ATTACKS, "Removing invisibility due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - mlog(COMBAT__ATTACKS, "Removing invisibility vs. undead due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - mlog(COMBAT__ATTACKS, "Removing invisibility vs. animals due to melee attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { ProcChance += ProcChance*ProcBonus / 100.0f; } - mlog(COMBAT__PROCS, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) { damage = -3; - mlog(COMBAT__DAMAGE, "I am enraged, riposting frontal attack."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - mlog(COMBAT__DAMAGE, "Final damage after all avoidances: %d", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) uint16 levelreq = aabonuses.FinishingBlowLvl[0]; if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){ - mlog(COMBAT__ATTACKS, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse); return true; } else { - mlog(COMBAT__ATTACKS, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); return false; } } @@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Bot::DoRiposte(Mob* defender) { - mlog(COMBAT__ATTACKS, "Preforming a riposte"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) { defender->GetItemBonuses().GiveDoubleRiposte[0]; if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { - mlog(COMBAT__ATTACKS, "Preforming a double riposte (%d percent chance)", DoubleRipChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); } @@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f); float DefenderChance = (float)zone->random.Real(0.00f, 1.00f); if(AttackerChance > DefenderChance) { - mlog(COMBAT__ATTACKS, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); // WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW //entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName()); @@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { Result = true; } else { - mlog(COMBAT__ATTACKS, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); } } } diff --git a/zone/mob.cpp b/zone/mob.cpp index 3ea572eb6..d63cdf0f7 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) { if(lifetap_amt && damage > 0){ lifetap_amt = damage * lifetap_amt / 100; - mlog(COMBAT__DAMAGE, "Melee lifetap healing for %d damage.", damage); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); if (lifetap_amt > 0) HealDamage(lifetap_amt); //Heal self for modified damage amount. diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 5255ff1f6..bf8d875b8 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -683,7 +683,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - mlog(COMBAT__RANGED, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -695,12 +695,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const ItemInst* Ammo = m_inv[MainAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); return; } @@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const Item_Struct* AmmoItem = Ammo->GetItem(); if(RangeItem->ItemType != ItemTypeBow) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID()); return; } if(AmmoItem->ItemType != ItemTypeArrow) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow); return; } - mlog(COMBAT__RANGED, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); //look for ammo in inventory if we only have 1 left... if(Ammo->GetCharges() == 1) { @@ -746,7 +746,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { Ammo = baginst; ammo_slot = m_inv.CalcSlotId(r, i); found = true; - mlog(COMBAT__RANGED, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); break; } } @@ -761,17 +761,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (aslot != INVALID_INDEX) { ammo_slot = aslot; Ammo = m_inv[aslot]; - mlog(COMBAT__RANGED, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); } } } float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget()); - mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - mlog(COMBAT__RANGED, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -799,9 +799,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){ DeleteItemInInventory(ammo_slot, 1, true); - mlog(COMBAT__RANGED, "Consumed one arrow from slot %d", ammo_slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); } else { - mlog(COMBAT__RANGED, "Endless Quiver prevented ammo consumption."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); } CheckIncreaseSkill(SkillArchery, GetTarget(), -15); @@ -873,7 +873,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillArchery); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { - mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillArchery, 0, RangeWeapon, Ammo, AmmoSlot, speed); @@ -882,7 +882,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery); } else { - mlog(COMBAT__RANGED, "Ranged attack hit %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); bool HeadShot = false; uint32 HeadShot_Dmg = TryHeadShot(other, SkillArchery); @@ -923,7 +923,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite MaxDmg += MaxDmg*bonusArcheryDamageModifier / 100; - mlog(COMBAT__RANGED, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); bool dobonus = false; if(GetClass() == RANGER && GetLevel() > 50){ @@ -944,7 +944,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite hate *= 2; MaxDmg = mod_archery_bonus_damage(MaxDmg, RangeWeapon); - mlog(COMBAT__RANGED, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); } } @@ -1192,7 +1192,7 @@ void NPC::RangedAttack(Mob* other) //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){ - mlog(COMBAT__RANGED, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -1361,7 +1361,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - mlog(COMBAT__RANGED, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -1371,19 +1371,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const ItemInst* RangeWeapon = m_inv[MainRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { - mlog(COMBAT__RANGED, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); return; } - mlog(COMBAT__RANGED, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); if(RangeWeapon->GetCharges() == 1) { //first check ammo @@ -1392,7 +1392,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = MainAmmo; - mlog(COMBAT__RANGED, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal); @@ -1400,17 +1400,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //the item wont change, but the instance does, not that it matters ammo_slot = aslot; RangeWeapon = m_inv[aslot]; - mlog(COMBAT__RANGED, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } } } float range = item->Range + GetRangeDistTargetSizeMod(other); - mlog(COMBAT__RANGED, "Calculated bow range to be %.1f", range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - mlog(COMBAT__RANGED, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1489,7 +1489,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillThrowing); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ - mlog(COMBAT__RANGED, "Ranged attack missed %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); return; @@ -1497,7 +1497,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing); } else { - mlog(COMBAT__RANGED, "Throwing attack hit %s.", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); int16 WDmg = 0; @@ -1533,7 +1533,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); } - mlog(COMBAT__RANGED, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) other->AvoidDamage(this, TotalDmg, false); //CanRiposte=false - Can not riposte throw attacks. diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 217172e8b..f666c62ce 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -711,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) stun_resist += aabonuses.StunResist; if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) { - mlog(COMBAT__HITS, "Stunned. We had %d percent resist chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; @@ -721,7 +721,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - mlog(COMBAT__HITS, "Stun Resisted. We had %d percent resist chance.", stun_resist); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } } break; From 1405d9e114b868df2ab9bb90169b4641f53bbe6a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:28:25 -0600 Subject: [PATCH 141/707] port mlog 'CLIENT__SPELLS' category to new log system --- zone/client_packet.cpp | 1 - zone/mob.cpp | 4 ++-- zone/spells.cpp | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 68f537ab7..3f021640e 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -5119,7 +5119,6 @@ void Client::Handle_OP_Death(const EQApplicationPacket *app) //I think this attack_skill value is really a value from SkillDamageTypes... if (ds->attack_skill > HIGHEST_SKILL) { - mlog(CLIENT__ERROR, "Invalid skill in OP_Death: %d"); return; } diff --git a/zone/mob.cpp b/zone/mob.cpp index d63cdf0f7..7cfc58bcc 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1576,7 +1576,7 @@ void Mob::SendIllusionPacket(uint16 in_race, uint8 in_gender, uint8 in_texture, entity_list.QueueClients(this, outapp); safe_delete(outapp); - mlog(CLIENT__SPELLS, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size); } @@ -3043,7 +3043,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) { if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function if(IsClient()){ Message(0, "Invalid spell proc %u", spell_id); - mlog(CLIENT__SPELLS, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); } return; } diff --git a/zone/spells.cpp b/zone/spells.cpp index 9dcc8a461..1b4de2406 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4822,7 +4822,7 @@ void Client::MemSpell(uint16 spell_id, int slot, bool update_client) } m_pp.mem_spells[slot] = spell_id; - mlog(CLIENT__SPELLS, "Spell %d memorized into slot %d", spell_id, slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); database.SaveCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4837,7 +4837,7 @@ void Client::UnmemSpell(int slot, bool update_client) if(slot > MAX_PP_MEMSPELL || slot < 0) return; - mlog(CLIENT__SPELLS, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); m_pp.mem_spells[slot] = 0xFFFFFFFF; database.DeleteCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4870,7 +4870,7 @@ void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client) m_pp.spell_book[slot] = spell_id; database.SaveCharacterSpell(this->CharacterID(), spell_id, slot); - mlog(CLIENT__SPELLS, "Spell %d scribed into spell book slot %d", spell_id, slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); if(update_client) { @@ -4883,7 +4883,7 @@ void Client::UnscribeSpell(int slot, bool update_client) if(slot >= MAX_PP_SPELLBOOK || slot < 0) return; - mlog(CLIENT__SPELLS, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); m_pp.spell_book[slot] = 0xFFFFFFFF; database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[slot], slot); @@ -4914,7 +4914,7 @@ void Client::UntrainDisc(int slot, bool update_client) if(slot >= MAX_PP_DISCIPLINES || slot < 0) return; - mlog(CLIENT__SPELLS, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); m_pp.disciplines.values[slot] = 0; database.DeleteCharacterDisc(this->CharacterID(), slot); From 5b41bdeec64fb13724fdd32e15674cad939b4779 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:30:58 -0600 Subject: [PATCH 142/707] port mlog 'CLIENT__TRADING' category to new log system --- zone/client_process.cpp | 2 +- zone/trading.cpp | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index fe89c942d..81c0f384f 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -799,7 +799,7 @@ void Client::OnDisconnect(bool hard_disconnect) { Mob *Other = trade->With(); if(Other) { - mlog(TRADING__CLIENT, "Client disconnected during a trade. Returning their items."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); FinishTrade(this); if(Other->IsClient()) diff --git a/zone/trading.cpp b/zone/trading.cpp index 12fc01a64..4c06dfc42 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -458,7 +458,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st bool qs_log = false; if(other) { - mlog(TRADING__CLIENT, "Finishing trade with client %s", other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); this->AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true); @@ -491,7 +491,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { - mlog(TRADING__CLIENT, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - mlog(TRADING__CLIENT, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -552,17 +552,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - mlog(TRADING__ERROR, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - mlog(TRADING__ERROR, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - mlog(TRADING__ERROR, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -606,10 +606,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st inst->SetCharges(0); } - mlog(TRADING__CLIENT, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); if (other->PutItemInInventory(partial_slot, *partial_inst, true)) { - mlog(TRADING__CLIENT, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, (old_charges - inst->GetCharges())); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -635,7 +635,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - mlog(TRADING__ERROR, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName(), (old_charges - inst->GetCharges())); inst->SetCharges(old_charges); @@ -710,7 +710,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst) { - mlog(TRADING__CLIENT, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -718,7 +718,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - mlog(TRADING__CLIENT, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -772,17 +772,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - mlog(TRADING__ERROR, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - mlog(TRADING__ERROR, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - mlog(TRADING__ERROR, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } From a46c0ee7e2dcf094c4b0e4d9cb91525443c19c5b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:32:45 -0600 Subject: [PATCH 143/707] Add 'Pathing' log category --- common/eqemu_logsys.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 1bc5d93f3..3cce91ebe 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -77,6 +77,7 @@ public: Quests, AI, Combat, + Pathing, MaxCategoryID /* Don't Remove this*/ }; @@ -144,7 +145,8 @@ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "Attack", "Quests", "AI", - "Combat" + "Combat", + "Pathing" }; #endif \ No newline at end of file From 648494ec16f90334c09c5ca5d5b83afadefbf329 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:33:48 -0600 Subject: [PATCH 144/707] port mlog '*PATHING*' category to new log system --- zone/mob_ai.cpp | 6 +++--- zone/waypoints.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index a42e6157b..699bd1dea 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -1692,11 +1692,11 @@ void NPC::AI_DoMovement() { else { movetimercompleted=false; - mlog(QUESTS__PATHING, "We are departing waypoint %d.", cur_wp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); //if we were under quest control (with no grid), we are done now.. if(cur_wp == -2) { - mlog(QUESTS__PATHING, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); roamer = false; cur_wp = 0; } @@ -1773,7 +1773,7 @@ void NPC::AI_DoMovement() { if (movetimercompleted==true) { // time to pause has ended SetGrid( 0 - GetGrid()); // revert to AI control - mlog(QUESTS__PATHING, "Quest pathing is finished. Resuming on grid %d", GetGrid()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 5437d838d..45f8db13f 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -88,7 +88,7 @@ void NPC::StopWandering() roamer=false; CastToNPC()->SetGrid(0); SendPosition(); - mlog(QUESTS__PATHING, "Stop Wandering requested."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); return; } @@ -107,11 +107,11 @@ void NPC::ResumeWandering() cur_wp=save_wp; UpdateWaypoint(cur_wp); // have him head to last destination from here } - mlog(QUESTS__PATHING, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); } else if (AIwalking_timer->Enabled()) { // we are at a waypoint paused normally - mlog(QUESTS__PATHING, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); AIwalking_timer->Trigger(); // disable timer to end pause now } else @@ -143,7 +143,7 @@ void NPC::PauseWandering(int pausetime) if (GetGrid() != 0) { DistractedFromGrid = true; - mlog(QUESTS__PATHING, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); SendPosition(); if (pausetime<1) { // negative grid number stops him dead in his tracks until ResumeWandering() From 0641be187da73a1e1ce3ac2f3864016bf0894014 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:46:26 -0600 Subject: [PATCH 145/707] Convert Client unhandled incoming opcodes --- zone/attack.cpp | 2 +- zone/client_packet.cpp | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 1bf858cf9..fdb95e467 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -3506,7 +3506,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse()) { if (!pet->IsHeld()) { - mlog(PETS__AGGRO, "Sending pet %s into battle due to attack.", pet->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1); pet->SetTarget(attacker); Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 3f021640e..561b7ba90 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -458,18 +458,20 @@ int Client::HandlePacket(const EQApplicationPacket *app) args.push_back(const_cast(app)); parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); -#if (EQDEBUG >= 10) + char buffer[64]; app->build_header_dump(buffer); - mlog(CLIENT__NET_ERR, "Unhandled incoming opcode: %s", buffer); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s", buffer); - if(app->size < 1000) - DumpPacket(app, app->size); - else{ - std::cout << "Dump limited to 1000 characters:\n"; - DumpPacket(app, 1000); + if (logger.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console == 1){ + if (app->size < 1000) + DumpPacket(app, app->size); + else{ + std::cout << "Dump limited to 1000 characters:\n"; + DumpPacket(app, 1000); + } } -#endif + break; } From b0412101b0106f3df431a5b1abb5756b3f1d406d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:48:50 -0600 Subject: [PATCH 146/707] Convert Client::HandlePaclet --- zone/client_packet.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 561b7ba90..b45f69e7b 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -400,7 +400,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) if(is_log_enabled(CLIENT__NET_IN_TRACE)) { char buffer[64]; app->build_header_dump(buffer); - mlog(CLIENT__NET_IN_TRACE, "Dispatch opcode: %s", buffer); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); } EmuOpcode opcode = app->GetOpcode(); @@ -459,11 +459,10 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); - char buffer[64]; - app->build_header_dump(buffer); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s", buffer); - - if (logger.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console == 1){ + char buffer[64]; + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s", buffer); + if (logger.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ + app->build_header_dump(buffer); if (app->size < 1000) DumpPacket(app, app->size); else{ From 483086dc3a4c422f7f43a5eef55153b6f8cbbeed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:50:29 -0600 Subject: [PATCH 147/707] Convert OPGMTrainSkill mlogs --- zone/client_process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 81c0f384f..2d64eed51 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1723,12 +1723,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id; if(!CanHaveSkill(skill)) { - mlog(CLIENT__ERROR, "Tried to train skill %d, which is not allowed.", skill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); return; } if(MaxSkill(skill) == 0) { - mlog(CLIENT__ERROR, "Tried to train skill %d, but training is not allowed at this level.", skill); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); return; } From d490209c9ec9b1eb8c7c8959ae3418cef2668c8a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:52:30 -0600 Subject: [PATCH 148/707] Convert skill mlog call --- zone/special_attacks.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index bf8d875b8..cb4b77f78 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -464,7 +464,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) break; } default: - mlog(CLIENT__ERROR, "Invalid special attack type %d attempted", unchecked_type); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); return(1000); /* nice long delay for them, the caller depends on this! */ } From 3d5434b91dd1bf40e3ce621924ad2e668e5d28e5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:54:02 -0600 Subject: [PATCH 149/707] Remove mlog and _log completely --- common/logsys.h | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/common/logsys.h b/common/logsys.h index 9b3da9aa2..567d3f8db 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -73,32 +73,9 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #ifdef DISABLE_LOGSYS //completely disabled, this is the best I can come up with since we have no variadic macros - inline void _log(LogType, const char *, ...) {}//i feel dirty for putting this ifdef here, but I dont wanna have to include a header in all zone files to get it - inline void mlog(LogType, const char *, ...) {} inline void clog(LogType, const char *, ...) {} inline void zlog(LogType, const char *, ...) {} #else //!DISABLE_LOGSYS - - //we have variadic macros, hooray! - //the do-while construct is needed to allow a ; at the end of log(); lines when used - //in conditional statements without {}'s - #define _log( type, format, ...) \ - do { \ - if(log_type_info[ type ].enabled) { \ - log_message(type, format, ##__VA_ARGS__); \ - } \ - } while(false) - #ifdef ZONE - class Mob; - extern void log_message_mob(LogType type, Mob *who, const char *fmt, ...); - #define mlog( type, format, ...) \ - do { \ - if(IsLoggingEnabled()) \ - if(log_type_info[ type ].enabled) { \ - log_message_mob(type, this, format, ##__VA_ARGS__); \ - } \ - } while(false) - #endif #ifdef WORLD class Client; extern void log_message_client(LogType type, Client *who, const char *fmt, ...); From bcaaaac090bddf71fb408e18e8bf52d093c18979 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:56:10 -0600 Subject: [PATCH 150/707] Replace all clog calls, (Mostly WORLD__) --- world/client.cpp | 120 +++++++++++++++++++++++------------------------ 1 file changed, 60 insertions(+), 60 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index 4a4cbb1d0..e83961435 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -136,7 +136,7 @@ void Client::SendEnterWorld(std::string name) eqs->Close(); return; } else { - clog(WORLD__CLIENT,"Telling client to continue session."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); } } @@ -378,7 +378,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if (strlen(password) <= 1) { // TODO: Find out how to tell the client wrong username/password - clog(WORLD__CLIENT_ERR,"Login without a password"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); return false; } @@ -408,31 +408,31 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password))) #else if (loginserverlist.Connected() == false && !pZoning) { - clog(WORLD__CLIENT_ERR,"Error: Login server login while not connected to login server."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); return false; } if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password)))) #endif { if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) { - clog(WORLD__CLIENT_ERR,"ID is 0. Is this server connected to minilogin?"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); if(!minilogin) - clog(WORLD__CLIENT_ERR,"If so you forget the minilogin variable..."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); else - clog(WORLD__CLIENT_ERR,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); return false; } cle->SetOnline(); - clog(WORLD__CLIENT,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); if(minilogin){ WorldConfig::DisableStats(); - clog(WORLD__CLIENT,"MiniLogin Account #%d",cle->AccountID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); } else { - clog(WORLD__CLIENT,"LS Account #%d",cle->LSID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); } const WorldConfig *Config=WorldConfig::get(); @@ -465,7 +465,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { } else { // TODO: Find out how to tell the client wrong username/password - clog(WORLD__CLIENT_ERR,"Bad/Expired session key '%s'",name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); return false; } @@ -479,7 +479,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - clog(WORLD__CLIENT_ERR,"Name approval request with no logged in account"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); return false; } @@ -487,7 +487,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) uchar race = app->pBuffer[64]; uchar clas = app->pBuffer[68]; - clog(WORLD__CLIENT, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); EQApplicationPacket *outapp; outapp = new EQApplicationPacket; @@ -648,11 +648,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app) bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - clog(WORLD__CLIENT_ERR,"Account ID not set; unable to create character."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); return false; } else if (app->size != sizeof(CharCreate_Struct)) { - clog(WORLD__CLIENT_ERR,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); DumpPacket(app); // the previous behavior was essentially returning true here // but that seems a bit odd to me. @@ -679,14 +679,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - clog(WORLD__CLIENT_ERR,"Enter world with no logged in account"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); eqs->Close(); return true; } if(GetAdmin() < 0) { - clog(WORLD__CLIENT,"Account banned or suspended."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); eqs->Close(); return true; } @@ -702,14 +702,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { uint32 tmpaccid = 0; charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID); if (charid == 0 || tmpaccid != GetAccountID()) { - clog(WORLD__CLIENT_ERR,"Could not get CharInfo for '%s'",char_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); eqs->Close(); return true; } // Make sure this account owns this character if (tmpaccid != GetAccountID()) { - clog(WORLD__CLIENT_ERR,"This account does not own the character named '%s'",char_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); eqs->Close(); return true; } @@ -737,7 +737,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { zoneID = database.MoveCharacterToBind(charid,4); } else { - clog(WORLD__CLIENT_ERR,"'%s' is trying to go home before they're able...",char_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able."); eqs->Close(); return true; @@ -770,7 +770,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { } else { - clog(WORLD__CLIENT_ERR,"'%s' is trying to go to tutorial but are not allowed...",char_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character."); eqs->Close(); return true; @@ -780,7 +780,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (zoneID == 0 || !database.GetZoneName(zoneID)) { // This is to save people in an invalid zone, once it's removed from the DB database.MoveCharacterToZone(charid, "arena"); - clog(WORLD__CLIENT_ERR, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); } if(instanceID > 0) @@ -894,7 +894,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) { uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer); if(char_acct_id == GetAccountID()) { - clog(WORLD__CLIENT,"Delete character: %s",app->pBuffer); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); database.DeleteCharacter((char *)app->pBuffer); SendCharInfo(); } @@ -915,25 +915,25 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { EmuOpcode opcode = app->GetOpcode(); - clog(WORLD__CLIENT_TRACE,"Recevied EQApplicationPacket"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); _pkt(WORLD__CLIENT_TRACE,app); if (!eqs->CheckState(ESTABLISHED)) { - clog(WORLD__CLIENT,"Client disconnected (net inactive on send)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); return false; } // Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) { if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) { - clog(WORLD__CLIENT,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); eqs->Close(); } } if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) { // Got a packet other than OP_SendLoginInfo when not logged in - clog(WORLD__CLIENT_ERR,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); return false; } else if (opcode == OP_AckPacket) { @@ -1005,7 +1005,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } default: { - clog(WORLD__CLIENT_ERR,"Received unknown EQApplicationPacket"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); _pkt(WORLD__CLIENT_ERR,app); return true; } @@ -1024,7 +1024,7 @@ bool Client::Process() { to.sin_addr.s_addr = ip; if (autobootup_timeout.Check()) { - clog(WORLD__CLIENT_ERR, "Zone bootup timer expired, bootup failed or too slow."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); ZoneUnavail(); } if(connect.Check()){ @@ -1058,7 +1058,7 @@ bool Client::Process() { loginserverlist.SendPacket(pack); safe_delete(pack); } - clog(WORLD__CLIENT,"Client disconnected (not active in process)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); return false; } @@ -1107,17 +1107,17 @@ void Client::EnterWorld(bool TryBootup) { } else { if (TryBootup) { - clog(WORLD__CLIENT,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); autobootup_timeout.Start(); pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID); if (pwaitingforbootup == 0) { - clog(WORLD__CLIENT_ERR,"No zoneserver available to boot up."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); ZoneUnavail(); } return; } else { - clog(WORLD__CLIENT_ERR,"Requested zone %s is no running.",zone_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); ZoneUnavail(); return; } @@ -1126,12 +1126,12 @@ void Client::EnterWorld(bool TryBootup) { cle->SetChar(charid, char_name); database.UpdateLiveChar(char_name, GetAccountID()); - clog(WORLD__CLIENT,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); // database.SetAuthentication(account_id, char_name, zone_name, ip); if (seencharsel) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) { - clog(WORLD__CLIENT_ERR,"Enter world failed. Zone is locked."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); ZoneUnavail(); return; } @@ -1169,9 +1169,9 @@ void Client::Clearance(int8 response) { if (zs == 0) { - clog(WORLD__CLIENT_ERR,"Unable to find zoneserver in Client::Clearance!!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); } else { - clog(WORLD__CLIENT_ERR, "Invalid response %d in Client::Clearance", response); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); } ZoneUnavail(); @@ -1181,20 +1181,20 @@ void Client::Clearance(int8 response) EQApplicationPacket* outapp; if (zs->GetCAddress() == nullptr) { - clog(WORLD__CLIENT_ERR, "Unable to do zs->GetCAddress() in Client::Clearance!!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); ZoneUnavail(); return; } if (zoneID == 0) { - clog(WORLD__CLIENT_ERR, "zoneID is nullptr in Client::Clearance!!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } const char* zonename = database.GetZoneName(zoneID); if (zonename == 0) { - clog(WORLD__CLIENT_ERR, "zonename is nullptr in Client::Clearance!!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } @@ -1225,7 +1225,7 @@ void Client::Clearance(int8 response) } strcpy(zsi->ip, zs_addr); zsi->port =zs->GetCPort(); - clog(WORLD__CLIENT,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); QueuePacket(outapp); safe_delete(outapp); @@ -1256,7 +1256,7 @@ bool Client::GenPassKey(char* key) { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { - clog(WORLD__CLIENT_TRACE, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); _pkt(WORLD__CLIENT_TRACE, app); ack_req = true; // It's broke right now, dont delete this line till fix it. =P @@ -1358,27 +1358,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) in.s_addr = GetIP(); - clog(WORLD__CLIENT, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); - clog(WORLD__CLIENT, "Name: %s", name); - clog(WORLD__CLIENT, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false"); - clog(WORLD__CLIENT, "STR STA AGI DEX WIS INT CHA Total"); - clog(WORLD__CLIENT, "%3d %3d %3d %3d %3d %3d %3d %3d", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA, stats_sum); - clog(WORLD__CLIENT, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); - clog(WORLD__CLIENT, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); - clog(WORLD__CLIENT, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); /* Validate the char creation struct */ if (ClientVersionBit & BIT_SoFAndLater) { if (!CheckCharCreateInfoSoF(cc)) { - clog(WORLD__CLIENT_ERR,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } else { if (!CheckCharCreateInfoTitanium(cc)) { - clog(WORLD__CLIENT_ERR,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } @@ -1440,21 +1440,21 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) /* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */ if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) { - clog(WORLD__CLIENT,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); pp.zone_id = RuleI(World, SoFStartZoneID); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - clog(WORLD__CLIENT_ERR,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); } else { /* if there's a startzone variable put them in there */ if (database.GetVariable("startzone", startzone, 50)) { - clog(WORLD__CLIENT,"Found 'startzone' variable setting: %s", startzone); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); pp.zone_id = database.GetZoneID(startzone); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - clog(WORLD__CLIENT_ERR,"Error getting zone id for '%s'", startzone); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); } else { /* otherwise use normal starting zone logic */ bool ValidStartZone = false; if (ClientVersionBit & BIT_TitaniumAndEarlier) @@ -1493,11 +1493,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) pp.binds[0].z = pp.z; pp.binds[0].heading = pp.heading; - clog(WORLD__CLIENT,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading); - clog(WORLD__CLIENT,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z); - clog(WORLD__CLIENT,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z); /* Starting Items inventory */ @@ -1506,10 +1506,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) // now we give the pp and the inv we made to StoreCharacter // to see if we can store it if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) { - clog(WORLD__CLIENT_ERR,"Character creation failed: %s", pp.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); return false; } - clog(WORLD__CLIENT,"Character creation successful: %s", pp.name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); return true; } From 1069b13992091ba68322d425528b94f852c84131 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:57:47 -0600 Subject: [PATCH 151/707] Remove clog completely --- common/logsys.h | 10 ---------- world/client.cpp | 3 --- 2 files changed, 13 deletions(-) diff --git a/common/logsys.h b/common/logsys.h index 567d3f8db..15584276f 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -73,19 +73,9 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #ifdef DISABLE_LOGSYS //completely disabled, this is the best I can come up with since we have no variadic macros - inline void clog(LogType, const char *, ...) {} inline void zlog(LogType, const char *, ...) {} #else //!DISABLE_LOGSYS #ifdef WORLD - class Client; - extern void log_message_client(LogType type, Client *who, const char *fmt, ...); - #define clog( type, format, ...) \ - do { \ - if(log_type_info[ type ].enabled) { \ - log_message_client(type, this, format, ##__VA_ARGS__); \ - } \ - } while(false) - class ZoneServer; extern void log_message_zone(LogType type, ZoneServer *who, const char *fmt, ...); #define zlog( type, format, ...) \ diff --git a/world/client.cpp b/world/client.cpp index e83961435..0584fac61 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1270,12 +1270,9 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList("", outapp->size); if(outapp->pBuffer == nullptr) { - clog(GUILDS__ERROR, "Unable to make guild list!"); return; } - clog(GUILDS__OUT_PACKETS, "Sending OP_GuildsList of length %d", outapp->size); -// _pkt(GUILDS__OUT_PACKET_TRACE, outapp); eqs->FastQueuePacket((EQApplicationPacket **)&outapp); } From 551aadd27a7d2306dd94070ea8735fb167d877de Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:59:10 -0600 Subject: [PATCH 152/707] Replace all zlog calls --- world/zoneserver.cpp | 80 ++++++++++++++++++++++---------------------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 29abeabf9..a55009514 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -77,7 +77,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { char* longname; if (iZoneID) - zlog(WORLD__ZONE,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, iStaticZone ? " (Static)" : ""); zoneID = iZoneID; @@ -188,7 +188,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - zlog(WORLD__ZONE_ERR,"Zone authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -199,7 +199,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - zlog(WORLD__ZONE_ERR,"Zone authorization failed."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -541,10 +541,10 @@ bool ZoneServer::Process() { RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer; if (zoneserver_list.SendPacket(pack)){ - zlog(WORLD__ZONE,"Sent Rez packet for %s",sRezz->rez.your_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); } else { - zlog(WORLD__ZONE,"Could not send Rez packet for %s",sRezz->rez.your_name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); } break; } @@ -589,10 +589,10 @@ bool ZoneServer::Process() { ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer; sci->port = clientport; SendPacket(&p); - zlog(WORLD__ZONE,"Auto zone port configuration. Telling zone to use port %d",clientport); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); } else { clientport=sci->port; - zlog(WORLD__ZONE,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); } } @@ -602,7 +602,7 @@ bool ZoneServer::Process() { const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer; launcher_name = ln->launcher_name; launched_name = ln->zone_name; - zlog(WORLD__ZONE, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); break; } case ServerOP_ShutdownAll: { @@ -685,12 +685,12 @@ bool ZoneServer::Process() { if(WorldConfig::get()->UpdateStats) client = client_list.FindCharacter(ztz->name); - zlog(WORLD__ZONE,"ZoneToZone request for %s current zone %d req zone %d\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", ztz->name, ztz->current_zone_id, ztz->requested_zone_id); /* This is a request from the egress zone */ if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) { - zlog(WORLD__ZONE,"Processing ZTZ for egress from zone for client %s\n", ztz->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) { ztz->response = 0; @@ -736,7 +736,7 @@ bool ZoneServer::Process() { /* Response from Ingress server, route back to egress */ else{ - zlog(WORLD__ZONE,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); ZoneServer *egress_server = nullptr; if(ztz->current_instance_id > 0) { egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id); @@ -754,7 +754,7 @@ bool ZoneServer::Process() { } case ServerOP_ClientList: { if (pack->size != sizeof(ServerClientList_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); break; } client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer); @@ -763,7 +763,7 @@ bool ZoneServer::Process() { case ServerOP_ClientListKA: { ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer; if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); break; } client_list.CLEKeepAlive(sclka->numupdates, sclka->wid); @@ -869,7 +869,7 @@ bool ZoneServer::Process() { } case ServerOP_GMGoto: { if (pack->size != sizeof(ServerGMGoto_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); break; } ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer; @@ -889,7 +889,7 @@ bool ZoneServer::Process() { } case ServerOP_Lock: { if (pack->size != sizeof(ServerLock_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); break; } ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer; @@ -914,7 +914,7 @@ bool ZoneServer::Process() { } case ServerOP_Motd: { if (pack->size != sizeof(ServerMotd_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); break; } ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer; @@ -925,7 +925,7 @@ bool ZoneServer::Process() { } case ServerOP_Uptime: { if (pack->size != sizeof(ServerUptime_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); break; } ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer; @@ -944,7 +944,7 @@ bool ZoneServer::Process() { break; } case ServerOP_GetWorldTime: { - zlog(WORLD__ZONE,"Broadcasting a world time update"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); auto pack = new ServerPacket; pack->opcode = ServerOP_SyncWorldTime; @@ -959,17 +959,17 @@ bool ZoneServer::Process() { break; } case ServerOP_SetWorldTime: { - zlog(WORLD__ZONE,"Received SetWorldTime"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); - zlog(WORLD__ZONE,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str()); zoneserver_list.SendTimeSync(); break; } case ServerOP_IPLookup: { if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); break; } ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer; @@ -981,7 +981,7 @@ bool ZoneServer::Process() { } case ServerOP_LockZone: { if (pack->size < sizeof(ServerLockZone_Struct)) { - zlog(WORLD__ZONE_ERR,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); break; } ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer; @@ -1026,10 +1026,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if (zs->SendPacket(pack)) { - zlog(WORLD__ZONE,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } else { - zlog(WORLD__ZONE_ERR,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } } break; @@ -1048,10 +1048,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(cle->instance()); if(zs) { if(zs->SendPacket(pack)) { - zlog(WORLD__ZONE, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); } } else @@ -1068,10 +1068,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - zlog(WORLD__ZONE_ERR, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } } @@ -1080,10 +1080,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(cle->zone()); if(zs) { if(zs->SendPacket(pack)) { - zlog(WORLD__ZONE, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); } } else { @@ -1099,10 +1099,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - zlog(WORLD__ZONE_ERR, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } } @@ -1120,10 +1120,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - zlog(WORLD__ZONE_ERR, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1139,10 +1139,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - zlog(WORLD__ZONE_ERR, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } else @@ -1150,10 +1150,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - zlog(WORLD__ZONE_ERR, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - zlog(WORLD__ZONE_ERR, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1255,7 +1255,7 @@ bool ZoneServer::Process() { case ServerOP_LSAccountUpdate: { - zlog(WORLD__ZONE, "Received ServerOP_LSAccountUpdate packet from zone"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); loginserverlist.SendAccountUpdate(pack); break; } @@ -1310,7 +1310,7 @@ bool ZoneServer::Process() { } default: { - zlog(WORLD__ZONE_ERR,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } From 7d14fad78210392fc6dbcb1afe0ee147c0fd48ea Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 02:59:49 -0600 Subject: [PATCH 153/707] Remove zlog completely --- common/logsys.h | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/common/logsys.h b/common/logsys.h index 15584276f..d65ecb928 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -71,22 +71,6 @@ extern void log_hex(LogType type, const void *data, unsigned long length, unsign extern void log_packet(LogType type, const BasePacket *p); extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); -#ifdef DISABLE_LOGSYS - //completely disabled, this is the best I can come up with since we have no variadic macros - inline void zlog(LogType, const char *, ...) {} -#else //!DISABLE_LOGSYS - #ifdef WORLD - class ZoneServer; - extern void log_message_zone(LogType type, ZoneServer *who, const char *fmt, ...); - #define zlog( type, format, ...) \ - do { \ - if(log_type_info[ type ].enabled) { \ - log_message_zone(type, this, format, ##__VA_ARGS__); \ - } \ - } while(false) - #endif -#endif //!DISABLE_LOGSYS - #ifndef DISABLE_LOGSYS /* these are macros which do not use ..., and work for anybody */ #define _hex( type, data, len) \ From d45ed9befaddec87318a128abf539ed02eccce04 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sat, 17 Jan 2015 23:59:06 -0600 Subject: [PATCH 154/707] Consolidate EQEmuLogsys::Debug calls into DebugCategory --- common/eq_stream_factory.cpp | 8 +-- common/eqemu_logsys.h | 1 + common/tcp_server.cpp | 4 +- world/zoneserver.cpp | 1 - zone/client_packet.cpp | 4 +- zone/exp.cpp | 4 +- zone/fearpath.cpp | 4 +- zone/inventory.cpp | 4 +- zone/net.cpp | 2 +- zone/pathing.cpp | 132 +++++++++++++++++------------------ zone/perl_client.cpp | 16 ++--- zone/trading.cpp | 14 ++-- zone/worldserver.cpp | 2 +- zone/zonedb.cpp | 26 +++---- zone/zoning.cpp | 10 +-- 15 files changed, 116 insertions(+), 116 deletions(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 7d2a7e365..3bd6ad185 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif fs->ReaderLoop(); #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); @@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif fs->WriterLoop(); #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 3cce91ebe..e15c99087 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -50,6 +50,7 @@ public: /* If you add to this, make sure you update LogCategoryName */ enum LogCategory { + None = 0, Zone_Server = 1, World_Server, UCS_Server, diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index 9e0553d40..f1154b120 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Starting TCPServerLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); #endif tcps->MLoopRunning.lock(); @@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Ending TCPServerLoop with thread ID %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index a55009514..3cf75a90d 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -785,7 +785,6 @@ bool ZoneServer::Process() { } case ServerOP_RequestOnlineGuildMembers: { ServerRequestOnlineGuildMembers_Struct *srogms = (ServerRequestOnlineGuildMembers_Struct*) pack->pBuffer; - zlog(GUILDS__IN_PACKETS, "ServerOP_RequestOnlineGuildMembers Recieved. FromID=%i GuildID=%i", srogms->FromID, srogms->GuildID); client_list.SendOnlineGuildMembers(srogms->FromID, srogms->GuildID); break; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index b45f69e7b..382436e65 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. if (!CanBeInZone()) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Kicking char from zone, not allowed here"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); GoToSafeCoords(database.GetZoneID("arena"), 0); return; } @@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - logger.LogDebug(EQEmuLogSys::Detail, "%s sent a logout packet.", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); SendLogoutPackets(); diff --git a/zone/exp.cpp b/zone/exp.cpp index c1ceeeae2..47d864706 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - logger.LogDebug(EQEmuLogSys::Detail, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - logger.LogDebug(EQEmuLogSys::Detail, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index e2e3be399..3a3fdcd58 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; curfp = true; - logger.LogDebug(EQEmuLogSys::Detail, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } - logger.LogDebug(EQEmuLogSys::Detail, "No path found to selected node. Falling through to old fear point selection."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 3062db265..22816a75f 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2866,7 +2866,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool if (log) { logger.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory() -- End"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); @@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) { if (depth >= 10) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); return; } diff --git a/zone/net.cpp b/zone/net.cpp index 5cfe506cd..b630dadb2 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #ifndef WIN32 - logger.LogDebug(EQEmuLogSys::Detail, "Main thread running with thread id %d", pthread_self()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); #endif Timer quest_timers(100); diff --git a/zone/pathing.cpp b/zone/pathing.cpp index dc0d4cb40..07b145d34 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque PathManager::FindRoute(int startID, int endID) { - logger.LogDebug(EQEmuLogSys::Detail, "FindRoute from node %i to %i", startID, endID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -330,7 +330,7 @@ std::deque PathManager::FindRoute(int startID, int endID) } } - logger.LogDebug(EQEmuLogSys::Detail, "Unable to find a route."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); return Route; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { - logger.LogDebug(EQEmuLogSys::Detail, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::deque noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToStart <0 ) { - logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any starting Path Node within range."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return noderoute; } - logger.LogDebug(EQEmuLogSys::Detail, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); // Find the nearest PathNode the end point has LOS to @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); - logger.LogDebug(EQEmuLogSys::Detail, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToEnd < 0) { - logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any end Path Node within range."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); return noderoute; } - logger.LogDebug(EQEmuLogSys::Detail, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); if(ClosestPathNodeToStart == ClosestPathNodeToEnd) { @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) return To; - logger.LogDebug(EQEmuLogSys::Detail, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); if(From == PathingLastPosition) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((PathingLoopCount > 5) && !IsRooted()) { - logger.LogDebug(EQEmuLogSys::Detail, "appears to be stuck. Teleporting them to next position.", GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); if(Route.size() == 0) { @@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // If we are already pathing, and the destination is the same as before ... if(SameDestination) { - logger.LogDebug(EQEmuLogSys::Detail, " Still pathing to the same destination."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); // Get the coordinates of the first path node we are going to. NextNode = Route.front(); @@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // We have reached the path node. if(NodeLoc == From) { - logger.LogDebug(EQEmuLogSys::Detail, " Arrived at node %i", NextNode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); NodeReached = true; @@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // target, and we may run past the target if we don't check LOS at this point. int RouteSize = Route.size(); - logger.LogDebug(EQEmuLogSys::Detail, "Route size is %i", RouteSize); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); if((RouteSize == 2) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check())) { - logger.LogDebug(EQEmuLogSys::Detail, " Checking distance to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - logger.LogDebug(EQEmuLogSys::Detail, " Distance between From and To (NoRoot) is %8.3f", Distance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - logger.LogDebug(EQEmuLogSys::Detail, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); - logger.LogDebug(EQEmuLogSys::Detail, " Now moving to node %i", NextNode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode); } @@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // we have run all the nodes, all that is left is the direct path from the last node // to the destination - logger.LogDebug(EQEmuLogSys::Detail, " Reached end of node path, running direct to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); return To; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check()) { - logger.LogDebug(EQEmuLogSys::Detail, " Checking distance to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - logger.LogDebug(EQEmuLogSys::Detail, " Distance between From and To (NoRoot) is %8.3f", Distance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // We get here if we were already pathing, but our destination has now changed. // - logger.LogDebug(EQEmuLogSys::Detail, " Target has changed position."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); // Update our record of where we are going to. PathingDestination = To; // Check if we now have LOS etc to the new destination. @@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - logger.LogDebug(EQEmuLogSys::Detail, " Checking for short LOS at distance %8.3f.", Distance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.LogDebug(EQEmuLogSys::Detail, " No hazards. Running directly to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - logger.LogDebug(EQEmuLogSys::Detail, " Continuing on node path."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } } @@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { if(!PathingRouteUpdateTimerShort->Check()) { - logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer not yet expired."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - logger.LogDebug(EQEmuLogSys::Detail, "Short route update timer expired."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); } else { if(!PathingRouteUpdateTimerLong->Check()) { - logger.LogDebug(EQEmuLogSys::Detail, "Long route update timer not yet expired."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - logger.LogDebug(EQEmuLogSys::Detail, "Long route update timer expired."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); } // We are already pathing, destination changed, no LOS. Find the nearest node to our destination. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. if(DestinationPathNode == -1) { - logger.LogDebug(EQEmuLogSys::Detail, " Unable to find path node for new destination. Running straight to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); Route.clear(); return To; } @@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // one, we will carry on on our path. if(DestinationPathNode == Route.back()) { - logger.LogDebug(EQEmuLogSys::Detail, " Same destination Node (%i). Continue with current path.", DestinationPathNode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); @@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Check if we have reached a path node. if(NodeLoc == From) { - logger.LogDebug(EQEmuLogSys::Detail, " Arrived at node %i, moving to next one.\n", Route.front()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); NodeReached = true; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.LogDebug(EQEmuLogSys::Detail, "Missing node after teleport."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - logger.LogDebug(EQEmuLogSys::Detail, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // Return the coords of our next path node on the route. - logger.LogDebug(EQEmuLogSys::Detail, " Now moving to node %i", NextNode); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - logger.LogDebug(EQEmuLogSys::Detail, " Reached end of path grid. Running direct to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); return To; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - logger.LogDebug(EQEmuLogSys::Detail, " Target moved. End node is different. Clearing route."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); Route.clear(); // We will now fall through to get a new route. @@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } - logger.LogDebug(EQEmuLogSys::Detail, " Our route list is empty."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); if((SameDestination) && !PathingLOSCheckTimer->Check()) { - logger.LogDebug(EQEmuLogSys::Detail, " Destination same as before, LOS check timer not reached. Returning To."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); return To; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - logger.LogDebug(EQEmuLogSys::Detail, " Checking for long LOS at distance %8.3f.", Distance); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.LogDebug(EQEmuLogSys::Detail, "NoLOS"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.LogDebug(EQEmuLogSys::Detail, "Target is reachable. Running directly there."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); return To; } } - logger.LogDebug(EQEmuLogSys::Detail, " Calculating new route to target."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); Route = zone->pathing->FindRoute(From, To); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.LogDebug(EQEmuLogSys::Detail, " No route available, running direct."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); return To; } if(SameDestination && (Route.front() == PathingLastNodeVisited)) { - logger.LogDebug(EQEmuLogSys::Detail, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Route.clear(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - logger.LogDebug(EQEmuLogSys::Detail, " New route determined, heading for node %i", Route.front()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); PathingLoopCount = 0; @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - logger.LogDebug(EQEmuLogSys::Detail, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } if(ClosestPathNodeToStart <0 ) { - logger.LogDebug(EQEmuLogSys::Detail, "No LOS to any starting Path Node within range."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return -1; } return ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { - logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); return false; } else { - logger.LogDebug(EQEmuLogSys::Detail, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); if (ABS(NewZ - last_z) > 5.0f) { - logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } if (best_z2 == -999990) { - logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED, really deep water/lava!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); return false; } else { if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { - logger.LogDebug(EQEmuLogSys::Detail, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); return false; } else { - logger.LogDebug(EQEmuLogSys::Detail, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); } } } else { - logger.LogDebug(EQEmuLogSys::Detail, "Hazard point not in water or lava!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); } } else { - logger.LogDebug(EQEmuLogSys::Detail, "No water map loaded for hazards!"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) if(d && !d->IsDoorOpen() ) { - logger.LogDebug(EQEmuLogSys::Detail, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); d->ForceOpen(ForWho); } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 82600923d..59a865887 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { if (THIS->IsMerc()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); #endif else - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { if (THIS->IsMerc()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); #endif else - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); diff --git a/zone/trading.cpp b/zone/trading.cpp index 4c06dfc42..761c954f8 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; if (partial_inst->GetID() != inst->GetID()) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; if (partial_inst->GetID() != inst->GetID()) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1836,7 +1836,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); if(!gis) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Error retrieving Trader items details to update price."); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); return; } @@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { // This method is called when a potential seller in the /barter window searches for matching buyers // - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Client::SendBuyerResults %s\n", searchString); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); char* escSearchString = new char[strlen(searchString) * 2 + 1]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 3bce1101a..7bbd5db5d 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -386,7 +386,7 @@ void WorldServer::Process() { } } else { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); } } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 507e1ef27..5a8c19e16 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -619,7 +619,7 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -630,7 +630,7 @@ void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int3 Charges, CharID, SerialNumber); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", SerialNumber, CharID, results.ErrorMessage().c_str()); } @@ -650,7 +650,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 char_id){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); return; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { @@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteBuyLines(uint32 CharID) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); return; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); } @@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons CharID, BuySlot, ItemID, ItemName, Quantity, Price); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity) std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 741a2fbd2..d2d814414 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z safe_delete(outapp); } - logger.LogDebug(EQEmuLogSys::Detail, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); //Clear zonesummon variables if we're zoning to our own zone //Client wont generate a zone change packet to the server in this case so //They aren't needed and it keeps behavior on next zone attempt from being undefined. @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //this should not happen... - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); return(false); } if(GetLevel() < minlevel) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); return(false); } if(Admin() < minstatus) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); return(false); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { - logger.LogDebug(EQEmuLogSys::Detail, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); return(false); } } From 58d0b86a67d4f123e291376f00e0b6a290755f3a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 00:00:03 -0600 Subject: [PATCH 155/707] Consolidate EQEmuLogsys::Debug General calls into DebugCategory --- zone/aggro.cpp | 8 +- zone/bot.cpp | 2 +- zone/client.cpp | 32 ++++---- zone/client_mods.cpp | 8 +- zone/client_packet.cpp | 160 ++++++++++++++++++++-------------------- zone/client_process.cpp | 2 +- zone/command.cpp | 2 +- zone/corpse.cpp | 6 +- zone/doors.cpp | 2 +- zone/groups.cpp | 8 +- zone/inventory.cpp | 2 +- zone/loottables.cpp | 4 +- zone/merc.cpp | 4 +- zone/petitions.cpp | 2 +- zone/spawngroup.cpp | 2 +- zone/spell_effects.cpp | 6 +- zone/spells.cpp | 2 +- zone/trading.cpp | 10 +-- zone/zone.cpp | 16 ++-- zone/zonedb.cpp | 22 +++--- zone/zoning.cpp | 10 +-- 21 files changed, 155 insertions(+), 155 deletions(-) diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 98ca3ee84..83a47a76e 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -466,7 +466,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { //Father Nitwit: make sure we can see them. if(mob->CheckLosFN(sender)) { #if (EQDEBUG>=5) - logger.LogDebug(EQEmuLogSys::General, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); #endif mob->AddToHateList(attacker, 1, 0, false); @@ -693,7 +693,7 @@ type', in which case, the answer is yes. } while( reverse++ == 0 ); - logger.LogDebug(EQEmuLogSys::General, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); return false; } @@ -833,7 +833,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) } while( reverse++ == 0 ); - logger.LogDebug(EQEmuLogSys::General, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); return false; } @@ -945,7 +945,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; #if LOSDEBUG>=5 - logger.LogDebug(EQEmuLogSys::General, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); #endif return zone->zonemap->CheckLoS(myloc, oloc); } diff --git a/zone/bot.cpp b/zone/bot.cpp index fb3f86c90..4cf6325b2 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -8548,7 +8548,7 @@ int32 Bot::CalcMaxMana() { } default: { - logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } diff --git a/zone/client.cpp b/zone/client.cpp index 8ea010890..cef327e77 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -340,7 +340,7 @@ Client::~Client() { ToggleBuyerMode(false); if(conn_state != ClientConnectFinished) { - logger.LogDebug(EQEmuLogSys::General, "Client '%s' was destroyed before reaching the connected state:", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); ReportConnectingState(); } @@ -438,31 +438,31 @@ void Client::SendLogoutPackets() { void Client::ReportConnectingState() { switch(conn_state) { case NoPacketsReceived: //havent gotten anything - logger.LogDebug(EQEmuLogSys::General, "Client has not sent us an initial zone entry packet."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); break; case ReceivedZoneEntry: //got the first packet, loading up PP - logger.LogDebug(EQEmuLogSys::General, "Client sent initial zone packet, but we never got their player info from the database."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); break; case PlayerProfileLoaded: //our DB work is done, sending it - logger.LogDebug(EQEmuLogSys::General, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); break; case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather - logger.LogDebug(EQEmuLogSys::General, "We successfully sent player info and spawns, waiting for client to request new zone."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); break; case NewZoneRequested: //received and sent new zone request - logger.LogDebug(EQEmuLogSys::General, "We received client's new zone request, waiting for client spawn request."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); break; case ClientSpawnRequested: //client sent ReqClientSpawn - logger.LogDebug(EQEmuLogSys::General, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); break; case ZoneContentsSent: //objects, doors, zone points - logger.LogDebug(EQEmuLogSys::General, "The rest of the zone contents were successfully sent, waiting for client ready notification."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); break; case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc - logger.LogDebug(EQEmuLogSys::General, "We received client ready notification, but never finished Client::CompleteConnect"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); break; case ClientConnectFinished: //client finally moved to finished state, were done here - logger.LogDebug(EQEmuLogSys::General, "Client is successfully connected."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); break; }; } @@ -2105,7 +2105,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ SaveCurrency(); - logger.LogDebug(EQEmuLogSys::General, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); } void Client::EVENT_ITEM_ScriptStopReturn(){ @@ -2145,7 +2145,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat SaveCurrency(); #if (EQDEBUG>=5) - logger.LogDebug(EQEmuLogSys::General, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); #endif } @@ -4544,14 +4544,14 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetClass() != LDON_TREASURE) { - logger.LogDebug(EQEmuLogSys::General, "%s tried to open %s but %s was not a treasure chest.", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", GetName(), target->GetName(), target->GetName()); return; } if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) { - logger.LogDebug(EQEmuLogSys::General, "%s tried to open %s but %s was out of range", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); Message(13, "Treasure chest out of range."); return; @@ -8149,7 +8149,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - logger.LogDebug(EQEmuLogSys::General, "Eating from slot:%i", (int)slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); #endif } else @@ -8166,7 +8166,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - logger.LogDebug(EQEmuLogSys::General, "Drinking from slot:%i", (int)slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); #endif } } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 51b73e6a5..feaa0d18a 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -935,7 +935,7 @@ int32 Client::CalcMaxMana() break; } default: { - logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -956,7 +956,7 @@ int32 Client::CalcMaxMana() } #if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1046,14 +1046,14 @@ int32 Client::CalcBaseMana() break; } default: { - logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_m = 0; break; } } #if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); #endif return max_m; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 382436e65..abeafc750 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -483,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_LINKDEAD: break; default: - logger.LogDebug(EQEmuLogSys::General, "Unknown client_state: %d\n", client_state); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); break; } @@ -1317,7 +1317,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) ClientVersionBit = 0; bool siv = m_inv.SetInventoryVersion(ClientVersion); - logger.LogDebug(EQEmuLogSys::General, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); /* Antighost code tmp var is so the search doesnt find this object @@ -1940,7 +1940,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) { if (app->size != sizeof(AcceptNewTask_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AcceptNewTask expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", sizeof(AcceptNewTask_Struct), app->size); DumpPacket(app); return; @@ -2280,7 +2280,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Sell_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", app->size, sizeof(Adventure_Sell_Struct)); DumpPacket(app); return; @@ -2994,7 +2994,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); - logger.LogDebug(EQEmuLogSys::General, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); } } @@ -3009,7 +3009,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); return; } @@ -3039,7 +3039,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); return; } QueuePacket(app); @@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) if (app->size != sizeof(AugmentInfo_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AugmentInfo expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); DumpPacket(app); return; @@ -3295,7 +3295,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) { if (app->size != sizeof(bool)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); DumpPacket(app); return; } @@ -3311,7 +3311,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) // Although there are three different structs for OP_Bandolier, they are all the same size. // if (app->size != sizeof(BandolierCreate_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Bandolier expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", sizeof(BandolierCreate_Struct), app->size); DumpPacket(app); return; @@ -3330,7 +3330,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) SetBandolier(app); break; default: - logger.LogDebug(EQEmuLogSys::General, "Uknown Bandolier action %i", bs->action); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); } } @@ -3339,7 +3339,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) { if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); DumpPacket(app); return; } @@ -3424,7 +3424,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) if (app->size < 4) { - logger.LogDebug(EQEmuLogSys::General, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); DumpPacket(app); return; } @@ -3730,7 +3730,7 @@ void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) logger.Log(EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { - logger.LogDebug(EQEmuLogSys::General, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } return; @@ -3743,7 +3743,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_BlockedBuffs expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -3941,7 +3941,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTask_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_CancelTask expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", sizeof(CancelTask_Struct), app->size); DumpPacket(app); return; @@ -4006,16 +4006,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) targetring_z = castspell->z_pos; #ifdef _EQDEBUG - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); - logger.LogDebug(EQEmuLogSys::General, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); #endif - logger.LogDebug(EQEmuLogSys::General, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; @@ -4047,7 +4047,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) //discipline, using the item spell slot if (castspell->inventoryslot == INVALID_INDEX) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { - logger.LogDebug(EQEmuLogSys::General, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); InterruptSpell(castspell->spell_id); } return; @@ -4190,7 +4190,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app) if (app->size != 1) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); DumpPacket(app); @@ -4212,7 +4212,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app) if (app->size != 0) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", app->size); DumpPacket(app); @@ -4718,7 +4718,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4812,7 +4812,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -5136,7 +5136,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app) if (app->size != sizeof(DelegateAbility_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_DelegateAbility expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", sizeof(DelegateAbility_Struct), app->size); DumpPacket(app); @@ -5311,7 +5311,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", sizeof(DoGroupLeadershipAbility_Struct), app->size); DumpPacket(app); @@ -5363,7 +5363,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) } default: - logger.LogDebug(EQEmuLogSys::General, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", dglas->Ability, dglas->Parameter); break; } @@ -5927,7 +5927,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainEnd_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); DumpPacket(app); return; } @@ -6177,7 +6177,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) if (app->size < sizeof(GMSearchCorpse_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", app->size, sizeof(GMSearchCorpse_Struct)); DumpPacket(app); return; @@ -6300,7 +6300,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainee_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); DumpPacket(app); return; } @@ -6311,7 +6311,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) { if (app->size != sizeof(GMSkillChange_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); DumpPacket(app); return; } @@ -6445,7 +6445,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) return; } - logger.LogDebug(EQEmuLogSys::General, "Member Disband Request from %s\n", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; @@ -6725,7 +6725,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) if (g->IsLeader(this)) g->ChangeLeader(NewLeader); else { - logger.LogDebug(EQEmuLogSys::General, "Group /makeleader request originated from non-leader member: %s", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6816,7 +6816,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(GroupUpdate_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch on OP_GroupUpdate: got %u expected %u", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", app->size, sizeof(GroupUpdate_Struct)); DumpPacket(app); return; @@ -6835,7 +6835,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) if (group->IsLeader(this)) group->ChangeLeader(newleader); else { - logger.LogDebug(EQEmuLogSys::General, "Group /makeleader request originated from non-leader member: %s", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6844,7 +6844,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) default: { - logger.LogDebug(EQEmuLogSys::General, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); DumpPacket(app); return; } @@ -7782,7 +7782,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) { if (app->size != sizeof(GuildStatus_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GuildStatus expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", sizeof(GuildStatus_Struct), app->size); DumpPacket(app); @@ -7839,7 +7839,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) { if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", sizeof(GuildUpdateURLAndChannel_Struct), app->size); DumpPacket(app); @@ -7943,7 +7943,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app) // if (app->size != sizeof(HideCorpse_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_HideCorpse expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", sizeof(HideCorpse_Struct), app->size); DumpPacket(app); @@ -8449,7 +8449,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (slot_id < 0) { - logger.LogDebug(EQEmuLogSys::General, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); return; } @@ -8492,7 +8492,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) return; } - logger.LogDebug(EQEmuLogSys::General, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check { @@ -8530,7 +8530,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) { - logger.LogDebug(EQEmuLogSys::General, "Item with no effect right clicked by %s", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); } else if (inst->IsType(ItemClassCommon)) { @@ -8603,7 +8603,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) { - logger.LogDebug(EQEmuLogSys::General, "Error: unknown item->Click.Type (%i)", item->Click.Type); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } else { @@ -8619,7 +8619,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) else if (item->ItemType == ItemTypeAlcohol) { #if EQDEBUG >= 1 - logger.LogDebug(EQEmuLogSys::General, "Drinking Alcohol from slot:%i", slot_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - logger.LogDebug(EQEmuLogSys::General, "Error: unknown item->Click.Type (%i)", item->Click.Type); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } } } @@ -8787,7 +8787,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) { if (app->size != 1) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -9327,7 +9327,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) if (app->size != sizeof(MercenaryCommand_Struct)) { Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; } @@ -9384,7 +9384,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); DumpPacket(app); @@ -9519,7 +9519,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app if (app->size != 0) { Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9539,7 +9539,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9564,7 +9564,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID) if (app->size != sizeof(MercenaryMerchantRequest_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); DumpPacket(app); @@ -9636,7 +9636,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) if (app->size != sizeof(SuspendMercenary_Struct)) { Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; } @@ -9660,7 +9660,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -10516,7 +10516,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) { if (app->size != sizeof(PopupResponse_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PopupResponse expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", sizeof(PopupResponse_Struct), app->size); DumpPacket(app); return; @@ -10551,7 +10551,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) { if (app->size != sizeof(MovePotionToBelt_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PotionBelt expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", sizeof(MovePotionToBelt_Struct), app->size); DumpPacket(app); return; @@ -10559,7 +10559,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { - logger.LogDebug(EQEmuLogSys::General, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); return; } @@ -10582,7 +10582,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -10672,7 +10672,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a // if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); DumpPacket(app); @@ -10699,7 +10699,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) // if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", sizeof(PVPLeaderBoardRequest_Struct), app->size); DumpPacket(app); @@ -11385,7 +11385,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; - logger.LogDebug(EQEmuLogSys::General, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); // results show that object_type is combiner type // some_id = 0 if world combiner, item number otherwise @@ -11446,7 +11446,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) rss->query[55] = '\0'; //just to be sure. - logger.LogDebug(EQEmuLogSys::General, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); // make where clause segment for container(s) char containers[30]; @@ -11506,7 +11506,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -11669,7 +11669,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) // if (app->size != 4) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_RespawnWindow expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", 4, app->size); DumpPacket(app); return; @@ -11720,7 +11720,7 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) { if (app->size != sizeof(Sacrifice_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); DumpPacket(app); return; } @@ -11969,7 +11969,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) { if (app->size != sizeof(SetTitle_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); DumpPacket(app); return; } @@ -12098,7 +12098,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) t1.start(); Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; #if EQDEBUG >= 5 - logger.LogDebug(EQEmuLogSys::General, "%s, purchase item..", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); DumpPacket(app); #endif @@ -12834,7 +12834,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) { if (app->size != sizeof(Surname_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); return; } @@ -13149,7 +13149,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TaskHistoryRequest_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", sizeof(TaskHistoryRequest_Struct), app->size); DumpPacket(app); return; @@ -13691,7 +13691,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if (app->size != sizeof(Translocate_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); DumpPacket(app); return; } @@ -13836,7 +13836,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - logger.LogDebug(EQEmuLogSys::General, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } @@ -13876,7 +13876,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app) if (app->size != sizeof(VoiceMacroIn_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_VoiceMacroIn expected %i got %i", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", sizeof(VoiceMacroIn_Struct), app->size); DumpPacket(app); @@ -13927,7 +13927,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app) { if (app->size != 1) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); DumpPacket(app); return; } @@ -13939,7 +13939,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) { if (app->size < 12) { - logger.LogDebug(EQEmuLogSys::General, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); DumpPacket(app); return; } @@ -14162,7 +14162,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) } default: - logger.LogDebug(EQEmuLogSys::General, "Unhandled XTarget Type %i", Type); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 2d64eed51..e66fbaaeb 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1037,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { // Account for merchant lists with gaps. if (ml.slot >= i) { if (ml.slot > i) - logger.LogDebug(EQEmuLogSys::General, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); i = ml.slot + 1; } } diff --git a/zone/command.cpp b/zone/command.cpp index df31b604b..66fc57106 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10394,7 +10394,7 @@ void command_logtest(Client *c, const Seperator *sep){ if (sep->IsNumber(1)){ uint32 i = 0; for (i = 0; i < atoi(sep->arg[1]); i++){ - logger.LogDebug(EQEmuLogSys::General, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } } \ No newline at end of file diff --git a/zone/corpse.cpp b/zone/corpse.cpp index ec4503476..8c2eebb68 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -842,7 +842,7 @@ bool Corpse::Process() { spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); - logger.LogDebug(EQEmuLogSys::General, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); corpse_db_id = 0; } @@ -872,7 +872,7 @@ bool Corpse::Process() { Save(); player_corpse_depop = true; corpse_db_id = 0; - logger.LogDebug(EQEmuLogSys::General, "Tagged %s player corpse has burried.", this->GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); } else { logger.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); @@ -1083,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); - logger.LogDebug(EQEmuLogSys::General, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); client->Message(0, "Inaccessable Corpse Item: %s", item->Name); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index d602fafe1..1f3008175 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -303,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); #if EQDEBUG>=5 - logger.LogDebug(EQEmuLogSys::General, "Client has lockpicks: skill=%f", modskill); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); #endif if(GetLockpick() <= modskill) diff --git a/zone/groups.cpp b/zone/groups.cpp index 3eccb7fa6..df687c6db 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1098,7 +1098,7 @@ void Group::VerifyGroup() { for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (membername[i][0] == '\0') { #if EQDEBUG >= 7 - logger.LogDebug(EQEmuLogSys::General, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif members[i] = nullptr; continue; @@ -1107,7 +1107,7 @@ void Group::VerifyGroup() { Mob *them = entity_list.GetMob(membername[i]); if(them == nullptr && members[i] != nullptr) { //they aren't in zone #if EQDEBUG >= 6 - logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; members[i] = nullptr; @@ -1116,13 +1116,13 @@ void Group::VerifyGroup() { if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 - logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif members[i] = them; continue; } #if EQDEBUG >= 8 - logger.LogDebug(EQEmuLogSys::General, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); #endif } } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 22816a75f..53eb3ae31 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -700,7 +700,7 @@ void Client::SendCursorBuffer() { // Remove item from inventory void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { #if (EQDEBUG >= 5) - logger.LogDebug(EQEmuLogSys::General, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); #endif // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 74f347f69..fed8b2210 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml drop_chance = zone->random.Real(0.0, 100.0); #if EQDEBUG>=11 - logger.LogDebug(EQEmuLogSys::General, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); #endif if (thischance == 100.0 || drop_chance < thischance) { @@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge ServerLootItem_Struct* item = new ServerLootItem_Struct; #if EQDEBUG>=11 - logger.LogDebug(EQEmuLogSys::General, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif EQApplicationPacket* outapp = nullptr; diff --git a/zone/merc.cpp b/zone/merc.cpp index ec5a74308..c25248e2f 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -885,7 +885,7 @@ int32 Merc::CalcMaxMana() break; } default: { - logger.LogDebug(EQEmuLogSys::General, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -906,7 +906,7 @@ int32 Merc::CalcMaxMana() } #if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 1ef3c85b0..deab5789d 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -259,7 +259,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) } #if EQDEBUG >= 5 - logger.LogDebug(EQEmuLogSys::General, "New petition created"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); #endif } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index bc1e21451..abd93c84c 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa uint32 SpawnGroup::GetNPCType() { #if EQDEBUG >= 10 - logger.LogDebug(EQEmuLogSys::General, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); #endif int npcType = 0; int totalchance = 0; diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index f666c62ce..1e0f29e47 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -476,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(!target_zone) { #ifdef SPELL_EFFECT_SPAM - logger.LogDebug(EQEmuLogSys::General, "Succor/Evacuation Spell In Same Zone."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); #endif if(IsClient()) CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); @@ -485,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { #ifdef SPELL_EFFECT_SPAM - logger.LogDebug(EQEmuLogSys::General, "Succor/Evacuation Spell To Another Zone."); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); #endif if(IsClient()) CastToClient()->MovePC(target_zone, x, y, z, heading); @@ -3326,7 +3326,7 @@ snare has both of them negative, yet their range should work the same: result = ubase * (caster_level * (formula - 2000) + 1); } else - logger.LogDebug(EQEmuLogSys::General, "Unknown spell effect value forumula %d", formula); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index 1b4de2406..e3c826b97 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2673,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) return duration ? duration : 3600; default: - logger.LogDebug(EQEmuLogSys::General, "CalcBuffDuration_formula: unknown formula %d", formula); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); return 0; } } diff --git a/zone/trading.cpp b/zone/trading.cpp index 761c954f8..ff0fc6f5e 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -86,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (!owner || !owner->IsClient()) { // This should never happen - logger.LogDebug(EQEmuLogSys::General, "Programming error: NPC's should not call Trade::AddEntity()"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); return; } @@ -296,7 +296,7 @@ void Trade::LogTrade() void Trade::DumpTrade() { Mob* with = With(); - logger.LogDebug(EQEmuLogSys::General, "Dumping trade data: '%s' in TradeState %i with '%s'", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) @@ -307,7 +307,7 @@ void Trade::DumpTrade() const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { - logger.LogDebug(EQEmuLogSys::General, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", inst->GetItem()->ID, inst->GetCharges(), i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); @@ -315,7 +315,7 @@ void Trade::DumpTrade() for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { - logger.LogDebug(EQEmuLogSys::General, "\tBagItem %i (Charges=%i, Slot=%i)", + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", inst->GetItem()->ID, inst->GetCharges(), Inventory::CalcSlotId(i, j)); } @@ -324,7 +324,7 @@ void Trade::DumpTrade() } } - logger.LogDebug(EQEmuLogSys::General, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); } #endif diff --git a/zone/zone.cpp b/zone/zone.cpp index 6098a61c5..b79335ad0 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() { std::map >::iterator cur; uint32 npcid = 0; if (results.RowCount() == 0) { - logger.LogDebug(EQEmuLogSys::General, "No Merchant Data found for %s.", GetShortName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); return; } for (auto row = results.begin(); row != results.end(); ++row) { @@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){ } if(MERC_DEBUG > 0) - logger.LogDebug(EQEmuLogSys::General, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); } @@ -801,10 +801,10 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); if(graveyard_id() > 0) { - logger.LogDebug(EQEmuLogSys::General, "Graveyard ID is %i.", graveyard_id()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); if(GraveYardLoaded) - logger.LogDebug(EQEmuLogSys::General, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else logger.Log(EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } @@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); Weather_Timer = new Timer(60000); Weather_Timer->Start(); - logger.LogDebug(EQEmuLogSys::General, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); zone_weather = 0; weather_intensity = 0; blocked_spells = nullptr; @@ -1403,11 +1403,11 @@ void Zone::ChangeWeather() weathertimer = weatherTimerRule*1000; Weather_Timer->Start(weathertimer); } - logger.LogDebug(EQEmuLogSys::General, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); } else { - logger.LogDebug(EQEmuLogSys::General, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); this->weatherSend(); } } @@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) { quest_manager.ClearAllTimers(); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) - logger.LogDebug(EQEmuLogSys::General, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); initgrids_timer.Start(); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 5a8c19e16..6e15155cf 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); return true; } @@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u /* Save Home Bind Point */ std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - logger.LogDebug(EQEmuLogSys::General, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } @@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i uint8 blue = (color & 0x000000FF); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); return true; } bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); return true; } bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); auto results = QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); return true; } @@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); } } return true; @@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } @@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla m_epp->expended_aa ); auto results = database.QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); return true; } @@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru pp->currentEbonCrystals, pp->careerEbonCrystals); auto results = database.QueryDatabase(query); - logger.LogDebug(EQEmuLogSys::General, "Saving Currency for character ID: %i, done", character_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); return true; } @@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur " VALUES (%u, %u, %u)", character_id, aa_id, current_level); auto results = QueryDatabase(rquery); - logger.LogDebug(EQEmuLogSys::General, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index d2d814414..37ea17eb5 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -44,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { zoning = true; if (app->size != sizeof(ZoneChange_Struct)) { - logger.LogDebug(EQEmuLogSys::General, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); return; } #if EQDEBUG >= 5 - logger.LogDebug(EQEmuLogSys::General, "Zone request from %s", GetName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); DumpPacket(app); #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; @@ -193,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { switch(zone_mode) { case EvacToSafeCoords: case ZoneToSafeCoords: - logger.LogDebug(EQEmuLogSys::General, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); dest_x = safe_x; dest_y = safe_y; dest_z = safe_z; @@ -534,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z heading = m_pp.binds[0].heading; zonesummon_ignorerestrictions = 1; - logger.LogDebug(EQEmuLogSys::General, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); break; case SummonPC: zonesummon_x = x_pos = x; @@ -543,7 +543,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; case Rewind: - logger.LogDebug(EQEmuLogSys::General, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); zonesummon_x = x_pos = x; zonesummon_y = y_pos = y; zonesummon_z = z_pos = z; From 726b3a33f51477148dfe9ed57cafca80a8db4468 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 00:06:01 -0600 Subject: [PATCH 156/707] Consolidate EQEmuLogsys::Debug stragglers to DebugCategory for further refactoring --- common/eqemu_logsys.cpp | 22 +++++++++++----------- common/eqemu_logsys.h | 2 +- zone/doors.cpp | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 106df197a..8e3448e5b 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -190,17 +190,17 @@ void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, log_category, output_debug_message); } -void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) -{ - va_list args; - va_start(args, message); - std::string output_message = vStringFormat(message.c_str(), args); - va_end(args); - - EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_message); - EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_message); - EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, 0, output_message); -} +// void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) +// { +// va_list args; +// va_start(args, message); +// std::string output_message = vStringFormat(message.c_str(), args); +// va_end(args); +// +// EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_message); +// EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_message); +// EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, 0, output_message); +// } void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index e15c99087..7a6ba419e 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -85,7 +85,7 @@ public: void CloseFileLogs(); void LoadLogSettingsDefaults(); void Log(uint16 log_type, const std::string message, ...); - void LogDebug(DebugLevel debug_level, std::string message, ...); + //void LogDebug(DebugLevel debug_level, std::string message, ...); //void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); diff --git a/zone/doors.cpp b/zone/doors.cpp index 1f3008175..98784eb90 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -560,13 +560,13 @@ void Doors::ToggleState(Mob *sender) } void Doors::DumpDoor(){ - logger.LogDebug(EQEmuLogSys::General, + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); - logger.LogDebug(EQEmuLogSys::General, + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); - logger.LogDebug(EQEmuLogSys::General, + logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", dest_zone, dest_x, dest_y, dest_z, dest_heading); } From 0b687e47796176d717c66df56f328d1f4b1ec9b8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 00:25:23 -0600 Subject: [PATCH 157/707] Fix some unhandled opcode output messages --- zone/client_packet.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index abeafc750..d01d7ad75 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -458,9 +458,8 @@ int Client::HandlePacket(const EQApplicationPacket *app) args.push_back(const_cast(app)); parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); - char buffer[64]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s", buffer); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: 0x%04x", app->GetOpcode()); if (logger.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ app->build_header_dump(buffer); if (app->size < 1000) From 126eca2ad69957a6cec68b81df6ba821231e3452 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 00:32:11 -0600 Subject: [PATCH 158/707] Add opcode name lookup on unhandled client opcode log message --- zone/client_packet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index d01d7ad75..691681347 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -17,6 +17,7 @@ #include "../common/debug.h" #include "../common/eqemu_logsys.h" +#include "../common/opcodemgr.h" #include #include #include @@ -459,7 +460,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); char buffer[64]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: 0x%04x", app->GetOpcode()); + logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); if (logger.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ app->build_header_dump(buffer); if (app->size < 1000) From 7dbde36b031abf82fd64b550a9874b91761e4368 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 00:41:18 -0600 Subject: [PATCH 159/707] Rename reference logger to Log --- client_files/export/main.cpp | 34 +-- client_files/import/main.cpp | 32 +-- common/crash.cpp | 44 +-- common/database.cpp | 34 +-- common/debug.cpp | 2 +- common/eq_stream.cpp | 242 ++++++++--------- common/eq_stream_factory.cpp | 8 +- common/eq_stream_ident.cpp | 22 +- common/eqemu_logsys.h | 2 +- common/eqtime.cpp | 6 +- common/guild_base.cpp | 132 ++++----- common/item.cpp | 2 +- common/misc_functions.h | 2 +- common/patches/rof.cpp | 88 +++--- common/patches/rof2.cpp | 88 +++--- common/patches/sod.cpp | 58 ++-- common/patches/sof.cpp | 28 +- common/patches/ss_define.h | 8 +- common/patches/titanium.cpp | 22 +- common/patches/underfoot.cpp | 58 ++-- common/ptimer.cpp | 14 +- common/rulesys.cpp | 36 +-- common/shareddb.cpp | 106 ++++---- common/spdat.cpp | 2 +- common/struct_strategy.cpp | 4 +- common/tcp_connection.cpp | 4 +- common/tcp_server.cpp | 4 +- common/timeoutmgr.cpp | 6 +- common/worldconn.cpp | 4 +- eqlaunch/eqlaunch.cpp | 22 +- eqlaunch/worldserver.cpp | 18 +- eqlaunch/zone_launch.cpp | 46 ++-- queryserv/database.cpp | 60 ++--- queryserv/lfguild.cpp | 14 +- queryserv/queryserv.cpp | 20 +- queryserv/worldserver.cpp | 6 +- shared_memory/main.cpp | 38 +-- ucs/chatchannel.cpp | 32 +-- ucs/clientlist.cpp | 78 +++--- ucs/database.cpp | 90 +++---- ucs/ucs.cpp | 30 +-- ucs/worldserver.cpp | 8 +- world/adventure.cpp | 4 +- world/adventure_manager.cpp | 6 +- world/client.cpp | 168 ++++++------ world/cliententry.cpp | 2 +- world/clientlist.cpp | 14 +- world/console.cpp | 24 +- world/eql_config.cpp | 22 +- world/eqw.cpp | 6 +- world/eqw_http_handler.cpp | 18 +- world/eqw_parser.cpp | 6 +- world/launcher_link.cpp | 24 +- world/launcher_list.cpp | 10 +- world/login_server.cpp | 32 +-- world/login_server_list.cpp | 2 +- world/net.cpp | 120 ++++----- world/queryserv.cpp | 12 +- world/ucs.cpp | 12 +- world/wguild_mgr.cpp | 26 +- world/worlddb.cpp | 18 +- world/zonelist.cpp | 8 +- world/zoneserver.cpp | 88 +++--- zone/aa.cpp | 46 ++-- zone/aggro.cpp | 22 +- zone/attack.cpp | 174 ++++++------ zone/bonuses.cpp | 6 +- zone/bot.cpp | 116 ++++---- zone/botspellsai.cpp | 4 +- zone/client.cpp | 70 ++--- zone/client_mods.cpp | 12 +- zone/client_packet.cpp | 510 +++++++++++++++++------------------ zone/client_process.cpp | 24 +- zone/command.cpp | 64 ++--- zone/corpse.cpp | 8 +- zone/doors.cpp | 16 +- zone/effects.cpp | 2 +- zone/embparser.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embperl.cpp | 10 +- zone/embxs.cpp | 6 +- zone/entity.cpp | 14 +- zone/exp.cpp | 8 +- zone/fearpath.cpp | 4 +- zone/forage.cpp | 6 +- zone/groups.cpp | 36 +-- zone/guild.cpp | 20 +- zone/guild_mgr.cpp | 48 ++-- zone/horse.cpp | 6 +- zone/inventory.cpp | 154 +++++------ zone/loottables.cpp | 4 +- zone/merc.cpp | 16 +- zone/mob.cpp | 6 +- zone/mob_ai.cpp | 20 +- zone/net.cpp | 116 ++++---- zone/npc.cpp | 20 +- zone/object.cpp | 8 +- zone/pathing.cpp | 146 +++++----- zone/perl_client.cpp | 16 +- zone/petitions.cpp | 10 +- zone/pets.cpp | 16 +- zone/questmgr.cpp | 30 +-- zone/raids.cpp | 22 +- zone/spawn2.cpp | 152 +++++------ zone/spawngroup.cpp | 8 +- zone/special_attacks.cpp | 58 ++-- zone/spell_effects.cpp | 32 +-- zone/spells.cpp | 352 ++++++++++++------------ zone/tasks.cpp | 252 ++++++++--------- zone/titles.cpp | 12 +- zone/tradeskills.cpp | 82 +++--- zone/trading.cpp | 122 ++++----- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 108 ++++---- zone/worldserver.cpp | 42 +-- zone/zone.cpp | 152 +++++------ zone/zonedb.cpp | 124 ++++----- zone/zoning.cpp | 46 ++-- 119 files changed, 2775 insertions(+), 2775 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 18136fcf4..1b129e552 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -27,7 +27,7 @@ #include "../../common/rulesys.h" #include "../../common/string_util.h" -EQEmuLogSys logger; +EQEmuLogSys Log; void ExportSpells(SharedDatabase *db); void ExportSkillCaps(SharedDatabase *db); @@ -35,25 +35,25 @@ void ExportBaseData(SharedDatabase *db); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientExport); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); - logger.Log(EQEmuLogSys::Status, "Client Files Export Utility"); + Log.Log(EQEmuLogSys::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { - logger.Log(EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - logger.Log(EQEmuLogSys::Status, "Connecting to database..."); + Log.Log(EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -66,11 +66,11 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - logger.Log(EQEmuLogSys::Status, "Exporting Spells..."); + Log.Log(EQEmuLogSys::Status, "Exporting Spells..."); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { - logger.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); + Log.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); return; } @@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - logger.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); @@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -140,11 +140,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - logger.Log(EQEmuLogSys::Status, "Exporting Skill Caps..."); + Log.Log(EQEmuLogSys::Status, "Exporting Skill Caps..."); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { - logger.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); + Log.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); return; } @@ -169,11 +169,11 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - logger.Log(EQEmuLogSys::Status, "Exporting Base Data..."); + Log.Log(EQEmuLogSys::Status, "Exporting Base Data..."); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { - logger.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); + Log.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); return; } @@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - logger.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 492e7b901..6e65df96b 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -25,7 +25,7 @@ #include "../../common/rulesys.h" #include "../../common/string_util.h" -EQEmuLogSys logger; +EQEmuLogSys Log; void ImportSpells(SharedDatabase *db); void ImportSkillCaps(SharedDatabase *db); @@ -33,25 +33,25 @@ void ImportBaseData(SharedDatabase *db); int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformClientImport); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); - logger.Log(EQEmuLogSys::Status, "Client Files Import Utility"); + Log.Log(EQEmuLogSys::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { - logger.Log(EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - logger.Log(EQEmuLogSys::Status, "Connecting to database..."); + Log.Log(EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -76,10 +76,10 @@ int GetSpellColumns(SharedDatabase *db) { } void ImportSpells(SharedDatabase *db) { - logger.Log(EQEmuLogSys::Status, "Importing Spells..."); + Log.Log(EQEmuLogSys::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { - logger.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); + Log.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); return; } @@ -142,23 +142,23 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - logger.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); } } if(spells_imported % 1000 != 0) { - logger.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - logger.Log(EQEmuLogSys::Status, "Importing Skill Caps..."); + Log.Log(EQEmuLogSys::Status, "Importing Skill Caps..."); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { - logger.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); + Log.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); return; } @@ -190,11 +190,11 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - logger.Log(EQEmuLogSys::Status, "Importing Base Data..."); + Log.Log(EQEmuLogSys::Status, "Importing Base Data..."); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { - logger.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); + Log.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); return; } diff --git a/common/crash.cpp b/common/crash.cpp index 94a8fb928..bbc9c3f49 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -25,7 +25,7 @@ public: } } - logger.Log(EQEmuLogSys::Crash, buffer); + Log.Log(EQEmuLogSys::Crash, buffer); StackWalker::OnOutput(szText); } }; @@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) switch(ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); break; case EXCEPTION_BREAKPOINT: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); break; case EXCEPTION_DATATYPE_MISALIGNMENT: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); break; case EXCEPTION_FLT_DENORMAL_OPERAND: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); break; case EXCEPTION_FLT_INEXACT_RESULT: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); break; case EXCEPTION_FLT_INVALID_OPERATION: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); break; case EXCEPTION_FLT_OVERFLOW: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); break; case EXCEPTION_FLT_STACK_CHECK: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); break; case EXCEPTION_FLT_UNDERFLOW: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); break; case EXCEPTION_ILLEGAL_INSTRUCTION: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); break; case EXCEPTION_IN_PAGE_ERROR: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); break; case EXCEPTION_INT_OVERFLOW: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); break; case EXCEPTION_INVALID_DISPOSITION: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); break; case EXCEPTION_NONCONTINUABLE_EXCEPTION: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); break; case EXCEPTION_PRIV_INSTRUCTION: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); break; case EXCEPTION_SINGLE_STEP: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); break; case EXCEPTION_STACK_OVERFLOW: - logger.Log(EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); + Log.Log(EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); break; default: - logger.Log(EQEmuLogSys::Crash, "Unknown Exception"); + Log.Log(EQEmuLogSys::Crash, "Unknown Exception"); break; } diff --git a/common/database.cpp b/common/database.cpp index 0246785fd..5c506fd53 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -84,12 +84,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); return false; } else { - logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid = GetCharacterID(pp->name); if(!charid) { - logger.Log(EQEmuLogSys::Error, "StoreCharacter: no character id"); + Log.Log(EQEmuLogSys::Error, "StoreCharacter: no character id"); return false; } @@ -736,10 +736,10 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - logger.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else - logger.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); + Log.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); #endif } @@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::AddReport(std::string who, std::string against, std::string lines) { @@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines safe_delete_array(escape_str); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { @@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); return; } @@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); } void Database::ClearAllGroups(void) @@ -3255,14 +3255,14 @@ uint32 Database::GetGroupID(const char* name){ if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); return 0; } if (results.RowCount() == 0) { // Commenting this out until logging levels can prevent this from going to console - //logger.Log(EQEmuLogSys::Debug, "Character not in a group: %s", name); + //Log.Log(EQEmuLogSys::Debug, "Character not in a group: %s", name); return 0; } @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - logger.Log(EQEmuLogSys::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } @@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/common/debug.cpp b/common/debug.cpp index fc7a4cc16..9b15bcbd9 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -158,7 +158,7 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) va_list argptr, tmpargptr; va_start(argptr, fmt); - logger.Log(id, vStringFormat(fmt, argptr).c_str()); + Log.Log(id, vStringFormat(fmt, argptr).c_str()); return true; } diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index eb95d557f..9ae9db4e3 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) { OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; @@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { EQRawApplicationPacket *ap=nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; @@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processed < p->size) { subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processedsize) { EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); processed+=subpacket_length+1; } else { subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length); processed+=subpacket_length+3; } @@ -178,29 +178,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Packet: { if(!p->pBuffer || (p->Size() < 4)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); delete qp; } @@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // Check for an embedded OP_AppCombinded (protocol level 0x19) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -228,29 +228,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Fragment: { if(!p->pBuffer || (p->Size() < 4)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); delete qp; } SetNextAckToSend(seq); @@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (oversize_buffer) { memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2); oversize_offset+=p->size-2; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); if (oversize_offset==oversize_length) { if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); //_raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; } else { EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); if (ap) { ap->copyInfo(p); InboundQueuePush(ap); @@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) oversize_buffer=new unsigned char[oversize_length]; memcpy(oversize_buffer,p->pBuffer+6,p->size-6); oversize_offset=p->size-6; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); } } } @@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_KeepAlive: { #ifndef COLLECTOR NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); #endif } break; case OP_Ack: { if(!p->pBuffer || (p->Size() < 4)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionRequest: { if(p->Size() < sizeof(SessionRequest)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); break; } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case // streamactive means we identified the opcode for the stream, we cannot re-establish this connection @@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); SetMaxLen(ntohl(Request->MaxLength)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); SetState(ESTABLISHED); #ifndef COLLECTOR Key=0x11223344; @@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionResponse: { if(p->Size() < sizeof(SessionResponse)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); break; } @@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) compressed=(Response->Format&FLAG_COMPRESSED); encoded=(Response->Format&FLAG_ENCODED); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); // Kinda kludgy, but trie for now if (StreamType==UnknownStream) { @@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) EQStreamState state = GetState(); if(state == ESTABLISHED) { //client initiated disconnect? - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); _SendDisconnect(); SetState(CLOSED); } else if(state == CLOSING) { //we were waiting for this anyways, ignore pending messages, send the reply and be closed. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); _SendDisconnect(); SetState(CLOSED); } else { //we are expecting this (or have already gotten it, but dont care either way) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); SetState(CLOSED); } } @@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_OutOfOrderAck: { if(!p->pBuffer || (p->Size() < 4)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } //if the packet they got out of order is between our last acked packet and the last sent packet, then its valid. if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, seq, SequencedBase, SequencedBase+NextSequencedSend); bool retransmit_acked_packets = false; @@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if(!retransmit_acked_packets) { uint16 sqsize = SequencedQueue.size(); uint16 index = seq - SequencedBase; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); if (index < sqsize) { std::deque::iterator sitr; sitr = SequencedQueue.begin(); @@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) NextSequencedSend = 0; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionStatRequest: { if(p->Size() < sizeof(SessionStats)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); break; } #ifndef COLLECTOR SessionStats *Stats=(SessionStats *)p->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, (unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta), (unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta), (unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta)); @@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX) retransmittimeout = RETRANSMIT_TIMEOUT_MAX; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); } } #endif } break; case OP_SessionStatResponse: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); } break; case OP_OutOfSession: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); } break; default: @@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) return; if(OpMgr == nullptr || *OpMgr == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; } @@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) // Convert the EQApplicationPacket to 1 or more EQProtocolPackets if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); @@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); SequencedPush(out); @@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) out->size=chunksize+2; SequencedPush(out); used+=chunksize; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); } delete p; delete[] tmpbuff; @@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p) #else MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); *(uint16 *)(p->pBuffer)=htons(NextOutSeq); SequencedQueue.push_back(p); NextOutSeq++; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) delete p; #else MOutboundQueue.lock(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); NonSequencedQueue.push(p); MOutboundQueue.unlock(); #endif @@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) void EQStream::SendAck(uint16 seq) { uint16 Seq=htons(seq); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); SetLastAckSent(seq); NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16))); } void EQStream::SendOutOfOrderAck(uint16 seq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); uint16 Seq=htons(seq); NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16))); } @@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd) // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " "buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend); NextSequencedSend = 0; retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet @@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // And remove it form the queue p = NonSequencedQueue.front(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); NonSequencedQueue.pop(); } else if (!p->combine(NonSequencedQueue.front())) { // Tryint to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked, so just remove this packet and it's spot in the queue - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); delete NonSequencedQueue.front(); NonSequencedQueue.pop(); } @@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd) if (sitr!=SequencedQueue.end()) { if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging... if(SequencedQueue.empty()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); SeqEmpty=true; continue; } if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) { if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); sitr++; NextSequencedSend++; } else if (!p) { // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } @@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } else { // No more sequenced packets @@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd) // We have a packet still, must have run out of both seq and non-seq, so send it if (p) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); ReadyToSend.push(p); BytesWritten+=p->size; } @@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd) if(SeqEmpty && NonSeqEmpty) { //no more data to send if(CheckState(CLOSING)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); //we are waiting for the queues to empty, now we can do our disconnect. //this packet will not actually go out until the next call to Write(). _SendDisconnect(); @@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses out->size=sizeof(SessionResponse); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no"); NonSequencedPush(out); @@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); NonSequencedPush(out); } @@ -932,7 +932,7 @@ void EQStream::_SendDisconnect() *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); } void EQStream::InboundQueuePush(EQRawApplicationPacket *p) @@ -959,7 +959,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if (emu_op == OP_Unknown) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -986,7 +986,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if(emu_op == OP_Unknown) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -1014,7 +1014,7 @@ void EQStream::InboundQueueClear() { EQApplicationPacket *p=nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); MInboundQueue.lock(); if (!InboundQueue.empty()) { @@ -1057,7 +1057,7 @@ void EQStream::OutboundQueueClear() { EQProtocolPacket *p=nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); MOutboundQueue.lock(); while(!NonSequencedQueue.empty()) { @@ -1079,7 +1079,7 @@ void EQStream::PacketQueueClear() { EQProtocolPacket *p=nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); if(!PacketQueue.empty()) { std::map::iterator itr; @@ -1111,7 +1111,7 @@ uint32 newlength=0; delete p; ProcessQueue(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); _hex(NET__NET_CREATE_HEX, buffer, length); } } @@ -1141,33 +1141,33 @@ std::deque::iterator itr, tmp; MOutboundQueue.lock(); //do a bit of sanity checking. if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } SeqOrder ord = CompareSequence(SequencedBase, seq); if(ord == SeqInOrder) { //they are not acking anything new... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); } else if(ord == SeqPast) { //they are nacking blocks going back before our buffer, wtf? - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); //this is a good ack, we get to ack some blocks. seq++; //we stop at the block right after their ack, counting on the wrap of both numbers. while(SequencedBase != seq) { if(SequencedQueue.empty()) { -logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); +Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); SequencedBase = NextOutSeq; NextSequencedSend = 0; break; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); //clean out the acked packet delete SequencedQueue.front(); SequencedQueue.pop_front(); @@ -1178,10 +1178,10 @@ logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKE SequencedBase++; } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } @@ -1191,7 +1191,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::SetNextAckToSend(uint32 seq) { MAcks.lock(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); NextAckToSend=seq; MAcks.unlock(); } @@ -1199,7 +1199,7 @@ void EQStream::SetNextAckToSend(uint32 seq) void EQStream::SetLastAckSent(uint32 seq) { MAcks.lock(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); LastAckSent=seq; MAcks.unlock(); } @@ -1212,10 +1212,10 @@ void EQStream::ProcessQueue() EQProtocolPacket *qp=nullptr; while((qp=RemoveQueue(NextInSeq))!=nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } } @@ -1226,21 +1226,21 @@ EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } return qp; } void EQStream::SetStreamType(EQStreamType type) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); StreamType=type; switch (StreamType) { case LoginStream: app_opcode_size=1; compressed=false; encoded=false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); break; case ChatOrMailStream: case ChatStream: @@ -1248,7 +1248,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=1; compressed=false; encoded=true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); break; case ZoneStream: case WorldStream: @@ -1256,7 +1256,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=2; compressed=true; encoded=false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); break; } } @@ -1306,7 +1306,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq) void EQStream::SetState(EQStreamState state) { MState.lock(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); State=state; MState.unlock(); } @@ -1318,29 +1318,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { EQStreamState orig_state = GetState(); if (orig_state == CLOSING && !outgoing_data) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); _SendDisconnect(); SetState(DISCONNECTING); } else if (LastPacket && (now-LastPacket) > timeout) { switch(orig_state) { case CLOSING: //if we time out in the closing state, they are not acking us, just give up - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); _SendDisconnect(); SetState(CLOSED); break; case DISCONNECTING: //we timed out waiting for them to send us the disconnect reply, just give up. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); SetState(CLOSED); break; case CLOSED: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); break; case ESTABLISHED: //we timed out during normal operation. Try to be nice about it. //we will almost certainly time out again waiting for the disconnect reply, but oh well. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); _SendDisconnect(); SetState(DISCONNECTING); break; @@ -1369,11 +1369,11 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, AVERAGE_DELTA_MAX); } } else { @@ -1381,7 +1381,7 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } @@ -1391,12 +1391,12 @@ void EQStream::AdjustRates(uint32 average_delta) void EQStream::Close() { if(HasOutgoingData()) { //there is pending data, wait for it to go out. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); SetState(CLOSING); } else { //otherwise, we are done, we can drop immediately. _SendDisconnect(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); SetState(DISCONNECTING); } } @@ -1424,19 +1424,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. if(p->size == sig->first_length) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else if(sig->first_length == 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else { //opcode matched but length did not. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); res = MatchFailed; } } else { //first opcode did not match.. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); res = MatchFailed; } } diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 3bd6ad185..f0fb30929 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif fs->ReaderLoop(); #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); @@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif fs->WriterLoop(); #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index a550bbbd3..d267a013c 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -46,7 +46,7 @@ void EQStreamIdentifier::Process() { //first see if this stream has expired if(r->expire.Check(false)) { //this stream has failed to match any pattern in our timeframe. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); delete r; cur = m_streams.erase(cur); @@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() { } if(r->stream->GetState() != ESTABLISHED) { //the stream closed before it was identified. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); switch(r->stream->GetState()) { case ESTABLISHED: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); break; case CLOSING: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); break; case DISCONNECTING: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); break; case CLOSED: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); break; default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); break; } r->stream->ReleaseFromUse(); @@ -103,13 +103,13 @@ void EQStreamIdentifier::Process() { switch(res) { case EQStream::MatchNotReady: //the stream has not received enough packets to compare with this signature -// logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); +// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); all_ready = false; break; case EQStream::MatchSuccessful: { //yay, a match. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further r->stream->SetActive(true); @@ -123,7 +123,7 @@ void EQStreamIdentifier::Process() { } case EQStream::MatchFailed: //do nothing... - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); break; } } @@ -131,7 +131,7 @@ void EQStreamIdentifier::Process() { //if we checked all patches and did not find a match. if(all_ready && !found_one) { //the stream cannot be identified. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 7a6ba419e..97cffc9dd 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -115,7 +115,7 @@ private: void ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message); }; -extern EQEmuLogSys logger; +extern EQEmuLogSys Log; /* If you add to this, make sure you update LogCategory */ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { diff --git a/common/eqtime.cpp b/common/eqtime.cpp index 4ffd66bb3..c689b634c 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename) of.open(filename); if(!of) { - logger.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); + Log.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); return false; } //Enable for debugging @@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename) in.open(filename); if(!in) { - logger.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename); + Log.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename); return false; } in >> version; in.ignore(80, '\n'); if(version != EQT_VERSION) { - logger.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); + Log.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); return false; } //in >> eqTime.start_eqtime.day; diff --git a/common/guild_base.cpp b/common/guild_base.cpp index deb7ea1e0..b168d49fb 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); return(false); } @@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); continue; } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); return false; } @@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } @@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); return true; } @@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); return(false); } GuildInfo *info = res->second; @@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; @@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); @@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } safe_delete_array(title_esc); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); return true; } uint32 BaseGuildManager::_GetFreeGuildID() { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -337,18 +337,18 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } if (results.RowCount() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); return index; } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); return GUILD_NONE; } @@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) { //now store the resulting guild setup into the DB. if(!_StoreGuildDB(new_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); return(GUILD_NONE); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); return(new_id); } @@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id); QueryWithLogging(query, "deleting guild bank"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); return(true); } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); return false; } @@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); safe_delete_array(esc); return false; } safe_delete_array(esc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); info->name = name; //update our local record. @@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); return false; } @@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(!DBSetGuildRank(leader, GUILD_LEADER)) return false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); info->leader_char_id = leader; //update our local record. @@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; @@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c safe_delete_array(esc); safe_delete_array(esc_set); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); info->motd = motd; //update our local record. info->motd_setter = setter; //update our local record. @@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); info->url = URL; //update our local record. @@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); info->channel = Channel; //update our local record. @@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); return true; } @@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); return true; } @@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } @@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); return true; @@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { if(m_db == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); return false; } @@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); return true; @@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const { bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const { if(guild_id == GUILD_NONE) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); return(false); //invalid guild } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); return(char_id == res->second->leader_char_id); } @@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { if(status >= 250) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); return(true); //250+ as allowed anything } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); return(false); //invalid guild } bool granted = (res->second->minstatus <= status); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied"); return(granted); @@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const { if(rank > GUILD_MAX_RANK) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid rank } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid guild } bool granted = res->second->ranks[rank].permissions[act]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", res->second->name.c_str(), guild_id, res->second->ranks[rank].name.c_str(), rank, GuildActionNames[act], act, @@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/common/item.cpp b/common/item.cpp index 9e8be60f7..c564edae7 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } if (result == INVALID_INDEX) { - logger.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); + Log.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/common/misc_functions.h b/common/misc_functions.h index 8a77972c2..27e648511 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 4925ba3d4..9e952ca74 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -52,7 +52,7 @@ namespace RoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -316,7 +316,7 @@ namespace RoF if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -551,7 +551,7 @@ namespace RoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -585,13 +585,13 @@ namespace RoF safe_delete_array(Serialized); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -952,16 +952,16 @@ namespace RoF ENCODE(OP_GroupUpdate) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -979,7 +979,7 @@ namespace RoF return; } //if(gjs->action == groupActLeave) - // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -996,19 +996,19 @@ namespace RoF if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -1016,7 +1016,7 @@ namespace RoF } } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -1078,7 +1078,7 @@ namespace RoF return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1386,7 +1386,7 @@ namespace RoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2556,7 +2556,7 @@ namespace RoF outapp->WriteUInt8(0); // Unknown - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3321,7 +3321,7 @@ namespace RoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3654,16 +3654,16 @@ namespace RoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer, *BufferStart; @@ -3902,9 +3902,9 @@ namespace RoF Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4298,7 +4298,7 @@ namespace RoF DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4312,7 +4312,7 @@ namespace RoF DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4326,7 +4326,7 @@ namespace RoF DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4340,7 +4340,7 @@ namespace RoF DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4353,7 +4353,7 @@ namespace RoF DECODE(OP_GroupInvite2) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -4497,8 +4497,8 @@ namespace RoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -4827,7 +4827,7 @@ namespace RoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); RoF::structs::ItemSerializationHeader hdr; @@ -4936,7 +4936,7 @@ namespace RoF } ss.write((const char*)&null_term, sizeof(uint8)); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct)); RoF::structs::ItemBodyStruct ibs; memset(&ibs, 0, sizeof(RoF::structs::ItemBodyStruct)); @@ -5043,7 +5043,7 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct)); RoF::structs::ItemSecondaryBodyStruct isbs; memset(&isbs, 0, sizeof(RoF::structs::ItemSecondaryBodyStruct)); @@ -5084,7 +5084,7 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct)); RoF::structs::ItemTertiaryBodyStruct itbs; memset(&itbs, 0, sizeof(RoF::structs::ItemTertiaryBodyStruct)); @@ -5123,7 +5123,7 @@ namespace RoF // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct)); RoF::structs::ClickEffectStruct ices; memset(&ices, 0, sizeof(RoF::structs::ClickEffectStruct)); @@ -5150,7 +5150,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct)); RoF::structs::ProcEffectStruct ipes; memset(&ipes, 0, sizeof(RoF::structs::ProcEffectStruct)); @@ -5174,7 +5174,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct)); RoF::structs::WornEffectStruct iwes; memset(&iwes, 0, sizeof(RoF::structs::WornEffectStruct)); @@ -5265,7 +5265,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct)); RoF::structs::ItemQuaternaryBodyStruct iqbs; memset(&iqbs, 0, sizeof(RoF::structs::ItemQuaternaryBodyStruct)); @@ -5455,7 +5455,7 @@ namespace RoF RoFSlot.MainSlot = TempSlot; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5496,7 +5496,7 @@ namespace RoF RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5601,7 +5601,7 @@ namespace RoF ServerSlot = INVALID_INDEX; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -5636,7 +5636,7 @@ namespace RoF ServerSlot = TempSlot; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index b0cdc9739..0fa71bb36 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -52,7 +52,7 @@ namespace RoF2 //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF2 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF2 opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -382,7 +382,7 @@ namespace RoF2 if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -617,7 +617,7 @@ namespace RoF2 if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -651,13 +651,13 @@ namespace RoF2 safe_delete_array(Serialized); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -1018,16 +1018,16 @@ namespace RoF2 ENCODE(OP_GroupUpdate) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -1045,7 +1045,7 @@ namespace RoF2 return; } //if(gjs->action == groupActLeave) - // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -1062,19 +1062,19 @@ namespace RoF2 if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -1082,7 +1082,7 @@ namespace RoF2 } } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -1144,7 +1144,7 @@ namespace RoF2 return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1452,7 +1452,7 @@ namespace RoF2 char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType); if (!serialized) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2640,7 +2640,7 @@ namespace RoF2 // Think we need 1 byte of padding at the end outapp->WriteUInt8(0); // Unknown - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3387,7 +3387,7 @@ namespace RoF2 if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3721,16 +3721,16 @@ namespace RoF2 //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer, *BufferStart; @@ -3973,9 +3973,9 @@ namespace RoF2 Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4370,7 +4370,7 @@ namespace RoF2 DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4384,7 +4384,7 @@ namespace RoF2 DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4398,7 +4398,7 @@ namespace RoF2 DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4412,7 +4412,7 @@ namespace RoF2 DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4425,7 +4425,7 @@ namespace RoF2 DECODE(OP_GroupInvite2) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -4568,8 +4568,8 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -4898,7 +4898,7 @@ namespace RoF2 std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); RoF2::structs::ItemSerializationHeader hdr; @@ -5006,7 +5006,7 @@ namespace RoF2 } ss.write((const char*)&null_term, sizeof(uint8)); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct)); RoF2::structs::ItemBodyStruct ibs; memset(&ibs, 0, sizeof(RoF2::structs::ItemBodyStruct)); @@ -5113,7 +5113,7 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct)); RoF2::structs::ItemSecondaryBodyStruct isbs; memset(&isbs, 0, sizeof(RoF2::structs::ItemSecondaryBodyStruct)); @@ -5154,7 +5154,7 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct)); RoF2::structs::ItemTertiaryBodyStruct itbs; memset(&itbs, 0, sizeof(RoF2::structs::ItemTertiaryBodyStruct)); @@ -5193,7 +5193,7 @@ namespace RoF2 // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct)); RoF2::structs::ClickEffectStruct ices; memset(&ices, 0, sizeof(RoF2::structs::ClickEffectStruct)); @@ -5220,7 +5220,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct)); RoF2::structs::ProcEffectStruct ipes; memset(&ipes, 0, sizeof(RoF2::structs::ProcEffectStruct)); @@ -5244,7 +5244,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct)); RoF2::structs::WornEffectStruct iwes; memset(&iwes, 0, sizeof(RoF2::structs::WornEffectStruct)); @@ -5335,7 +5335,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); RoF2::structs::ItemQuaternaryBodyStruct iqbs; memset(&iqbs, 0, sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); @@ -5546,7 +5546,7 @@ namespace RoF2 RoF2Slot.MainSlot = TempSlot; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5587,7 +5587,7 @@ namespace RoF2 RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5696,7 +5696,7 @@ namespace RoF2 ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } @@ -5731,7 +5731,7 @@ namespace RoF2 ServerSlot = TempSlot; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 230316bed..5b9ea0aab 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -50,7 +50,7 @@ namespace SoD //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoD - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoD opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -247,7 +247,7 @@ namespace SoD if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -359,7 +359,7 @@ namespace SoD if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -391,13 +391,13 @@ namespace SoD } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -683,16 +683,16 @@ namespace SoD ENCODE(OP_GroupUpdate) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -710,7 +710,7 @@ namespace SoD return; } //if(gjs->action == groupActLeave) - // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -727,19 +727,19 @@ namespace SoD if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -747,7 +747,7 @@ namespace SoD } } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); char *Buffer = (char *)outapp->pBuffer; @@ -807,7 +807,7 @@ namespace SoD return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -967,7 +967,7 @@ namespace SoD char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2108,7 +2108,7 @@ namespace SoD if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2363,16 +2363,16 @@ namespace SoD //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer; @@ -2963,7 +2963,7 @@ namespace SoD DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -2977,7 +2977,7 @@ namespace SoD DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -2991,7 +2991,7 @@ namespace SoD DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3005,7 +3005,7 @@ namespace SoD DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -3018,7 +3018,7 @@ namespace SoD DECODE(OP_GroupInvite2) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -3091,7 +3091,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); @@ -3384,7 +3384,7 @@ namespace SoD std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); SoD::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index c84518293..0ab39d521 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -50,7 +50,7 @@ namespace SoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoF - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -214,7 +214,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -337,7 +337,7 @@ namespace SoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -371,13 +371,13 @@ namespace SoF } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -766,7 +766,7 @@ namespace SoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1707,7 +1707,7 @@ namespace SoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1887,7 +1887,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -2096,7 +2096,7 @@ namespace SoF //kill off the emu structure and send the eq packet. delete[] __emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawns"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawns"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -2429,7 +2429,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); @@ -2708,7 +2708,7 @@ namespace SoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); SoF::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 7b53f78bb..de9237636 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index e7903e304..f607941fd 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -48,7 +48,7 @@ namespace Titanium //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -74,7 +74,7 @@ namespace Titanium - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -89,10 +89,10 @@ namespace Titanium opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -187,7 +187,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -268,7 +268,7 @@ namespace Titanium int itemcount = in->size / sizeof(InternalSerializedItem_Struct); if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; return; } @@ -285,7 +285,7 @@ namespace Titanium safe_delete_array(serialized); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -635,7 +635,7 @@ namespace Titanium char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1157,7 +1157,7 @@ namespace Titanium if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1274,7 +1274,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -1623,7 +1623,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index a12fc66ed..2602a62c1 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -50,7 +50,7 @@ namespace Underfoot //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace Underfoot - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace Underfoot opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -307,7 +307,7 @@ namespace Underfoot if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -494,7 +494,7 @@ namespace Underfoot if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -526,13 +526,13 @@ namespace Underfoot safe_delete_array(Serialized); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -839,16 +839,16 @@ namespace Underfoot ENCODE(OP_GroupUpdate) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -867,7 +867,7 @@ namespace Underfoot return; } //if(gjs->action == groupActLeave) - // logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -884,19 +884,19 @@ namespace Underfoot if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -904,7 +904,7 @@ namespace Underfoot } } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -964,7 +964,7 @@ namespace Underfoot delete in; return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1190,7 +1190,7 @@ namespace Underfoot char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2374,7 +2374,7 @@ namespace Underfoot if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2624,16 +2624,16 @@ namespace Underfoot //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer; @@ -3276,7 +3276,7 @@ namespace Underfoot DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -3290,7 +3290,7 @@ namespace Underfoot DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3304,7 +3304,7 @@ namespace Underfoot DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3318,7 +3318,7 @@ namespace Underfoot DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -3331,7 +3331,7 @@ namespace Underfoot DECODE(OP_GroupInvite2) { - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -3406,7 +3406,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = UnderfootToServerSlot(eq->from_slot); emu->to_slot = UnderfootToServerSlot(eq->to_slot); @@ -3629,7 +3629,7 @@ namespace Underfoot std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //logger.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); Underfoot::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/ptimer.cpp b/common/ptimer.cpp index 2d6e07c63..ea718fdd9 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { if (this == nullptr) { - logger.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); + Log.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); return(true); } uint32 current_time = get_current_time(); @@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - logger.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - logger.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); #endif return false; } diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 683697422..e0a1091e3 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); return(false); } } @@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas switch(type) { case IntRule: m_RuleIntValues [index] = atoi(rule_value); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); break; case RealRule: m_RuleRealValues[index] = atof(rule_value); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); break; case BoolRule: uint32 val = 0; if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1")) val = 1; m_RuleBoolValues[index] = val; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); break; } @@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas } void RuleManager::ResetRules() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); #define RULE_INT(cat, rule, default_value) \ m_RuleIntValues[ Int__##rule ] = default_value; #define RULE_REAL(cat, rule, default_value) \ @@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & return(true); } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); return(false); } @@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) { m_activeRuleset = _FindOrCreateRuleset(db, ruleset); if(m_activeRuleset == -1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); return; } m_activeName = ruleset; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } int r; @@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { int rsid = GetRulesetID(db, ruleset); if(rsid < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); return(false); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); m_activeRuleset = rsid; m_activeName = ruleset; @@ -282,13 +282,13 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } for(auto row = results.begin(); row != results.end(); ++row) if(!SetRule(row[0], row[1], nullptr, false)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); return true; } @@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } @@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 5efa08efe..d6d6916fd 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } @@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); return false; } @@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { const Item_Struct* item = GetItem(item_id); if (!item) { - logger.Log(EQEmuLogSys::Error, + Log.Log(EQEmuLogSys::Error, "Warning: %s %i has an invalid item_id %i in inventory slot %i", ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); continue; @@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (put_slot_id != INVALID_INDEX) continue; - logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", + Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", ((is_charid==true)? "charid": "acctid"), id, item_id, slot_id); if (is_charid) @@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - logger.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { const Item_Struct* item = GetItem(item_id); if (!item) { - logger.Log(EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); + Log.Log(EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); continue; } @@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { else if (slot_id >= 3111 && slot_id <= 3179) { // Admins: please report any occurrences of this error - logger.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); + Log.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); put_slot_id = inv->PushCursor(*inst); } else @@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) { - logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); + Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); } } @@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - logger.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - logger.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); + Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); } @@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() { items_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(items_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - logger.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); return false; } @@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ try { hash.insert(item.ID, item); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); break; } } @@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile) } if (results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile); + Log.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile); txtout.assign(" ",1); return txtout; } @@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() { faction_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(faction_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - logger.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); return false; } @@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst = CreateBaseItem(item, charges); if (inst == nullptr) { - logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst = CreateBaseItem(item, charges); if (inst == nullptr) { - logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) inst = new ItemInst(item, charges); if (inst == nullptr) { - logger.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); - logger.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); + Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() { mutex.Unlock(); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); return false; } @@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) { const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); return; } @@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } @@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() { mutex.Unlock(); } catch(std::exception& ex) { - logger.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); return false; } @@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { cl = atoi(row[1]); if(lvl <= 0) { - logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); + Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); continue; } if(lvl >= max_level) { - logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); + Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); continue; } if(cl <= 0) { - logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); + Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); continue; } if(cl > 16) { - logger.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); + Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); continue; } @@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; @@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() { loot_drop_mmf->Size()); mutex.Unlock(); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); return false; } @@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { return &loot_table_hash->at(loottable_id); } } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); } return nullptr; } @@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { return &loot_drop_hash->at(lootdrop_id); } } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); } return nullptr; } diff --git a/common/spdat.cpp b/common/spdat.cpp index c6b7b26d9..c54dfd1de 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -839,7 +839,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 97541d559..a0890c1ec 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -39,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo EQApplicationPacket *p = *in_p; *in_p = nullptr; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); delete p; } void StructStrategy::ErrorDecoder(EQApplicationPacket *p) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); p->SetOpcode(OP_Unknown); } diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index bc9df8389..b7434b947 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index f1154b120..f61418a50 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); #endif tcps->MLoopRunning.lock(); @@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index 309d24f1a..5cc77e750 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() { Timeoutable *it = *cur; if(it->next_check.Check()) { #ifdef TIMEOUT_DEBUG - logger.Log(EQEmuLogSys::Debug, "Checking timeout on 0x%x\n", it); + Log.Log(EQEmuLogSys::Debug, "Checking timeout on 0x%x\n", it); #endif it->CheckTimeout(); } @@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) { DeleteMember(who); //just in case... prolly not needed. members.push_back(who); #ifdef TIMEOUT_DEBUG - logger.Log(EQEmuLogSys::Debug, "Adding timeoutable 0x%x\n", who); + Log.Log(EQEmuLogSys::Debug, "Adding timeoutable 0x%x\n", who); #endif } void TimeoutManager::DeleteMember(Timeoutable *who) { #ifdef TIMEOUT_DEBUG - logger.Log(EQEmuLogSys::Debug, "Removing timeoutable 0x%x\n", who); + Log.Log(EQEmuLogSys::Debug, "Removing timeoutable 0x%x\n", who); #endif std::vector::iterator cur,end; cur = members.begin(); diff --git a/common/worldconn.cpp b/common/worldconn.cpp index 72e1c768e..f1820186f 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) { void WorldConnection::OnConnected() { const EQEmuConfig *Config=EQEmuConfig::get(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16); MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); @@ -76,7 +76,7 @@ bool WorldConnection::Connect() { if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { return true; } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); } return false; } diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 1ef88d381..c145ed9a6 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -31,7 +31,7 @@ #include #include -EQEmuLogSys logger; +EQEmuLogSys Log; bool RunLoops = false; @@ -39,7 +39,7 @@ void CatchSignal(int sig_num); int main(int argc, char *argv[]) { RegisterExecutablePlatform(ExePlatformLaunch); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); std::string launcher_name; @@ -47,13 +47,13 @@ int main(int argc, char *argv[]) { launcher_name = argv[1]; } if(launcher_name.length() < 1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); return 1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); if (!EQEmuConfig::LoadConfig()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); return 1; } const EQEmuConfig *Config = EQEmuConfig::get(); @@ -62,16 +62,16 @@ int main(int argc, char *argv[]) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::map zones; WorldServer world(zones, launcher_name.c_str(), Config); if (!world.Connect()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); } std::map::iterator zone, zend; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); // zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1"); @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { void CatchSignal(int sig_num) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); RunLoops = false; } diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index 43170a9ec..4d537c40b 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -74,14 +74,14 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; } case ServerOP_LauncherZoneRequest: { if(pack->size != sizeof(LauncherZoneRequest)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); break; } const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer; @@ -90,9 +90,9 @@ void WorldServer::Process() { switch(ZoneRequestCommands(lzr->command)) { case ZR_Start: { if(m_zones.find(lzr->short_name) != m_zones.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config); m_zones[lzr->short_name] = l; } @@ -101,9 +101,9 @@ void WorldServer::Process() { case ZR_Restart: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); res->second->Restart(); } break; @@ -111,9 +111,9 @@ void WorldServer::Process() { case ZR_Stop: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); res->second->Stop(); } break; @@ -127,7 +127,7 @@ void WorldServer::Process() { } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); break; } } diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index 532028fc6..66baf675b 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -72,7 +72,7 @@ void ZoneLaunch::Start() { //spec is consumed, even on failure m_ref = ProcLauncher::get()->Launch(spec); if(m_ref == ProcLauncher::ProcError) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); m_timer.Start(m_config->RestartWait); return; } @@ -84,17 +84,17 @@ void ZoneLaunch::Start() { SendStatus(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); } void ZoneLaunch::Restart() { switch(m_state) { case StateRestartPending: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); break; case StateStartPending: //we havent started yet, do nothing - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); break; case StateStarted: //process is running along, kill it off.. @@ -102,20 +102,20 @@ void ZoneLaunch::Restart() { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, true)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateRestartPending; break; case StateStopPending: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); break; case StateStopped: //process is already stopped... nothing to do.. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -124,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) { switch(m_state) { case StateStartPending: //we havent started yet, transition directly to stopped. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); m_state = StateStopped; break; case StateStarted: @@ -134,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, graceful)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateStopPending; break; case StateStopped: //process is already stopped... nothing to do.. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -164,17 +164,17 @@ bool ZoneLaunch::Process() { m_timer.Disable(); //actually start up the program - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); Start(); //now update the shared timer to reflect the proper start interval. if(s_running == 1) { //we are the first zone started. wait that interval. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); s_startTimer.Start(m_config->InitialBootWait); } else { //just some follow on zone, use that interval. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); s_startTimer.Start(m_config->ZoneBootInterval); } @@ -187,7 +187,7 @@ bool ZoneLaunch::Process() { //waiting for notification that our child has died.. if(m_timer.Check()) { //we have timed out, try to kill the child again - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Restart(); } break; @@ -197,12 +197,12 @@ bool ZoneLaunch::Process() { //we have timed out, try to kill the child again m_killFails++; if(m_killFails > 5) { //should get this number from somewhere.. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); m_state = StateStopped; s_running--; SendStatus(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Stop(false); } } @@ -221,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche switch(m_state) { case StateStartPending: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateStarted: //something happened to our happy process... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateRestartPending: //it finally died, start it on up again - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); m_state = StateStartPending; break; case StateStopPending: //it finally died, transition to close. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); m_state = StateStopped; break; case StateStopped: //we already thought it was stopped... dont care... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); break; } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 244292de4..c7c4ec8c9 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -69,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, safe_delete_array(escapedMessage); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } @@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->char2_money.silver, QS->char2_money.copper, QS->char2_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->npc_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(members == 0) @@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ lastIndex, QS->Chars[i].char_id); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->char_id, QS->stack_size, QS->char_count, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->char_count, QS->postaction); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->char_money.copper, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { std::string query(queryBuffer); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } safe_delete(pack); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 01ab77312..cb3143d7b 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -40,7 +40,7 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -242,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -257,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -288,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -305,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -335,7 +335,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } @@ -348,7 +348,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 696224bc0..9011d94f5 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -40,7 +40,7 @@ LFGuildManager lfguildmanager; std::string WorldShortName; const queryservconfig *Config; WorldServer *worldserver = 0; -EQEmuLogSys logger; +EQEmuLogSys Log; void CatchSignal(int sig_num) { RunLoops = false; @@ -50,7 +50,7 @@ void CatchSignal(int sig_num) { int main() { RegisterExecutablePlatform(ExePlatformQueryServ); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); Timer LFGuildExpireTimer(60000); Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect @@ -65,16 +65,16 @@ int main() { */ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!database.Connect( @@ -83,22 +83,22 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } /* Initialize Logging */ if (!load_log_settings(Config->LogSettingsFile.c_str())) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index d55da3be9..b2a3d0605 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -53,7 +53,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -66,7 +66,7 @@ void WorldServer::Process() ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { case 0: { break; @@ -148,7 +148,7 @@ void WorldServer::Process() break; } default: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); break; } break; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index e8d7ec8b9..765d08c22 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -33,29 +33,29 @@ #include "spells.h" #include "base_data.h" -EQEmuLogSys logger; +EQEmuLogSys Log; int main(int argc, char **argv) { RegisterExecutablePlatform(ExePlatformSharedMemory); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); - logger.Log(EQEmuLogSys::Status, "Shared Memory Loader Program"); + Log.Log(EQEmuLogSys::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { - logger.Log(EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - logger.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - logger.Log(EQEmuLogSys::Status, "Connecting to database..."); + Log.Log(EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - logger.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -114,61 +114,61 @@ int main(int argc, char **argv) { } if(load_all || load_items) { - logger.Log(EQEmuLogSys::Status, "Loading items..."); + Log.Log(EQEmuLogSys::Status, "Loading items..."); try { LoadItems(&database); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_factions) { - logger.Log(EQEmuLogSys::Status, "Loading factions..."); + Log.Log(EQEmuLogSys::Status, "Loading factions..."); try { LoadFactions(&database); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_loot) { - logger.Log(EQEmuLogSys::Status, "Loading loot..."); + Log.Log(EQEmuLogSys::Status, "Loading loot..."); try { LoadLoot(&database); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_skill_caps) { - logger.Log(EQEmuLogSys::Status, "Loading skill caps..."); + Log.Log(EQEmuLogSys::Status, "Loading skill caps..."); try { LoadSkillCaps(&database); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_spells) { - logger.Log(EQEmuLogSys::Status, "Loading spells..."); + Log.Log(EQEmuLogSys::Status, "Loading spells..."); try { LoadSpells(&database); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_bd) { - logger.Log(EQEmuLogSys::Status, "Loading base data..."); + Log.Log(EQEmuLogSys::Status, "Loading base data..."); try { LoadBaseData(&database); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.Log(EQEmuLogSys::Error, "%s", ex.what()); return 1; } } diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 13d37f9ec..06c05516f 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -42,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -149,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) { void ChatChannelList::RemoveChannel(ChatChannel *Channel) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); LinkedListIterator iterator(ChatChannels); @@ -170,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) { void ChatChannelList::RemoveAllChannels() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); LinkedListIterator iterator(ChatChannels); @@ -228,7 +228,7 @@ void ChatChannel::AddClient(Client *c) { if(IsClientInChannel(c)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); return; } @@ -237,7 +237,7 @@ void ChatChannel::AddClient(Client *c) { int AccountStatus = c->GetAccountStatus(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); LinkedListIterator iterator(ClientsInChannel); @@ -262,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) { if(!c) return false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); bool HideMe = c->GetHideMe(); @@ -299,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) { if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0)) return false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000); } @@ -397,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); ChannelClient->SendChannelMessage(Name, Message, Sender); } @@ -479,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client return nullptr; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); ChatChannel *RequiredChannel = FindChannel(NormalisedName); @@ -555,7 +555,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); @@ -572,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) { Invitees.push_back(Invitee); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); } } @@ -587,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) { Invitees.erase(Iterator); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); return; } @@ -613,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) { Moderators.push_back(Moderator); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); } } @@ -628,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) { Moderators.erase(Iterator); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); return; } @@ -654,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) { Voiced.push_back(inVoiced); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); } } @@ -669,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) { Voiced.erase(Iterator); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); return; } diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index a95e951e6..de18778c8 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -236,7 +236,7 @@ std::vector ParseRecipients(std::string RecipientString) { static void ProcessMailTo(Client *c, std::string MailMessage) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); std::vector Recipients; @@ -305,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -400,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) { static void ProcessCommandBuddy(Client *c, std::string Buddy) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); c->GeneralChannelMessage("Buddy list modified"); uint8 SubAction = 1; @@ -430,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { static void ProcessCommandIgnore(Client *c, std::string Ignoree) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); c->GeneralChannelMessage("Ignore list modified"); uint8 SubAction = 0; @@ -481,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) { exit(1); if (chatsf->Open()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); exit(1); } @@ -560,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) { if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName()) && (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); struct in_addr in; in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -586,7 +586,7 @@ void Clientlist::Process() { in.s_addr = eqs->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); eqs->SetOpcodeManager(&ChatOpMgr); @@ -606,7 +606,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -646,7 +646,7 @@ void Clientlist::Process() { if(strlen(PacketBuffer) != 9) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -667,11 +667,11 @@ void Clientlist::Process() { else CharacterName = MailBoxString.substr(LastPeriod + 1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; @@ -703,7 +703,7 @@ void Clientlist::Process() { default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); break; } } @@ -716,7 +716,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()), KeyValid, (*Iterator)->GetForceDisconnect()); @@ -860,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) break; case CommandSetMessageStatus: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); ProcessSetMessageStatus(Parameters); break; @@ -885,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) default: c->SendHelp(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); } } @@ -896,7 +896,7 @@ void Clientlist::CloseAllConnections() { for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); (*Iterator)->CloseConnection(); } @@ -905,7 +905,7 @@ void Clientlist::CloseAllConnections() { void Client::AddCharacter(int CharID, const char *CharacterName, int Level) { if(!CharacterName) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); CharacterEntry NewCharacter; NewCharacter.CharID = CharID; NewCharacter.Name = CharacterName; @@ -971,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { for(int i = 0; i < MAX_JOINED_CHANNELS; i++) if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; } } @@ -1012,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) { } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); int NumberOfChannels = ChannelCount(); @@ -1113,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) { void Client::LeaveChannels(std::string ChannelNameList) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); std::string::size_type CurrentPos = 0; @@ -1292,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message) std::string ChannelName = Message.substr(1, MessageStart-1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1435,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if(RuleB(Chat, EnableAntiSpam)) @@ -1647,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) { else Message = "Password change on channel " + ChannelName; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1702,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1790,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Invitee); @@ -1918,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Moderator); @@ -1999,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Voicee); @@ -2087,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Kickee); @@ -2196,32 +2196,32 @@ void Client::SetConnectionType(char c) { case 'S': { TypeOfConnection = ConnectionTypeCombined; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); break; } case 'U': { TypeOfConnection = ConnectionTypeCombined; UnderfootOrLater = true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); break; } case 'M': { TypeOfConnection = ConnectionTypeMail; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); break; } case 'C': { TypeOfConnection = ConnectionTypeChat; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); break; } default: { TypeOfConnection = ConnectionTypeUnknown; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); } } } @@ -2299,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin void Client::ChangeMailBox(int NewMailBox) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); SetMailBox(NewMailBox); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); auto outapp = new EQApplicationPacket(OP_MailboxChange, 2); @@ -2377,13 +2377,13 @@ std::string Client::MailBoxName() { if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return ""; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index f18e12fe5..d437e3d64 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -74,14 +74,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - logger.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - logger.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) { client->GetAccountID()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); if(results.RowCount() != 1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); return; } @@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) { client->SetKarma(atoi(row[2])); client->SetRevoked((atoi(row[3])==1?true:false)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); } int Database::FindAccount(const char *characterName, Client *client) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); client->ClearCharacters(); @@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) { characterName); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); return -1; } if (results.RowCount() != 1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); return -1; } @@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) { int accountID = atoi(row[1]); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` " "WHERE `account_id` = %i AND `name` != '%s'", @@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri characterName.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); return false; } @@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri else sprintf(combinedKey, "%s", MailKey.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); return !strcmp(row[0], combinedKey); } @@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } safe_delete(safeCharName); if (results.RowCount() != 1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); return -1; } @@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ bool Database::LoadChatChannels() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -267,25 +267,25 @@ bool Database::LoadChatChannels() { void Database::SetChannelPassword(std::string channelName, std::string password) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::SetChannelOwner(std::string channelName, std::string owner) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) { int unknownField3 = 1; int characterID = FindCharacter(client->MailBoxName().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) { int characterID = FindCharacter(client->MailBoxName().c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) { auto row = results.begin(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]); @@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub characterID = FindCharacter(characterName.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); if(characterID <= 0) return false; @@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); Client *client = CL->IsCharacterOnline(characterName); @@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub void Database::SetMessageStatus(int messageNumber, int status) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); if(status == 0) { std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber); @@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::ExpireMail() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } auto row = results.begin(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { @@ -524,9 +524,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); if(results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -536,9 +536,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); if(results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread @@ -547,9 +547,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); if(results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } @@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); } @@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends if(atoi(row[0]) == 0) { ignorees.push_back(name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); continue; } friends.push_back(name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); } } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 6f64463f3..196200a48 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -51,7 +51,7 @@ std::string WorldShortName; const ucsconfig *Config; WorldServer *worldserver = nullptr; -EQEmuLogSys logger; +EQEmuLogSys Log; void CatchSignal(int sig_num) { @@ -69,7 +69,7 @@ std::string GetMailPrefix() { int main() { RegisterExecutablePlatform(ExePlatformUCS); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); // Check every minute for unused channels we can delete @@ -78,11 +78,11 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); return 1; } @@ -90,13 +90,13 @@ int main() { Config = ucsconfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); WorldShortName = Config->ShortName; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -104,22 +104,22 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -127,7 +127,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -138,11 +138,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index 49f4d2b48..c6e91d47c 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -52,7 +52,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -67,7 +67,7 @@ void WorldServer::Process() while((pack = tcpc.PopPacket())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { @@ -88,7 +88,7 @@ void WorldServer::Process() std::string Message = Buffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); Client *c = CL->FindCharacter(From); @@ -99,7 +99,7 @@ void WorldServer::Process() if(!c) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); break; } diff --git a/world/adventure.cpp b/world/adventure.cpp index 453e3f93f..0c0c3b18d 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); @@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 022448516..53a755bdb 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/world/client.cpp b/world/client.cpp index 0584fac61..1606de8af 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -136,7 +136,7 @@ void Client::SendEnterWorld(std::string name) eqs->Close(); return; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); } } @@ -378,7 +378,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if (strlen(password) <= 1) { // TODO: Find out how to tell the client wrong username/password - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); return false; } @@ -408,31 +408,31 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password))) #else if (loginserverlist.Connected() == false && !pZoning) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); return false; } if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password)))) #endif { if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); if(!minilogin) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); return false; } cle->SetOnline(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); if(minilogin){ WorldConfig::DisableStats(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); } const WorldConfig *Config=WorldConfig::get(); @@ -465,7 +465,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { } else { // TODO: Find out how to tell the client wrong username/password - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); return false; } @@ -479,7 +479,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); return false; } @@ -487,7 +487,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) uchar race = app->pBuffer[64]; uchar clas = app->pBuffer[68]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); EQApplicationPacket *outapp; outapp = new EQApplicationPacket; @@ -648,11 +648,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app) bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); return false; } else if (app->size != sizeof(CharCreate_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); DumpPacket(app); // the previous behavior was essentially returning true here // but that seems a bit odd to me. @@ -679,14 +679,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); eqs->Close(); return true; } if(GetAdmin() < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); eqs->Close(); return true; } @@ -702,14 +702,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { uint32 tmpaccid = 0; charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID); if (charid == 0 || tmpaccid != GetAccountID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); eqs->Close(); return true; } // Make sure this account owns this character if (tmpaccid != GetAccountID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); eqs->Close(); return true; } @@ -737,7 +737,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { zoneID = database.MoveCharacterToBind(charid,4); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able."); eqs->Close(); return true; @@ -770,7 +770,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character."); eqs->Close(); return true; @@ -780,7 +780,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (zoneID == 0 || !database.GetZoneName(zoneID)) { // This is to save people in an invalid zone, once it's removed from the DB database.MoveCharacterToZone(charid, "arena"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); } if(instanceID > 0) @@ -894,7 +894,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) { uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer); if(char_acct_id == GetAccountID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); database.DeleteCharacter((char *)app->pBuffer); SendCharInfo(); } @@ -915,25 +915,25 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { EmuOpcode opcode = app->GetOpcode(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); _pkt(WORLD__CLIENT_TRACE,app); if (!eqs->CheckState(ESTABLISHED)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); return false; } // Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) { if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); eqs->Close(); } } if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) { // Got a packet other than OP_SendLoginInfo when not logged in - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); return false; } else if (opcode == OP_AckPacket) { @@ -1005,7 +1005,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); _pkt(WORLD__CLIENT_ERR,app); return true; } @@ -1024,7 +1024,7 @@ bool Client::Process() { to.sin_addr.s_addr = ip; if (autobootup_timeout.Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); ZoneUnavail(); } if(connect.Check()){ @@ -1058,7 +1058,7 @@ bool Client::Process() { loginserverlist.SendPacket(pack); safe_delete(pack); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); return false; } @@ -1107,17 +1107,17 @@ void Client::EnterWorld(bool TryBootup) { } else { if (TryBootup) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); autobootup_timeout.Start(); pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID); if (pwaitingforbootup == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); ZoneUnavail(); } return; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); ZoneUnavail(); return; } @@ -1126,12 +1126,12 @@ void Client::EnterWorld(bool TryBootup) { cle->SetChar(charid, char_name); database.UpdateLiveChar(char_name, GetAccountID()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); // database.SetAuthentication(account_id, char_name, zone_name, ip); if (seencharsel) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); ZoneUnavail(); return; } @@ -1169,9 +1169,9 @@ void Client::Clearance(int8 response) { if (zs == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); } ZoneUnavail(); @@ -1181,20 +1181,20 @@ void Client::Clearance(int8 response) EQApplicationPacket* outapp; if (zs->GetCAddress() == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); ZoneUnavail(); return; } if (zoneID == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } const char* zonename = database.GetZoneName(zoneID); if (zonename == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } @@ -1225,7 +1225,7 @@ void Client::Clearance(int8 response) } strcpy(zsi->ip, zs_addr); zsi->port =zs->GetCPort(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); QueuePacket(outapp); safe_delete(outapp); @@ -1256,7 +1256,7 @@ bool Client::GenPassKey(char* key) { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); _pkt(WORLD__CLIENT_TRACE, app); ack_req = true; // It's broke right now, dont delete this line till fix it. =P @@ -1355,27 +1355,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA, stats_sum); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); /* Validate the char creation struct */ if (ClientVersionBit & BIT_SoFAndLater) { if (!CheckCharCreateInfoSoF(cc)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } else { if (!CheckCharCreateInfoTitanium(cc)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } @@ -1437,21 +1437,21 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) /* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */ if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); pp.zone_id = RuleI(World, SoFStartZoneID); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); } else { /* if there's a startzone variable put them in there */ if (database.GetVariable("startzone", startzone, 50)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); pp.zone_id = database.GetZoneID(startzone); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); } else { /* otherwise use normal starting zone logic */ bool ValidStartZone = false; if (ClientVersionBit & BIT_TitaniumAndEarlier) @@ -1490,11 +1490,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) pp.binds[0].z = pp.z; pp.binds[0].heading = pp.heading; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z); /* Starting Items inventory */ @@ -1503,10 +1503,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) // now we give the pp and the inv we made to StoreCharacter // to see if we can store it if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); return false; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); return true; } @@ -1516,7 +1516,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) if (!cc) return false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); RaceClassCombos class_combo; bool found = false; @@ -1533,7 +1533,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); return false; } @@ -1550,7 +1550,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); return false; } @@ -1563,37 +1563,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) allocation.DefaultPointAllocation[6]; if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); return false; } if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); return false; } if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); return false; } if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); return false; } if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); return false; } if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); return false; } if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); return false; } @@ -1606,7 +1606,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) current_stats += cc->WIS - allocation.BaseStats[5]; current_stats += cc->CHA - allocation.BaseStats[6]; if (current_stats > max_stats) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); return false; } @@ -1687,7 +1687,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) if (!cc) return false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); classtemp = cc->class_ - 1; racetemp = cc->race - 1; @@ -1700,16 +1700,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // if out of range looking it up in the table would crash stuff // so we return from these if (classtemp >= PLAYER_CLASS_COUNT) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); return false; } if (racetemp >= _TABLE_RACES) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); return false; } if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs? - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); // we return from this one, since if it's an invalid combination our table // doesn't have meaningful values for the stats return false; @@ -1737,43 +1737,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // that are messed up not just the first hit if (bTOTAL + stat_points != cTOTAL) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); Charerrors++; } if (cc->STR > bSTR + stat_points || cc->STR < bSTR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); Charerrors++; } if (cc->STA > bSTA + stat_points || cc->STA < bSTA) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); Charerrors++; } if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); Charerrors++; } if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); Charerrors++; } if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); Charerrors++; } if (cc->INT > bINT + stat_points || cc->INT < bINT) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); Charerrors++; } if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); Charerrors++; } /*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of) I am NOT writing those tables - kathgar*/ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); return Charerrors == 0; } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index d66401810..1dc8f3eca 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) { int16 tmpStatus = WorldConfig::get()->DefaultStatus; paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID()); if (!paccountid) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); return false; } strn0cpy(paccountname, plsname, sizeof(paccountname)); diff --git a/world/clientlist.cpp b/world/clientlist.cpp index d8c536ca4..0d874b304 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -56,7 +56,7 @@ void ClientList::Process() { if (!iterator.GetData()->Process()) { struct in_addr in; in.s_addr = iterator.GetData()->GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); //the client destructor should take care of this. // iterator.GetData()->Free(); iterator.RemoveCurrent(); @@ -425,7 +425,7 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword) } int16 tmpadmin; - //logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login with '%s' and '%s'", iName, iPassword); + //Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login with '%s' and '%s'", iName, iPassword); uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin); if (accid) { @@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID) if(!from) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); return; } @@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S safe_delete(output); } catch(...){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); return; } } @@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon safe_delete(pack2); } catch(...){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); return; } } @@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) { iterator.Reset(); while(iterator.MoreElements()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); if (iterator.GetData()->GetAccountID() == account_id) { Client* tmp = iterator.GetData(); return tmp; @@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) { iterator.Reset(); while(iterator.MoreElements()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); if (iterator.GetData()->GetCharName() == charname) { Client* tmp = iterator.GetData(); return tmp; diff --git a/world/console.cpp b/world/console.cpp index f9a646d07..f1f4a7edf 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -88,7 +88,7 @@ void Console::Die() { state = CONSOLE_STATE_CLOSED; struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); tcpc->Disconnect(); } @@ -219,7 +219,7 @@ bool Console::Process() { if (!tcpc->Connected()) { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); return false; } //if we have not gotten the special markers after this timer, send login prompt @@ -234,7 +234,7 @@ bool Console::Process() { SendMessage(1, "Timeout, disconnecting..."); struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); return false; } @@ -243,29 +243,29 @@ bool Console::Process() { in.s_addr = GetIP(); if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) { auto zs = new ZoneServer(tcpc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); zoneserver_list.Add(zs); numzones++; tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); launcher_list.Add(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); UCSLink.SetConnection(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); QSLink.SetConnection(tcpc); tcpc = 0; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); } return false; } @@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) { state = CONSOLE_STATE_CLOSED; return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); SendMessage(1, 0); SendMessage(2, "Login accepted."); state = CONSOLE_STATE_CONNECTED; @@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) { break; } case CONSOLE_STATE_CONNECTED: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); Seperator sep(command); if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) { SendMessage(1, " whoami"); @@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) { tmpname[0] = '*'; strcpy(&tmpname[1], paccountname); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0)); } } @@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) { #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); } else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) { if (strcasecmp(sep.arg[1], "list") == 0) { diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 5707d43d7..80ec90f40 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() { std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); else { auto row = results.begin(); m_dynamics = atoi(row[0]); @@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() { query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); return; } @@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } @@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } @@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - logger.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - logger.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/eqw.cpp b/world/eqw.cpp index 677aed6f9..1c0b811ee 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -75,11 +75,11 @@ EQW::EQW() { void EQW::AppendOutput(const char *str) { m_outputBuffer += str; -// logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length()); +// Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length()); } const std::string &EQW::GetOutput() const { -// logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Getting, length %d", m_outputBuffer.length()); +// Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Getting, length %d", m_outputBuffer.length()); return(m_outputBuffer); } @@ -269,7 +269,7 @@ void EQW::LSReconnect() { pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index 06660b683..9737bca12 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const { int16 status = 0; uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status); if(acctid == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); return(false); } if(status < httpLoginStatus) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); return(false); } @@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP } void EQWHTTPServer::Stop() { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); m_running = false; Close(); } bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { if(m_running) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); return(false); } //load up our nice mime types if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); return(false); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); } //fire up the server thread char errbuf[TCPServer_ErrorBufferSize]; if(!Open(port, errbuf)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); return(false); } @@ -320,12 +320,12 @@ bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { /* void EQWHTTPServer::Run() { - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread started on port %d", m_port); + Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread started on port %d", m_port); do { #warning DELETE THIS IF YOU DONT USE IT Sleep(10); } while(m_running); - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread terminating on port %d", m_port); + Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread terminating on port %d", m_port); } ThreadReturnType EQWHTTPServer::ThreadProc(void *data) { diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index 09710cbff..f3f5dd50f 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -65,7 +65,7 @@ EQWParser::EQWParser() { my_perl = perl_alloc(); _empty_sv = newSV(0); if(!my_perl) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); else DoInit(); } @@ -182,10 +182,10 @@ void EQWParser::DoInit() { #ifdef EMBPERL_PLUGIN - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); std::string err; if(!eval_file("world", "worldui.pl", err)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); } eval_pv( diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 3baaabc92..8e1c65afe 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -79,7 +79,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -90,7 +90,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -100,7 +100,7 @@ bool LauncherLink::Process() { } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -114,25 +114,25 @@ bool LauncherLink::Process() { break; } case ServerOP_ZAAuth: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); break; } case ServerOP_LauncherConnectInfo: { const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer; if(HasName()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); break; } m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); if(config == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); std::vector result; //database.GetLauncherZones(it->name, result); @@ -146,7 +146,7 @@ bool LauncherLink::Process() { zs.port = cur->port; zs.up = false; zs.starts = 0; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); m_states[cur->name] = zs; } @@ -162,17 +162,17 @@ bool LauncherLink::Process() { std::map::iterator res; res = m_states.find(it->short_name); if(res == m_states.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); break; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); res->second.up = it->running; res->second.starts = it->start_count; break; } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) { zs.port = port; zs.up = false; zs.starts = 0; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); m_states[short_name] = zs; StartZone(short_name); diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 01dbbd4a7..56c9c38e1 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -60,7 +60,7 @@ void LauncherList::Process() { //printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); cur = m_pendingLaunchers.erase(cur); delete l; } else if(l->HasName()) { @@ -72,10 +72,10 @@ void LauncherList::Process() { std::map::iterator res; res = m_launchers.find(name); if(res != m_launchers.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); delete res->second; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); //put the launcher in the list. m_launchers[name] = l; } else { @@ -91,7 +91,7 @@ void LauncherList::Process() { //printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); curl = m_launchers.erase(curl); delete l; } else { @@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { void LauncherList::Add(EmuTCPConnection *conn) { auto it = new LauncherLink(nextID++, conn); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); m_pendingLaunchers.push_back(it); } diff --git a/world/login_server.cpp b/world/login_server.cpp index e526febfc..10b6e36c8 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -96,7 +96,7 @@ bool LoginServer::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { @@ -160,12 +160,12 @@ bool LoginServer::Process() { case ServerOP_LSFatalError: { #ifndef IGNORE_LS_FATAL_ERROR WorldConfig::DisableLoginserver(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); #else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); #endif if (pack->size > 1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); } break; } @@ -177,18 +177,18 @@ bool LoginServer::Process() { case ServerOP_LSRemoteAddr: { if (!Config->WorldAddress.length()) { WorldConfig::SetWorldAddress((char *)pack->pBuffer); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); } break; } case ServerOP_LSAccountUpdate: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); CanAccountUpdate = true; break; } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -202,10 +202,10 @@ bool LoginServer::Process() { bool LoginServer::InitLoginServer() { if(Connected() == false) { if(ConnectReady()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); Connect(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", LoginServerAddress,LoginServerPort); } } @@ -216,29 +216,29 @@ bool LoginServer::Connect() { char tmp[25]; if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){ minilogin = true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); } else minilogin = false; if (minilogin && WorldConfig::get()->WorldAddress.length()==0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); return false; } char errbuf[TCPConnection_ErrorBufferSize]; if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); return false; } if (LoginServerIP == 0 || LoginServerPort == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); return false; } if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); if (minilogin) SendInfo(); else @@ -248,7 +248,7 @@ bool LoginServer::Connect() { return true; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); return false; } } @@ -324,7 +324,7 @@ void LoginServer::SendStatus() { void LoginServer::SendAccountUpdate(ServerPacket* pack) { ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; if(CanUpdate()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); strn0cpy(s->worldaccount, LoginAccount, 30); strn0cpy(s->worldpassword, LoginPassword, 30); SendPacket(pack); diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index e74bc6a9a..1504badcc 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) { bool LoginServerList::SendAccountUpdate(ServerPacket* pack) { LinkedListIterator iterator(list); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); iterator.Reset(); while(iterator.MoreElements()){ if(iterator.GetData()->CanUpdate()) { diff --git a/world/net.cpp b/world/net.cpp index d3defb1a2..d6ea3259d 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -105,7 +105,7 @@ uint32 numclients = 0; uint32 numzones = 0; bool holdzones = false; -EQEmuLogSys logger; +EQEmuLogSys Log; extern ConsoleList console_list; @@ -113,7 +113,7 @@ void CatchSignal(int sig_num); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformWorld); - logger.LoadLogSettingsDefaults(); + Log.LoadLogSettingsDefaults(); set_exception_handler(); /* Database Version Check */ @@ -126,36 +126,36 @@ int main(int argc, char** argv) { } // Load server configuration - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #endif @@ -164,7 +164,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -172,19 +172,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -280,56 +280,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); database.LoadVariables(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); database.LoadZoneNames(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); database.ClearGroup(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); if (!database.LoadItems()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -338,45 +338,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -404,7 +404,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -417,19 +417,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -492,16 +492,16 @@ int main(int argc, char** argv) { } Sleep(20); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); console_list.KillAll(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); tcps.Close(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); eqsf.Close(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); CheckEQEMuErrorAndPause(); @@ -509,9 +509,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); RunLoops = false; } diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 66af57d53..b206dc961 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); Stream->Disconnect(); } @@ -57,7 +57,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -69,7 +69,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -79,7 +79,7 @@ bool QueryServConnection::Process() } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -97,7 +97,7 @@ bool QueryServConnection::Process() } case ServerOP_ZAAuth: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); break; } case ServerOP_QueryServGeneric: @@ -114,7 +114,7 @@ bool QueryServConnection::Process() } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/ucs.cpp b/world/ucs.cpp index 174b71b98..91ac8afba 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); Stream->Disconnect(); } @@ -52,7 +52,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -64,7 +64,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -74,7 +74,7 @@ bool UCSConnection::Process() } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -92,12 +92,12 @@ bool UCSConnection::Process() } case ServerOP_ZAAuth: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); break; } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index c97f29b7a..a4de9647d 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -34,7 +34,7 @@ WorldGuildManager guild_mgr; void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, } void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui } void WorldGuildManager::SendGuildDelete(uint32 guild_id) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!RefreshGuild(s->guild_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); //can we do anything? } @@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); //preform the local update client_list.UpdateClientGuild(s->char_id, s->guild_id); @@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!LocalDeleteGuild(s->guild_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); //can we do anything? } @@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildMemberUpdate: { if(pack->size != sizeof(ServerGuildMemberUpdate_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); return; } @@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { } default: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); break; } } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 5e14dcc59..72c90f494 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,11 +298,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - logger.Log(EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); + Log.Log(EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* } } else { - logger.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - logger.Log(EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); + Log.Log(EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru } } else { - logger.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector &rl) { const std::string query = "SELECT name FROM launcher"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); return; } @@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) { MailKeyString, CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); } @@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level) std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index 51962d16e..d1abf523a 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -79,7 +79,7 @@ void ZSList::KillAll() { void ZSList::Process() { if(shutdowntimer && shutdowntimer->Check()){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); auto pack2 = new ServerPacket; pack2->opcode = ServerOP_ShutdownAll; pack2->size=0; @@ -99,10 +99,10 @@ void ZSList::Process() { ZoneServer* zs = iterator.GetData(); struct in_addr in; in.s_addr = zs->GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); zs->LSShutDownUpdate(zs->GetZoneID()); if (holdzones){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); if(!zs->IsStaticZone()) RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID()); else @@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip s->port = port; s->zoneid = zoneid; if(zoneid != 0) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); tmp[z]->SendPacket(pack); delete pack; safe_delete_array(tmp); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 3cf75a90d..4a09a7b98 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -77,7 +77,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { char* longname; if (iZoneID) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, iStaticZone ? " (Static)" : ""); zoneID = iZoneID; @@ -188,7 +188,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -199,7 +199,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -209,7 +209,7 @@ bool ZoneServer::Process() { } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } } @@ -541,10 +541,10 @@ bool ZoneServer::Process() { RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer; if (zoneserver_list.SendPacket(pack)){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); } break; } @@ -589,10 +589,10 @@ bool ZoneServer::Process() { ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer; sci->port = clientport; SendPacket(&p); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); } else { clientport=sci->port; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); } } @@ -602,7 +602,7 @@ bool ZoneServer::Process() { const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer; launcher_name = ln->launcher_name; launched_name = ln->zone_name; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); break; } case ServerOP_ShutdownAll: { @@ -685,12 +685,12 @@ bool ZoneServer::Process() { if(WorldConfig::get()->UpdateStats) client = client_list.FindCharacter(ztz->name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", ztz->name, ztz->current_zone_id, ztz->requested_zone_id); /* This is a request from the egress zone */ if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) { ztz->response = 0; @@ -708,20 +708,20 @@ bool ZoneServer::Process() { /* Zone was already running*/ if(ingress_server) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); ztz->response = 1; } /* Boot the Zone*/ else { int server_id; if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); // bootup successful, ready to rock ztz->response = 1; ingress_server = zoneserver_list.FindByID(server_id); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); // bootup failed, send back error code 0 ztz->response = 0; } @@ -736,7 +736,7 @@ bool ZoneServer::Process() { /* Response from Ingress server, route back to egress */ else{ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); ZoneServer *egress_server = nullptr; if(ztz->current_instance_id > 0) { egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id); @@ -754,7 +754,7 @@ bool ZoneServer::Process() { } case ServerOP_ClientList: { if (pack->size != sizeof(ServerClientList_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); break; } client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer); @@ -763,7 +763,7 @@ bool ZoneServer::Process() { case ServerOP_ClientListKA: { ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer; if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); break; } client_list.CLEKeepAlive(sclka->numupdates, sclka->wid); @@ -868,7 +868,7 @@ bool ZoneServer::Process() { } case ServerOP_GMGoto: { if (pack->size != sizeof(ServerGMGoto_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); break; } ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer; @@ -888,7 +888,7 @@ bool ZoneServer::Process() { } case ServerOP_Lock: { if (pack->size != sizeof(ServerLock_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); break; } ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer; @@ -913,7 +913,7 @@ bool ZoneServer::Process() { } case ServerOP_Motd: { if (pack->size != sizeof(ServerMotd_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); break; } ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer; @@ -924,7 +924,7 @@ bool ZoneServer::Process() { } case ServerOP_Uptime: { if (pack->size != sizeof(ServerUptime_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); break; } ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer; @@ -943,7 +943,7 @@ bool ZoneServer::Process() { break; } case ServerOP_GetWorldTime: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); auto pack = new ServerPacket; pack->opcode = ServerOP_SyncWorldTime; @@ -958,17 +958,17 @@ bool ZoneServer::Process() { break; } case ServerOP_SetWorldTime: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str()); zoneserver_list.SendTimeSync(); break; } case ServerOP_IPLookup: { if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); break; } ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer; @@ -980,7 +980,7 @@ bool ZoneServer::Process() { } case ServerOP_LockZone: { if (pack->size < sizeof(ServerLockZone_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); break; } ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer; @@ -1025,10 +1025,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if (zs->SendPacket(pack)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } } break; @@ -1047,10 +1047,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(cle->instance()); if(zs) { if(zs->SendPacket(pack)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); } } else @@ -1067,10 +1067,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } } @@ -1079,10 +1079,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(cle->zone()); if(zs) { if(zs->SendPacket(pack)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); } } else { @@ -1098,10 +1098,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } } @@ -1119,10 +1119,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1138,10 +1138,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } else @@ -1149,10 +1149,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1254,7 +1254,7 @@ bool ZoneServer::Process() { case ServerOP_LSAccountUpdate: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); loginserverlist.SendAccountUpdate(pack); break; } @@ -1309,7 +1309,7 @@ bool ZoneServer::Process() { } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/zone/aa.cpp b/zone/aa.cpp index db28b2dc8..13ab491d6 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - logger.Log(EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); + Log.Log(EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); return; } @@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - logger.Log(EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); + Log.Log(EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - logger.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); + Log.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - logger.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); + Log.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -951,7 +951,7 @@ void Client::SendAAStats() { void Client::BuyAA(AA_Action* action) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); //find the AA information from the database SendAA_Struct* aa2 = zone->FindAA(action->ability); @@ -963,7 +963,7 @@ void Client::BuyAA(AA_Action* action) a = action->ability - i; if(a <= 0) break; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); aa2 = zone->FindAA(a); if(aa2 != nullptr) break; @@ -980,7 +980,7 @@ void Client::BuyAA(AA_Action* action) uint32 cur_level = GetAA(aa2->id); if((aa2->id + cur_level) != action->ability) { //got invalid AA - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); return; } @@ -1011,7 +1011,7 @@ void Client::BuyAA(AA_Action* action) if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); m_pp.aapoints -= real_cost; @@ -1429,10 +1429,10 @@ SendAA_Struct* Zone::FindAA(uint32 id) { } void Zone::LoadAAs() { - logger.Log(EQEmuLogSys::Status, "Loading AA information..."); + Log.Log(EQEmuLogSys::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - logger.Log(EQEmuLogSys::Error, "Failed to load AAs!"); + Log.Log(EQEmuLogSys::Error, "Failed to load AAs!"); aas = nullptr; return; } @@ -1447,11 +1447,11 @@ void Zone::LoadAAs() { } //load AA Effects into aa_effects - logger.Log(EQEmuLogSys::Status, "Loading AA Effects..."); + Log.Log(EQEmuLogSys::Status, "Loading AA Effects..."); if (database.LoadAAEffects2()) - logger.Log(EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); + Log.Log(EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); else - logger.Log(EQEmuLogSys::Error, "Failed to load AA Effects!"); + Log.Log(EQEmuLogSys::Error, "Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - logger.Log(EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); + Log.Log(EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); return false; } @@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 83a47a76e..c1f3d4ce3 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,17 +342,17 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); return( mod_will_aggro(mob, this) ); } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); return(false); } @@ -466,7 +466,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { //Father Nitwit: make sure we can see them. if(mob->CheckLosFN(sender)) { #if (EQDEBUG>=5) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); #endif mob->AddToHateList(attacker, 1, 0, false); @@ -693,7 +693,7 @@ type', in which case, the answer is yes. } while( reverse++ == 0 ); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); return false; } @@ -833,7 +833,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) } while( reverse++ == 0 ); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); return false; } @@ -945,7 +945,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; #if LOSDEBUG>=5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); #endif return zone->zonemap->CheckLoS(myloc, oloc); } diff --git a/zone/attack.cpp b/zone/attack.cpp index fdb95e467..ec696990c 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -57,7 +57,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); switch (item->ItemType) { @@ -187,7 +187,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC() && !attacker->IsPet()) chancetohit += RuleR(Combat, NPCBonusHitChance); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); bool pvpmode = false; if(IsClient() && other->IsClient()) @@ -208,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate the level difference - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); double level_difference = attacker_level - defender_level; double range = defender->GetLevel(); @@ -236,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); if(attacker->IsClient()) { chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse))); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); } if(defender->IsClient()) { chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); } //I dont think this is 100% correct, but at least it does something... if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->spellbonuses.MeleeSkillCheck; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->itembonuses.MeleeSkillCheck; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } //Avoidance Bonuses on defender decreases baseline hit chance by percent. @@ -308,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate final chance to hit chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker); @@ -327,7 +327,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); // @@ -336,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c float tohit_roll = zone->random.Real(0, 100); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); return(tohit_roll <= chancetohit); } @@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) { damage = -3; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac damage -= (myac * zone->random.Int(0, acrandom) / 10000); } if (damage<1) damage=1; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); } } @@ -1128,14 +1128,14 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } if(!GetTarget()) SetTarget(other); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( @@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b || (GetHP() < 0) || (!IsAttackAllowed(other)) ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); return false; // Only bards can attack while casting } if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b damage = mod_client_damage(damage, skillinuse, Hand, weapon, other); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); int hit_chance_bonus = 0; @@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it other->AvoidDamage(this, damage); @@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(damage > 0) CommonOutgoingHitSuccess(other, damage, skillinuse); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att } int exploss = 0; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); /* #1: Send death packet to everyone @@ -1692,7 +1692,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); RemoveFromHateList(other); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); } return false; } @@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); return false; } @@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); damage = (min_dmg+eleBane); } if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } @@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } if(other->IsClient() && other->CastToClient()->IsSitting()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); damage = (max_dmg+eleBane); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); @@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool hate += opts->hate_flat; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list other->AddToHateList(this, hate); @@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(damage > 0) { CommonOutgoingHitSuccess(other, damage, skillinuse); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list if(damage > 0) other->AddToHateList(this, hate); @@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); if(other->IsClient() && IsPet() && GetOwner()->IsClient()) { //pets do half damage to clients in pvp @@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //cant riposte a riposte if (bRiposte && damage == -3) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); return false; } @@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); parse->EventNPC(EVENT_ATTACK, this, other, "", 0); } attacked_timer.Start(CombatEventTimer_expire); @@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; if(killerMob) { @@ -2028,7 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if (IsEngaged()) { zone->DelAggroMob(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); } SetHP(0); SetPet(0); @@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { if(DS == 0 && rev_ds == 0) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); //invert DS... spells yield negative values for a true damage shield if(DS < 0) { @@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; if(rev_ds < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? } @@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage) int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; if(damage_to_reduce >= buffs[slot].melee_rune) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); damage -= damage_to_reduce; @@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage) if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); if (spellbonuses.MitigateMeleeRune[3]) @@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune); damage -= buffs[slot].magic_rune; if(!TryFadeEffect(slot)) @@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); if (spellbonuses.MitigateSpellRune[3]) @@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == SkillAbjuration); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); if (GetInvul() || DivineAura()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } @@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int healed = damage; healed = attacker->GetActSpellHealing(spell_id, healed); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); attacker->HealDamage(healed); //we used to do a message to the client, but its gone now. @@ -3506,7 +3506,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse()) { if (!pet->IsHeld()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1); pet->SetTarget(attacker); Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); @@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //see if any runes want to reduce this damage if(spell_id == SPELL_UNKNOWN) { damage = ReduceDamage(damage); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); damage = ReduceAllDamage(damage); TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); } else { @@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //fade mez if we are mezzed if (IsMezzed() && attacker) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); @@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int stun_resist = itembonuses.StunResist + spellbonuses.StunResist; int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); if (IsClient()) { stun_resist += aabonuses.StunResist; frontal_stun_resist += aabonuses.FrontalStunResist; @@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (((GetBaseRace() == OGRE && IsClient()) || (frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); } else { // Normal stun resist check. if (stun_resist && zone->random.Roll(stun_resist)) { if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds } } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); } } @@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //increment chances of interrupting if(IsCasting()) { //shouldnt interrupt on regular spell damage attacked_count++; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); } } @@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) ProcChance += ProcChance * ProcBonus / 100.0f; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h ProcBonus += static_cast(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f; ProcChance = ProcChance + (ProcChance * ProcBonus); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3887,7 +3887,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3918,17 +3918,17 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } if (!IsAttackAllowed(on)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); return; } if (DivineAura()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); return; } @@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on static_cast(weapon->ProcRate)) / 100.0f; if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really. if (weapon->Proc.Level > ourlevel) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); if (IsPet()) { @@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on Message_StringID(13, PROC_TOOLOW); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100); ExecWeaponProc(inst, weapon->Proc.Effect, on); @@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, // Perma procs (AAs) if (PermaProcs[i].spellID != SPELL_UNKNOWN) { if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus? - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d procing spell %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); ExecWeaponProc(nullptr, PermaProcs[i].spellID, on); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d failed to proc %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); } @@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (SpellProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(SpellProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d procing spell %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d failed to proc %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); } @@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (RangedProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(RangedProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d procing spell %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d failed to proc %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); } @@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Mob::DoRiposte(Mob* defender) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) { //Live AA - Double Riposte if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); if (HasDied()) return; } @@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) { DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); if (defender->GetClass() == MONK) defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); @@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); damage += (damage*dmgbonusmod/10000); } } @@ -4467,7 +4467,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } @@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { if (!TryFadeEffect(spellbonuses.Root[1])) { BuffFadeBySlot(spellbonuses.Root[1]); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); return true; } } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); return false; } @@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible() { //break invis when you attack if(invisible) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 423f7742a..fde1dacc8 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -77,9 +77,9 @@ void Client::CalcBonuses() CalcSpellBonuses(&spellbonuses); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); CalcAABonuses(&aabonuses); //we're not quite ready for this - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); RecalcWeight(); @@ -634,7 +634,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) diff --git a/zone/bot.cpp b/zone/bot.cpp index 4cf6325b2..111d52675 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - logger.Log(EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + Log.Log(EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); + Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); return; } @@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadStance()"); + Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in Bot::SaveStance()"); + Log.Log(EQEmuLogSys::Error, "Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); + Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - logger.Log(EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); + Log.Log(EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); } @@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) { if(!RangeWeapon || !Ammo) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); if(!IsAttackAllowed(other) || IsCasting() || @@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) { //break invis when you attack if(invisible) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -3362,7 +3362,7 @@ void Bot::AI_Process() { else if(!IsRooted()) { if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed()); SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY())); return; @@ -3689,7 +3689,7 @@ void Bot::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -3972,7 +3972,7 @@ void Bot::PetAIProcess() { { botPet->SetRunAnimSpeed(0); if(!botPet->IsRooted()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed()); return; } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - logger.Log(EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + Log.Log(EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - logger.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); parse->EventNPC(EVENT_ATTACK, this, from, "", 0); } @@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ // if spell is lifetap add hp to the caster if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) { int healed = GetActSpellHealing(spell_id, damage); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } @@ -6017,14 +6017,14 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } if(!GetTarget() || GetTarget() != other) SetTarget(other); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || other == nullptr || @@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName()); if(other) { RemoveFromHateList(other); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); } return false; } if(DivineAura()) {//cant attack while invulnerable - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); return false; } @@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(berserk && (GetClass() == BERSERKER)){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b else damage = zone->random.Int(min_hit, max_hit); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel()); if(opts) { @@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(other, skillinuse, Hand)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; other->AddToHateList(this, 0); } else { //we hit, try to avoid it @@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b ApplyMeleeDamageBonus(skillinuse, damage); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); TryCriticalHit(other, skillinuse, damage, opts); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); // now add done damage to the hate list //other->AddToHateList(this, hate); } else other->AddToHateList(this, 0); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //break invis when you attack if(invisible) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; default: - logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -7335,7 +7335,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); } } //Check for spell skill limits. @@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { ProcChance += ProcChance*ProcBonus / 100.0f; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) { damage = -3; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) uint16 levelreq = aabonuses.FinishingBlowLvl[0]; if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse); return true; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); return false; } } @@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Bot::DoRiposte(Mob* defender) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) { defender->GetItemBonuses().GiveDoubleRiposte[0]; if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); } @@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f); float DefenderChance = (float)zone->random.Real(0.00f, 1.00f); if(AttackerChance > DefenderChance) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); // WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW //entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName()); @@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { Result = true; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); } } } @@ -8441,11 +8441,11 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { return; } - // logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); + // Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER); - //logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID(); + //Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID(); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -8548,7 +8548,7 @@ int32 Bot::CalcMaxMana() { } default: { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(GetClass() != BARD) { if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t //cannot cast under deivne aura if(DivineAura()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t } if (HasActiveSong()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client //_StopSong(); bardsong = 0; @@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(caster->IsBot()) { if(spells[spell_id].targettype == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); return true; } } @@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3) ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); return true; } } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); } } @@ -15454,7 +15454,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 5ee57305b..cb2b2f4cd 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -950,7 +950,7 @@ bool Bot::AI_PursueCastCheck() { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) { if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) { @@ -1055,7 +1055,7 @@ bool Bot::AI_EngagedCastCheck() { BotStanceType botStance = GetBotStance(); bool mayGetAggro = HasOrMayGetAggro(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); if(botClass == CLERIC) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { diff --git a/zone/client.cpp b/zone/client.cpp index cef327e77..7c993f337 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -340,7 +340,7 @@ Client::~Client() { ToggleBuyerMode(false); if(conn_state != ClientConnectFinished) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); ReportConnectingState(); } @@ -438,31 +438,31 @@ void Client::SendLogoutPackets() { void Client::ReportConnectingState() { switch(conn_state) { case NoPacketsReceived: //havent gotten anything - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); break; case ReceivedZoneEntry: //got the first packet, loading up PP - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); break; case PlayerProfileLoaded: //our DB work is done, sending it - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); break; case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); break; case NewZoneRequested: //received and sent new zone request - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); break; case ClientSpawnRequested: //client sent ReqClientSpawn - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); break; case ZoneContentsSent: //objects, doors, zone points - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); break; case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); break; case ClientConnectFinished: //client finally moved to finished state, were done here - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); break; }; } @@ -650,7 +650,7 @@ bool Client::SendAllPackets() { if(eqs) eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); - logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); + Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); } return true; } @@ -698,7 +698,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s char message[4096]; strn0cpy(message, orig_message, sizeof(message)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); if (targetname == nullptr) { targetname = (!GetTarget()) ? "" : GetTarget()->GetName(); @@ -1506,7 +1506,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); + Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); @@ -1911,7 +1911,7 @@ void Client::ReadBook(BookRequest_Struct *book) { if (booktxt2[0] != '\0') { #if EQDEBUG >= 6 - logger.Log(EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); + Log.Log(EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); #endif EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct)); @@ -2105,7 +2105,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ SaveCurrency(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); } void Client::EVENT_ITEM_ScriptStopReturn(){ @@ -2145,7 +2145,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat SaveCurrency(); #if (EQDEBUG>=5) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); #endif } @@ -2235,13 +2235,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha if(zone->random.Real(0, 99) < Chance) { SetSkill(skillid, GetRawSkill(skillid) + 1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); return true; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); } return false; } @@ -2262,10 +2262,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) { if(zone->random.Real(0,100) < Chance) { // if they make the roll IncreaseLanguageSkill(langid); // increase the language skill by 1 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); } else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); } } @@ -2364,7 +2364,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 Save(); - logger.Log(EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " + Log.Log(EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " "Too many specializations skills were above 50.", GetCleanName()); } @@ -4544,14 +4544,14 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetClass() != LDON_TREASURE) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", GetName(), target->GetName(), target->GetName()); return; } if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); Message(13, "Treasure chest out of range."); return; @@ -5294,7 +5294,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5362,7 +5362,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5389,7 +5389,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5397,7 +5397,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6211,7 +6211,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - logger.Log(EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); + Log.Log(EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6225,7 +6225,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - logger.Log(EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); + Log.Log(EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -8149,7 +8149,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); #endif } else @@ -8166,7 +8166,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); #endif } } @@ -8289,11 +8289,11 @@ std::string Client::TextLink::GenerateLink() if ((m_Link.length() == 0) || (m_Link.length() > 250)) { m_Error = true; m_Link = ""; - logger.Log(EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", + Log.Log(EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length()); #if EQDEBUG >= 5 - logger.Log(EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); - logger.Log(EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); + Log.Log(EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); + Log.Log(EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); #endif } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index feaa0d18a..5d4221305 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - logger.Log(EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + Log.Log(EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; @@ -935,7 +935,7 @@ int32 Client::CalcMaxMana() break; } default: { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -956,7 +956,7 @@ int32 Client::CalcMaxMana() } #if EQDEBUG >= 11 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1046,14 +1046,14 @@ int32 Client::CalcBaseMana() break; } default: { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_m = 0; break; } } #if EQDEBUG >= 11 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); #endif return max_m; } @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 691681347..a39ad8fa2 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -401,7 +401,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) if(is_log_enabled(CLIENT__NET_IN_TRACE)) { char buffer[64]; app->build_header_dump(buffer); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); } EmuOpcode opcode = app->GetOpcode(); @@ -416,7 +416,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) #ifdef SOLAR if(0 && opcode != OP_ClientUpdate) { - logger.LogDebug(EQEmuLogSys::General,"HandlePacket() OPCODE debug enabled client %s", GetName()); + Log.LogDebug(EQEmuLogSys::General,"HandlePacket() OPCODE debug enabled client %s", GetName()); std::cerr << "OPCODE: " << std::hex << std::setw(4) << std::setfill('0') << opcode << std::dec << ", size: " << app->size << std::endl; DumpPacket(app); } @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - logger.Log(EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + Log.Log(EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -460,8 +460,8 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); char buffer[64]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); - if (logger.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); + if (Log.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ app->build_header_dump(buffer); if (app->size < 1000) DumpPacket(app, app->size); @@ -483,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_LINKDEAD: break; default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); break; } @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. if (!CanBeInZone()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); GoToSafeCoords(database.GetZoneID("arena"), 0); return; } @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - logger.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); - logger.Log(EQEmuLogSys::Error, "Error message: %s", error->message); + Log.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.Log(EQEmuLogSys::Error, "Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); + Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1317,14 +1317,14 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) ClientVersionBit = 0; bool siv = m_inv.SetInventoryVersion(ClientVersion); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); /* Antighost code tmp var is so the search doesnt find this object */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - logger.Log(EQEmuLogSys::Error, "GetAuth() returned false kicking client"); + Log.Log(EQEmuLogSys::Error, "GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1340,7 +1340,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) struct in_addr ghost_addr; ghost_addr.s_addr = eqs->GetRemoteIP(); - logger.Log(EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", + Log.Log(EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", client->AccountID(), client->AccountName(), client->GetName(), inet_ntoa(ghost_addr)); client->Save(); client->Disconnect(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - logger.Log(EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + Log.Log(EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1899,7 +1899,7 @@ void Client::Handle_0x0193(const EQApplicationPacket *app) void Client::Handle_OP_AAAction(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); if (app->size != sizeof(AA_Action)){ printf("Error! OP_AAAction size didnt match!\n"); @@ -1908,7 +1908,7 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) AA_Action* action = (AA_Action*)app->pBuffer; if (action->action == aaActionActivate) {//AA Hotkey - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); ActivateAA((aaID)action->ability); } else if (action->action == aaActionBuy) { @@ -1940,7 +1940,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) { if (app->size != sizeof(AcceptNewTask_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", sizeof(AcceptNewTask_Struct), app->size); DumpPacket(app); return; @@ -1955,7 +1955,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - logger.Log(EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); + Log.Log(EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2010,7 +2010,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2190,7 +2190,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2280,7 +2280,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Sell_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", app->size, sizeof(Adventure_Sell_Struct)); DumpPacket(app); return; @@ -2412,7 +2412,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); + Log.Log(EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2938,7 +2938,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized " + Log.Log(EQEmuLogSys::Error, "Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2957,7 +2957,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -2971,7 +2971,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (!IsPoison) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " "after casting, or is not a poison!", ApplyPoisonData->inventorySlot); Message(0, "Error: item not found for inventory slot #%i or is not a poison", ApplyPoisonData->inventorySlot); @@ -2994,7 +2994,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); } } @@ -3009,7 +3009,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); return; } @@ -3039,7 +3039,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); return; } QueuePacket(app); @@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) if (app->size != sizeof(AugmentInfo_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); DumpPacket(app); return; @@ -3071,7 +3071,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3228,7 +3228,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3295,7 +3295,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) { if (app->size != sizeof(bool)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); DumpPacket(app); return; } @@ -3311,7 +3311,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) // Although there are three different structs for OP_Bandolier, they are all the same size. // if (app->size != sizeof(BandolierCreate_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", sizeof(BandolierCreate_Struct), app->size); DumpPacket(app); return; @@ -3330,7 +3330,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) SetBandolier(app); break; default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); } } @@ -3339,7 +3339,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) { if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); DumpPacket(app); return; } @@ -3424,7 +3424,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) if (app->size < 4) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); DumpPacket(app); return; } @@ -3572,7 +3572,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) default: Message(13, "Unrecognised Barter action."); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); } } @@ -3580,7 +3580,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3635,8 +3635,8 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - logger.Log(EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); + Log.Log(EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3721,16 +3721,16 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - logger.Log(EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); + Log.Log(EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - logger.Log(EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); + Log.Log(EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } return; @@ -3743,7 +3743,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -3838,7 +3838,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - logger.Log(EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + Log.Log(EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3859,14 +3859,14 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - logger.Log(EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*)app->pBuffer; uint32 spid = sbf->spellid; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and @@ -3941,7 +3941,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTask_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", sizeof(CancelTask_Struct), app->size); DumpPacket(app); return; @@ -3955,7 +3955,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4006,16 +4006,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) targetring_z = castspell->z_pos; #ifdef _EQDEBUG - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); #endif - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; @@ -4047,7 +4047,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) //discipline, using the item spell slot if (castspell->inventoryslot == INVALID_INDEX) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); InterruptSpell(castspell->spell_id); } return; @@ -4190,7 +4190,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app) if (app->size != 1) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); DumpPacket(app); @@ -4212,7 +4212,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app) if (app->size != 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", app->size); DumpPacket(app); @@ -4234,7 +4234,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4259,7 +4259,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4310,7 +4310,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4323,11 +4323,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - logger.Log(EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); + Log.Log(EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - logger.Log(EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); + Log.Log(EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4344,8 +4344,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - logger.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); - logger.Log(EQEmuLogSys::Error, "Error message:%s", error->message); + Log.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.Log(EQEmuLogSys::Error, "Error message:%s", error->message); return; } @@ -4366,7 +4366,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4718,7 +4718,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4812,7 +4812,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4872,7 +4872,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4909,7 +4909,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - logger.Log(EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); + Log.Log(EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -4921,7 +4921,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - logger.Log(EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); + Log.Log(EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4942,7 +4942,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5098,7 +5098,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, + Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5136,7 +5136,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app) if (app->size != sizeof(DelegateAbility_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", sizeof(DelegateAbility_Struct), app->size); DumpPacket(app); @@ -5311,7 +5311,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", sizeof(DoGroupLeadershipAbility_Struct), app->size); DumpPacket(app); @@ -5363,7 +5363,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) } default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", dglas->Ability, dglas->Parameter); break; } @@ -5445,7 +5445,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized " + Log.Log(EQEmuLogSys::Error, "Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5536,7 +5536,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5591,7 +5591,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5832,7 +5832,7 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); SendGuildMOTD(true); @@ -5845,7 +5845,7 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); SendGuildList(); } @@ -5858,7 +5858,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5910,7 +5910,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5927,7 +5927,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainEnd_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); DumpPacket(app); return; } @@ -5943,7 +5943,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6008,7 +6008,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6058,7 +6058,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6125,7 +6125,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6135,7 +6135,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) return; } Client* client = entity_list.GetClientByName(gmn->oldname); - logger.Log(EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + Log.Log(EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(13, "%s not found for name change. Operation failed!", gmn->oldname); @@ -6177,7 +6177,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) if (app->size < sizeof(GMSearchCorpse_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", app->size, sizeof(GMSearchCorpse_Struct)); DumpPacket(app); return; @@ -6300,7 +6300,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainee_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); DumpPacket(app); return; } @@ -6311,7 +6311,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) { if (app->size != sizeof(GMSkillChange_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); DumpPacket(app); return; } @@ -6379,7 +6379,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6396,7 +6396,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6440,12 +6440,12 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; @@ -6587,7 +6587,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - logger.Log(EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + Log.Log(EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6607,7 +6607,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6656,7 +6656,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6725,7 +6725,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) if (g->IsLeader(this)) g->ChangeLeader(NewLeader); else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6734,7 +6734,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6770,7 +6770,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6816,7 +6816,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(GroupUpdate_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", app->size, sizeof(GroupUpdate_Struct)); DumpPacket(app); return; @@ -6835,7 +6835,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) if (group->IsLeader(this)) group->ChangeLeader(newleader); else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6844,7 +6844,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) default: { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); DumpPacket(app); return; } @@ -6864,7 +6864,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -6889,7 +6889,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if ((Action != GuildBankDeposit) && (Action != GuildBankViewItem) && (Action != GuildBankWithdraw)) { - logger.Log(EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); + Log.Log(EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); GuildBankAck(); @@ -7050,7 +7050,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsGuildBanker() && !GuildBanks->AllowedToWithdraw(GuildID(), gbwis->Area, gbwis->SlotID, GetName())) { - logger.Log(EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); + Log.Log(EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); GuildBankAck(); @@ -7121,7 +7121,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "Unexpected GuildBank action."); - logger.Log(EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); + Log.Log(EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } } } @@ -7192,7 +7192,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) @@ -7214,12 +7214,12 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.DeleteGuild(GuildID())) Message(0, "Guild delete failed."); else { @@ -7230,10 +7230,10 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); if (app->size != sizeof(GuildDemoteStruct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); return; } @@ -7263,7 +7263,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) uint8 rank = gci.rank - 1; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", demote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7281,7 +7281,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7322,7 +7322,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) //we could send this to the member and prompt them to see if they want to //be demoted (I guess), but I dont see a point in that. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7341,7 +7341,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7353,7 +7353,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); client->QueuePacket(app); } @@ -7376,7 +7376,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7386,7 +7386,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); client->SetPendingGuildInvitation(true); client->QueuePacket(app); @@ -7409,7 +7409,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); SetPendingGuildInvitation(false); @@ -7445,7 +7445,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) else if (!worldserver.Connected()) Message(0, "Error: World server disconnected"); else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", gj->guildeqid, gj->response, gj->inviter, gj->newmember); //we dont really care a lot about what this packet means, as long as @@ -7459,7 +7459,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) if (gj->guildeqid == GuildID()) { //only need to change rank. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), gj->response, guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7471,7 +7471,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", GetName(), CharacterID(), guild_mgr.GetGuildName(gj->guildeqid), gj->guildeqid, gj->response); @@ -7500,10 +7500,10 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); if (app->size < 2) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); return; } @@ -7522,7 +7522,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) Client* newleader = entity_list.GetClientByName(gml->target); if (newleader) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID(), newleader->GetName(), newleader->CharacterID()); @@ -7543,9 +7543,9 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); if (app->size != sizeof(GuildManageBanker_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); return; } GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer; @@ -7620,16 +7620,16 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); return; } void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); if (app->size != sizeof(GuildPromoteStruct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); return; } @@ -7658,7 +7658,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", promote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7675,7 +7675,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); if (app->size < sizeof(GuildUpdate_PublicNote)) { // client calls for a motd on login even if they arent in a guild @@ -7694,7 +7694,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", gpn->target, gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID(), gpn->note); @@ -7711,7 +7711,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7741,7 +7741,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = client->CharacterID(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7757,7 +7757,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = gci.char_id; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", gci.char_name.c_str(), gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7782,7 +7782,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) { if (app->size != sizeof(GuildStatus_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", sizeof(GuildStatus_Struct), app->size); DumpPacket(app); @@ -7839,7 +7839,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) { if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", sizeof(GuildUpdateURLAndChannel_Struct), app->size); DumpPacket(app); @@ -7867,7 +7867,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) void Client::Handle_OP_GuildWar(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); return; } @@ -7943,7 +7943,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app) // if (app->size != sizeof(HideCorpse_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", sizeof(HideCorpse_Struct), app->size); DumpPacket(app); @@ -7972,7 +7972,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, + Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8002,7 +8002,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8057,7 +8057,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8071,7 +8071,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8108,7 +8108,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - logger.Log(EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8208,7 +8208,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8223,7 +8223,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8421,7 +8421,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8449,7 +8449,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (slot_id < 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); return; } @@ -8492,7 +8492,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check { @@ -8530,7 +8530,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); } else if (inst->IsType(ItemClassCommon)) { @@ -8603,7 +8603,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } else { @@ -8619,7 +8619,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) else if (item->ItemType == ItemTypeAlcohol) { #if EQDEBUG >= 1 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } } } @@ -8787,7 +8787,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) { if (app->size != 1) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -8874,7 +8874,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9034,7 +9034,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9071,7 +9071,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - logger.Log(EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); + Log.Log(EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9096,7 +9096,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); SendLogoutPackets(); @@ -9150,7 +9150,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9327,7 +9327,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) if (app->size != sizeof(MercenaryCommand_Struct)) { Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; } @@ -9384,7 +9384,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); DumpPacket(app); @@ -9519,7 +9519,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app if (app->size != 0) { Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9539,7 +9539,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9564,7 +9564,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID) if (app->size != sizeof(MercenaryMerchantRequest_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); DumpPacket(app); @@ -9636,7 +9636,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) if (app->size != sizeof(SuspendMercenary_Struct)) { Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; } @@ -9660,7 +9660,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9698,7 +9698,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - logger.Log(EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9714,7 +9714,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9797,7 +9797,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9829,7 +9829,7 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9856,7 +9856,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9869,7 +9869,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10332,7 +10332,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10376,7 +10376,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10446,7 +10446,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - logger.Log(EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); + Log.Log(EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10516,7 +10516,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) { if (app->size != sizeof(PopupResponse_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", sizeof(PopupResponse_Struct), app->size); DumpPacket(app); return; @@ -10551,7 +10551,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) { if (app->size != sizeof(MovePotionToBelt_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", sizeof(MovePotionToBelt_Struct), app->size); DumpPacket(app); return; @@ -10559,7 +10559,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); return; } @@ -10582,7 +10582,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -10672,7 +10672,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a // if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); DumpPacket(app); @@ -10699,7 +10699,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) // if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", sizeof(PVPLeaderBoardRequest_Struct), app->size); DumpPacket(app); @@ -10720,7 +10720,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11305,7 +11305,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11334,7 +11334,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11350,7 +11350,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11364,7 +11364,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11378,14 +11378,14 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); // results show that object_type is combiner type // some_id = 0 if world combiner, item number otherwise @@ -11437,7 +11437,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11446,7 +11446,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) rss->query[55] = '\0'; //just to be sure. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); // make where clause segment for container(s) char containers[30]; @@ -11506,7 +11506,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -11669,7 +11669,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) // if (app->size != 4) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", 4, app->size); DumpPacket(app); return; @@ -11697,7 +11697,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); @@ -11720,14 +11720,14 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) { if (app->size != sizeof(Sacrifice_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); DumpPacket(app); return; } Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - logger.Log(EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); + Log.Log(EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11765,13 +11765,13 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11848,7 +11848,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); if (app->size != sizeof(GuildMOTD_Struct)) { // client calls for a motd on login even if they arent in a guild @@ -11866,7 +11866,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) GuildMOTD_Struct* gmotd = (GuildMOTD_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", guild_mgr.GetGuildName(GuildID()), GuildID(), GetName(), gmotd->motd); if (!guild_mgr.SetGuildMOTD(GuildID(), gmotd->motd, GetName())) { @@ -11884,7 +11884,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received invalid sized " + Log.Log(EQEmuLogSys::Error, "Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11918,7 +11918,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); + Log.Log(EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); return; } @@ -11969,7 +11969,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) { if (app->size != sizeof(SetTitle_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); DumpPacket(app); return; } @@ -11993,7 +11993,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12090,7 +12090,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12098,7 +12098,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) t1.start(); Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; #if EQDEBUG >= 5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); DumpPacket(app); #endif @@ -12258,7 +12258,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - logger.Log(EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + Log.Log(EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12348,7 +12348,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12504,7 +12504,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12797,7 +12797,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12834,7 +12834,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) { if (app->size != sizeof(Surname_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); return; } @@ -12924,7 +12924,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - logger.Log(EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + Log.Log(EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13149,7 +13149,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TaskHistoryRequest_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", sizeof(TaskHistoryRequest_Struct), app->size); DumpPacket(app); return; @@ -13202,7 +13202,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - logger.Log(EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); + Log.Log(EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); return; } @@ -13216,7 +13216,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13369,7 +13369,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13417,7 +13417,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (c) c->WithCustomer(0); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); break; } @@ -13426,7 +13426,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) break; } default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); break; } } @@ -13512,10 +13512,10 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - logger.Log(EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); + Log.Log(EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13524,8 +13524,8 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) HandleTraderPriceUpdate(app); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); - logger.Log(EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); + Log.Log(EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13550,11 +13550,11 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) BuyTraderItem(tbs, Trader, app); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); } return; @@ -13563,7 +13563,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13599,7 +13599,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13628,7 +13628,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (app->size != sizeof(TraderClick_Struct)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); return; } @@ -13642,7 +13642,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (Customer) outtcs->Approval = Customer->WithCustomer(GetID()); else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" " returned a nullptr pointer"); return; } @@ -13670,7 +13670,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - logger.Log(EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + Log.Log(EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13691,7 +13691,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if (app->size != sizeof(Translocate_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); DumpPacket(app); return; } @@ -13739,7 +13739,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates an item... @@ -13758,7 +13758,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13768,7 +13768,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates money @@ -13787,7 +13787,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13797,7 +13797,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); _pkt(TRIBUTE__IN, app); return; @@ -13805,11 +13805,11 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13819,12 +13819,12 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - logger.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); + Log.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); @@ -13836,7 +13836,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } @@ -13876,7 +13876,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app) if (app->size != sizeof(VoiceMacroIn_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", sizeof(VoiceMacroIn_Struct), app->size); DumpPacket(app); @@ -13927,7 +13927,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app) { if (app->size != 1) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); DumpPacket(app); return; } @@ -13939,7 +13939,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) { if (app->size < 12) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); DumpPacket(app); return; } @@ -14162,7 +14162,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) } default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index e66fbaaeb..fc52e5724 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -799,7 +799,7 @@ void Client::OnDisconnect(bool hard_disconnect) { Mob *Other = trade->With(); if(Other) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); FinishTrade(this); if(Other->IsClient()) @@ -836,7 +836,7 @@ void Client::BulkSendInventoryItems() { if(inst) { bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -1037,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { // Account for merchant lists with gaps. if (ml.slot >= i) { if (ml.slot > i) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); i = ml.slot + 1; } } @@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ Client* c = entity_list.GetClientByID(CustomerID); if(!c) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); CustomerID = NewCustomer; return 1; } @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) { if(app->size != sizeof(MemorizeSpell_Struct)) { - logger.Log(EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); + Log.Log(EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); DumpPacket(app); return; } @@ -1723,12 +1723,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id; if(!CanHaveSkill(skill)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); return; } if(MaxSkill(skill) == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); return; } @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/command.cpp b/zone/command.cpp index 66fc57106..2e8ecc8f8 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -443,13 +443,13 @@ int command_init(void) { if ((itr=command_settings.find(cur->first))!=command_settings.end()) { cur->second->access = itr->second; - logger.Log(EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); + Log.Log(EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); } else { #ifdef COMMANDS_WARNINGS if(cur->second->access == 0) - logger.Log(EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); + Log.Log(EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); #endif } } @@ -494,7 +494,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - logger.Log(EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + Log.Log(EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -568,12 +568,12 @@ int command_realdispatch(Client *c, const char *message) #ifdef COMMANDS_LOGGING if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - logger.Log(EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + Log.Log(EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } #endif if(cur->function == nullptr) { - logger.Log(EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); + Log.Log(EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command @@ -1292,7 +1292,7 @@ void command_viewpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - logger.Log(EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); + Log.Log(EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1317,7 +1317,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) if (!results.Success()) return; - logger.Log(EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.Log(EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1343,7 +1343,7 @@ void command_delpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - logger.Log(EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.Log(EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); } @@ -1566,7 +1566,7 @@ void command_permaclass(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Log(EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); t->Kick(); @@ -1588,7 +1588,7 @@ void command_permarace(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's race - zone to take effect",t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Log(EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); t->SetBaseGender(tmp); @@ -1612,7 +1612,7 @@ void command_permagender(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's gender - zone to take effect",t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Log(EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); t->SendIllusionPacket(atoi(sep->arg[1])); @@ -1954,7 +1954,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) { - logger.Log(EQEmuLogSys::Normal, "Spawning database spawn"); + Log.Log(EQEmuLogSys::Normal, "Spawning database spawn"); uint16 cond = 0; int16 cond_min = 0; if(sep->IsNumber(4)) { @@ -2274,7 +2274,7 @@ void command_setlanguage(Client *c, const Seperator *sep) } else { - logger.Log(EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.Log(EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); uint8 langid = (uint8)atoi(sep->arg[1]); uint8 value = (uint8)atoi(sep->arg[2]); c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value ); @@ -2299,7 +2299,7 @@ void command_setskill(Client *c, const Seperator *sep) c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { - logger.Log(EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.Log(EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); int skill_num = atoi(sep->arg[1]); uint16 skill_value = atoi(sep->arg[2]); if(skill_num < HIGHEST_SKILL) @@ -2319,7 +2319,7 @@ void command_setskillall(Client *c, const Seperator *sep) } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { - logger.Log(EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); + Log.Log(EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); uint16 level = atoi(sep->arg[1]); for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) { c->GetTarget()->CastToClient()->SetSkill(skill_num, level); @@ -2409,7 +2409,7 @@ void command_spawn(Client *c, const Seperator *sep) } } #if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General,"#spawn Spawning:"); + Log.LogDebug(EQEmuLogSys::General,"#spawn Spawning:"); #endif NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c); @@ -3114,7 +3114,7 @@ void command_listpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - logger.Log(EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); + Log.Log(EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); if (results.RowCount() == 0) return; @@ -3771,7 +3771,7 @@ void command_lastname(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - logger.Log(EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); + Log.Log(EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); @@ -4394,7 +4394,7 @@ void command_time(Client *c, const Seperator *sep) ); c->Message(13, "It is now %s.", timeMessage); #if EQDEBUG >= 11 - logger.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage); + Log.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage); #endif } } @@ -4545,10 +4545,10 @@ void command_guild(Client *c, const Seperator *sep) } if(guild_id == GUILD_NONE) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id); } @@ -4597,7 +4597,7 @@ void command_guild(Client *c, const Seperator *sep) return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) @@ -4639,7 +4639,7 @@ void command_guild(Client *c, const Seperator *sep) uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) @@ -4678,7 +4678,7 @@ void command_guild(Client *c, const Seperator *sep) } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) @@ -4712,7 +4712,7 @@ void command_guild(Client *c, const Seperator *sep) } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) @@ -4763,7 +4763,7 @@ void command_guild(Client *c, const Seperator *sep) } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) @@ -4869,7 +4869,7 @@ void command_manaburn(Client *c, const Seperator *sep) target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/); c->Message(4,"You unleash an enormous blast of magical energies."); } - logger.Log(EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); + Log.Log(EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); } } else @@ -5221,7 +5221,7 @@ void command_scribespells(Client *c, const Seperator *sep) t->Message(0, "Scribing spells to spellbook."); if(t != c) c->Message(0, "Scribing spells for %s.", t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.Log(EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot)) { @@ -5278,7 +5278,7 @@ void command_scribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.Log(EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) { book_slot = t->GetNextAvailableSpellBookSlot(); @@ -5325,7 +5325,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.Log(EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); @@ -7862,7 +7862,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->Message(0, "Training disciplines"); if(t != c) c->Message(0, "Training disciplines for %s.", t->GetName()); - logger.Log(EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.Log(EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++) { @@ -10394,7 +10394,7 @@ void command_logtest(Client *c, const Seperator *sep){ if (sep->IsNumber(1)){ uint32 i = 0; for (i = 0; i < atoi(sep->arg[1]); i++){ - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } } \ No newline at end of file diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 8c2eebb68..761b38b51 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -842,7 +842,7 @@ bool Corpse::Process() { spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); corpse_db_id = 0; } @@ -872,10 +872,10 @@ bool Corpse::Process() { Save(); player_corpse_depop = true; corpse_db_id = 0; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); } else { - logger.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); + Log.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); return true; } } @@ -1083,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); client->Message(0, "Inaccessable Corpse Item: %s", item->Name); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index 98784eb90..6e4640d23 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -145,9 +145,9 @@ bool Doors::Process() void Doors::HandleClick(Client* sender, uint8 trigger) { //door debugging info dump - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct)); MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer; @@ -303,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); #if EQDEBUG>=5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); #endif if(GetLockpick() <= modskill) @@ -560,13 +560,13 @@ void Doors::ToggleState(Mob *sender) } void Doors::DumpDoor(){ - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", dest_zone, dest_x, dest_y, dest_z, dest_heading); } @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) { - logger.Log(EQEmuLogSys::Status, "Loading Doors from database..."); + Log.Log(EQEmuLogSys::Status, "Loading Doors from database..."); // Door tmpDoor; diff --git a/zone/effects.cpp b/zone/effects.cpp index 861d6bd14..aa21fb6b8 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - logger.Log(EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); + Log.Log(EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 50df10905..2a9575f8c 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - logger.Log(EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); + Log.Log(EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index e44fcf6a0..e5cab5f75 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - logger.Log(EQEmuLogSys::Error, "boot_quest does not take any arguments."); + Log.Log(EQEmuLogSys::Error, "boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 52fe31826..46a43246e 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -140,12 +140,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - logger.Log(EQEmuLogSys::Quest, "perl error: %s", err); + Log.Log(EQEmuLogSys::Quest, "perl error: %s", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - logger.Log(EQEmuLogSys::Quest, "Tying perl output to eqemu logs"); + Log.Log(EQEmuLogSys::Quest, "Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -170,14 +170,14 @@ void Embperl::DoInit() { ,FALSE ); - logger.Log(EQEmuLogSys::Quest, "Loading perlemb plugins."); + Log.Log(EQEmuLogSys::Quest, "Loading perlemb plugins."); try { eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE); } catch(const char *err) { - logger.Log(EQEmuLogSys::Quest, "Warning - plugin.pl: %s", err); + Log.Log(EQEmuLogSys::Quest, "Warning - plugin.pl: %s", err); } try { @@ -195,7 +195,7 @@ void Embperl::DoInit() { } catch(const char *err) { - logger.Log(EQEmuLogSys::Quest, "Perl warning: %s", err); + Log.Log(EQEmuLogSys::Quest, "Perl warning: %s", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/embxs.cpp b/zone/embxs.cpp index f8a948578..4075186e0 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - logger.Log(EQEmuLogSys::Error, "boot_qc does not take any arguments."); + Log.Log(EQEmuLogSys::Error, "boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. @@ -100,7 +100,7 @@ XS(XS_EQEmuIO_PRINT) int len = 0; for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); len = 0; pos = i+1; } else { @@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str); } } diff --git a/zone/entity.cpp b/zone/entity.cpp index d3b95e7f5..d400d9cab 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - logger.Log(EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); + Log.Log(EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - logger.Log(EQEmuLogSys::Error, "About to delete a client still in a group."); + Log.Log(EQEmuLogSys::Error, "About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - logger.Log(EQEmuLogSys::Error, "About to delete a client still in a raid."); + Log.Log(EQEmuLogSys::Error, "About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - logger.Log(EQEmuLogSys::Error, + Log.Log(EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - logger.Log(EQEmuLogSys::Error, + Log.Log(EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - logger.Log(EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + Log.Log(EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); @@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID) // If we have been passed a TaskID, only reload the client state if they have // that Task active. if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); client->RemoveClientTaskState(); client->LoadClientTaskState(); taskmanager->SendActiveTasksToClient(client); diff --git a/zone/exp.cpp b/zone/exp.cpp index 47d864706..adf2ca363 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); @@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetLevel(uint8 set_level, bool command) { if (GetEXPForLevel(set_level) == 0xFFFFFFFF) { - logger.Log(EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); + Log.Log(EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); return; } @@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command) safe_delete(outapp); this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change - logger.Log(EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); + Log.Log(EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); CalcBonuses(); diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 3a3fdcd58..3e0577212 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; curfp = true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; diff --git a/zone/forage.cpp b/zone/forage.cpp index e30dd7b0a..838122471 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - logger.Log(EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); + Log.Log(EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - logger.Log(EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); + Log.Log(EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index df687c6db..f51ccf0e2 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1098,7 +1098,7 @@ void Group::VerifyGroup() { for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (membername[i][0] == '\0') { #if EQDEBUG >= 7 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif members[i] = nullptr; continue; @@ -1107,7 +1107,7 @@ void Group::VerifyGroup() { Mob *them = entity_list.GetMob(membername[i]); if(them == nullptr && members[i] != nullptr) { //they aren't in zone #if EQDEBUG >= 6 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; members[i] = nullptr; @@ -1116,13 +1116,13 @@ void Group::VerifyGroup() { if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif members[i] = them; continue; } #if EQDEBUG >= 8 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); #endif } } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index 86a4c06dd..474f131a9 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) { } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -144,10 +144,10 @@ void Client::SendGuildSpawnAppearance() { if (!IsInAGuild()) { // clear guildtag SendAppearancePacket(AT_GuildID, GUILD_NONE); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); } else { uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); SendAppearancePacket(AT_GuildID, GuildID()); if(GetClientVersion() >= EQClientRoF) { @@ -171,11 +171,11 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size); if(outapp->pBuffer == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -192,7 +192,7 @@ void Client::SendGuildMembers() { outapp->pBuffer = data; data = nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); FastQueuePacket(&outapp); @@ -223,7 +223,7 @@ void Client::RefreshGuildInfo() CharGuildInfo info; if(!guild_mgr.GetCharInfo(CharacterID(), info)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); return; } @@ -335,7 +335,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){ outgj->rank = gj->rank; outgj->zoneid = gj->zoneid; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); FastQueuePacket(&outapp); @@ -409,7 +409,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -429,7 +429,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 4d58b1fb0..912a7f152 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -32,7 +32,7 @@ extern WorldServer worldserver; extern volatile bool ZoneLoaded; void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { if(guild_id == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); CharGuildInfo gci; if(!GetCharInfo(charid, gci)) { @@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID) } void ZoneGuildManager::SendGuildDelete(uint32 guild_id) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -261,12 +261,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { switch(pack->opcode) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //reload all the guild details from the database. RefreshGuild(s->guild_id); @@ -295,12 +295,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); Client *c = entity_list.GetClientByCharID(s->char_id); @@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { { if(pack->size != sizeof(ServerGuildRankUpdate_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", + Log.Log(EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRankUpdate_Struct)); return; @@ -364,12 +364,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - logger.Log(EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.Log(EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); //clear all the guild tags. entity_list.RefreshAllGuildInfo(s->guild_id); @@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if (!c || !c->IsInAGuild()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); break; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; @@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { VARSTRUCT_DECODE_STRING(Name, Buffer); strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName)); gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); c->QueuePacket(outapp); } safe_delete(outapp); @@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c) if(Iterator == Banks.end()) { - logger.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); + Log.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); return; } @@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Iterator == Banks.end()) { - logger.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); + Log.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); return false; } @@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Slot < 0) { - logger.Log(EQEmuLogSys::Error, "No space to add item to the guild bank."); + Log.Log(EQEmuLogSys::Error, "No space to add item to the guild bank."); return false; } @@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/horse.cpp b/zone/horse.cpp index f5574f8ea..6fc5dce26 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); + Log.Log(EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - logger.Log(EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + Log.Log(EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 53eb3ae31..455757e85 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -215,7 +215,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are augmenting an augmentable item else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -229,7 +229,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -269,7 +269,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - logger.Log(EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Log(EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; @@ -700,7 +700,7 @@ void Client::SendCursorBuffer() { // Remove item from inventory void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { #if (EQDEBUG >= 5) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); #endif // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. @@ -815,7 +815,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); m_inv.PushCursor(inst); if (client_update) { @@ -831,7 +831,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) // (Also saves changes back to the database: this may be optimized in the future) // client_update: Sends packet to client bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); if (slot_id == MainCursor) return PushItemOnCursor(inst, client_update); @@ -858,7 +858,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); m_inv.PutItem(slot_id, inst); SendLootItemInPacket(&inst, slot_id); @@ -879,7 +879,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI continue; const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); safe_delete(bagitem); } @@ -1313,7 +1313,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1321,7 +1321,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1334,7 +1334,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->to_slot == (uint32)INVALID_INDEX) { if (move_in->from_slot == (uint32)MainCursor) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit ItemInst *inst = m_inv.GetItem(MainCursor); @@ -1348,7 +1348,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; // Item destroyed by client } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit DeleteItemInInventory(move_in->from_slot); return true; // Item deletion @@ -1388,7 +1388,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { ItemInst* src_inst = m_inv.GetItem(src_slot_id); ItemInst* dst_inst = m_inv.GetItem(dst_slot_id); if (src_inst){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); srcitemid = src_inst->GetItem()->ID; //SetTint(dst_slot_id,src_inst->GetColor()); if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize)) @@ -1398,7 +1398,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } if (dst_inst) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); dstitemid = dst_inst->GetItem()->ID; } if (Trader && srcitemid>0){ @@ -1435,7 +1435,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { move_in->from_slot = dst_slot_check; move_in->to_slot = src_slot_check; move_in->number_in_stack = dst_inst->GetCharges(); - if(!SwapItem(move_in)) { logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } + if(!SwapItem(move_in)) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } } return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - logger.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + Log.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - logger.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + Log.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } @@ -1577,7 +1577,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return false; } if (with) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor if (!m_inv[MainCursor]) { Message(13, "Error: Cursor item not located on server!"); @@ -1610,18 +1610,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->number_in_stack > 0) { // Determine if charged items can stack if(src_inst && !src_inst->IsStackable()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); return false; } if (dst_inst) { if(src_inst->GetID() != dst_inst->GetID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); return(false); } if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) { //we have a chance of stacking. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); // Charges can be emptied into dst uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges(); if (usedcharges > move_in->number_in_stack) @@ -1633,15 +1633,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Depleted all charges? if (src_inst->GetCharges() < 1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); database.SaveInventory(CharacterID(),nullptr,src_slot_id); m_inv.DeleteItem(src_slot_id); all_to_stack = true; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); return false; } } @@ -1650,12 +1650,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) { // Move entire stack if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); } else { // Split into two src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack); m_inv.PutItem(dst_slot_id, *inst); safe_delete(inst); @@ -1680,7 +1680,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { SetMaterial(dst_slot_id,src_inst->GetItem()->ID); } if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) { if(src_inst) { @@ -1739,7 +1739,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { // resync the 'from' and 'to' slots on an as-needed basis // Not as effective as the full process, but less intrusive to gameplay -U - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Message(15, "Inventory Desyncronization detected: Resending slot data..."); if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) { @@ -2071,7 +2071,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2080,7 +2080,7 @@ void Client::RemoveNoRent(bool client_update) { for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2089,7 +2089,7 @@ void Client::RemoveNoRent(bool client_update) { if (m_inv[MainPowerSource]) { const ItemInst* inst = m_inv[MainPowerSource]; if (inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent } } @@ -2098,7 +2098,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2107,7 +2107,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots } } @@ -2116,7 +2116,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots } } @@ -2125,7 +2125,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots } } @@ -2134,7 +2134,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots } } @@ -2155,7 +2155,7 @@ void Client::RemoveNoRent(bool client_update) { inst = *iter; // should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U if (!inst->GetItem()->NoRent) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); else m_inv.PushCursor(**iter); @@ -2178,7 +2178,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2193,7 +2193,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2208,7 +2208,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(MainPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, MainPowerSource); } else { @@ -2223,7 +2223,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2238,7 +2238,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2253,7 +2253,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2281,7 +2281,7 @@ void Client::RemoveDuplicateLore(bool client_update) { inst = *iter; // probably needs a valid pointer check -U if (CheckLoreConflict(inst->GetItem())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); safe_delete(*iter); iter = local.erase(iter); } @@ -2300,7 +2300,7 @@ void Client::RemoveDuplicateLore(bool client_update) { m_inv.PushCursor(**iter); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); } safe_delete(*iter); @@ -2322,7 +2322,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, client_update); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2335,7 +2335,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name); const ItemInst* InvItem = nullptr; @@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { InvItem = GetInv()[WeaponSlot]; if(InvItem) { BaseItem = InvItem->GetItem(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon; database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0; } @@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { void Client::RemoveBandolier(const EQApplicationPacket *app) { BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); memset(m_pp.bandoliers[bds->number].name, 0, 32); for(int i = bandolierMainHand; i <= bandolierAmmo; i++) { m_pp.bandoliers[bds->number].items[i].item_id = 0; @@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // any items currently in the weapon slots to inventory. BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); int16 slot; int16 WeaponSlot; ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory @@ -2585,16 +2585,16 @@ void Client::SetBandolier(const EQApplicationPacket *app) { else { // The player doesn't have the required weapon with them. BandolierItems[BandolierSlot] = 0; if (slot == INVALID_INDEX) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { // If there was an item in that weapon slot, put it in the inventory - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(InvItem) { // If there was already an item in that weapon slot that we replaced, find a place to put it if(!MoveItemToInventory(InvItem)) - logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2640,13 +2640,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // put it in the player's inventory. ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name); // If there was an item in that weapon slot, put it in the inventory if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - logger.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { if(!ItemToReturn) return false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); uint32 ItemID = ItemToReturn->GetItem()->ID; @@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(i), i); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); return true; } @@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); return true; } @@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // Store on the cursor // - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); PushItemOnCursor(*ItemToReturn, UpdateClient); @@ -2865,8 +2865,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (log) { - logger.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); + Log.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); @@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) { if (depth >= 10) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); return; } @@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea else { e = ""; } if (log) - logger.Log(EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", + Log.Log(EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); if (!silent) requester->Message(1, "%i:%i - inst: %s - parent: %s%s", diff --git a/zone/loottables.cpp b/zone/loottables.cpp index fed8b2210..316019486 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml drop_chance = zone->random.Real(0.0, 100.0); #if EQDEBUG>=11 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); #endif if (thischance == 100.0 || drop_chance < thischance) { @@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge ServerLootItem_Struct* item = new ServerLootItem_Struct; #if EQDEBUG>=11 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif EQApplicationPacket* outapp = nullptr; diff --git a/zone/merc.cpp b/zone/merc.cpp index c25248e2f..106bbc10d 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -885,7 +885,7 @@ int32 Merc::CalcMaxMana() break; } default: { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -906,7 +906,7 @@ int32 Merc::CalcMaxMana() } #if EQDEBUG >= 11 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1647,7 +1647,7 @@ void Merc::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -1766,7 +1766,7 @@ bool Merc::AI_EngagedCastCheck() { { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); int8 mercClass = GetClass(); @@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - logger.Log(EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); + Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/mob.cpp b/zone/mob.cpp index 7cfc58bcc..873edfc58 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1576,7 +1576,7 @@ void Mob::SendIllusionPacket(uint16 in_race, uint8 in_gender, uint8 in_texture, entity_list.QueueClients(this, outapp); safe_delete(outapp); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size); } @@ -3043,7 +3043,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) { if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function if(IsClient()){ Message(0, "Invalid spell proc %u", spell_id); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); } return; } @@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) { if(lifetap_amt && damage > 0){ lifetap_amt = damage * lifetap_amt / 100; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); if (lifetap_amt > 0) HealDamage(lifetap_amt); //Heal self for modified damage amount. diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 699bd1dea..ee6aa0913 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - logger.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -1404,7 +1404,7 @@ void Mob::AI_Process() { else if (AImovement_timer->Check()) { if(!IsRooted()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); if(!RuleB(Pathing, Aggro) || !zone->pathing) CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed()); else @@ -1639,7 +1639,7 @@ void NPC::AI_DoMovement() { roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y); if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true)) { @@ -1692,11 +1692,11 @@ void NPC::AI_DoMovement() { else { movetimercompleted=false; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); //if we were under quest control (with no grid), we are done now.. if(cur_wp == -2) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); roamer = false; cur_wp = 0; } @@ -1727,7 +1727,7 @@ void NPC::AI_DoMovement() { { // currently moving if (cur_wp_x == GetX() && cur_wp_y == GetY()) { // are we there yet? then stop - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); SetWaypointPause(); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1773,7 +1773,7 @@ void NPC::AI_DoMovement() { if (movetimercompleted==true) { // time to pause has ended SetGrid( 0 - GetGrid()); // revert to AI control - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1809,7 +1809,7 @@ void NPC::AI_DoMovement() { if (!CP2Moved) { if(moved) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); ClearFeignMemory(); moved=false; SetMoving(false); @@ -1934,7 +1934,7 @@ bool NPC::AI_EngagedCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); // try casting a heal or gate if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) { @@ -1957,7 +1957,7 @@ bool NPC::AI_PursueCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) { //no spell cast, try again soon. AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false); diff --git a/zone/net.cpp b/zone/net.cpp index b630dadb2..c1b2e70ce 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -104,7 +104,7 @@ TitleManager title_manager; QueryServ *QServ = 0; TaskManager *taskmanager = 0; QuestParserCollection *parse = 0; -EQEmuLogSys logger; +EQEmuLogSys Log; const SPDat_Spell_Struct* spells; void LoadSpells(EQEmu::MemoryMappedFile **mmf); @@ -148,35 +148,35 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { - logger.Log(EQEmuLogSys::Error, "Loading server configuration failed."); + Log.Log(EQEmuLogSys::Error, "Loading server configuration failed."); return 1; } const ZoneConfig *Config=ZoneConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); worldserver.SetPassword(Config->SharedKey.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - logger.Log(EQEmuLogSys::Error, "Cannot continue without a database connection."); + Log.Log(EQEmuLogSys::Error, "Cannot continue without a database connection."); return 1; } /* Register Log System and Settings */ - logger.LoadLogSettingsDefaults(); - logger.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); - database.LoadLogSysSettings(logger.log_settings); + Log.LoadLogSettingsDefaults(); + Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); + database.LoadLogSysSettings(Log.log_settings); /* Guilds */ guild_mgr.SetDatabase(&database); @@ -186,121 +186,121 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - logger.Log(EQEmuLogSys::Error, "Could not set signal handler"); + Log.Log(EQEmuLogSys::Error, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - logger.Log(EQEmuLogSys::Error, "Could not set signal handler"); + Log.Log(EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - logger.Log(EQEmuLogSys::Error, "Could not set signal handler"); + Log.Log(EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #endif const char *log_ini_file = "./log.ini"; if(!load_log_settings(log_ini_file)) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); database.LoadVariables(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { - logger.Log(EQEmuLogSys::Error, "Loading items FAILED!"); - logger.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); + Log.Log(EQEmuLogSys::Error, "Loading items FAILED!"); + Log.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { - logger.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); + Log.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { - logger.Log(EQEmuLogSys::Error, "Loading loot FAILED!"); + Log.Log(EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { - logger.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!"); + Log.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { - logger.Log(EQEmuLogSys::Error, "Loading base data FAILED!"); + Log.Log(EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); database.LoadFactionData(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); database.LoadTributes(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) - logger.Log(EQEmuLogSys::Error, "Command loading FAILED"); + Log.Log(EQEmuLogSys::Error, "Command loading FAILED"); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - logger.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(TaskSystem, EnableTaskSystem)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); taskmanager = new TaskManager; taskmanager->LoadTasks(); } @@ -317,11 +317,11 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); parse->ReloadQuests(); if (!worldserver.Connect()) { - logger.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); + Log.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -332,9 +332,9 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - logger.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); + Log.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; } @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #ifndef WIN32 - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); #endif Timer quest_timers(100); @@ -365,13 +365,13 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); // log_sys.CloseZoneLogs(); // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); if (!eqsf.Open(Config->ZonePort)) { - logger.Log(EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); + Log.Log(EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); worldserver.Disconnect(); worldwasconnected = false; @@ -385,7 +385,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqss->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); stream_identifier.AddStream(eqss); //takes the stream } @@ -397,7 +397,7 @@ int main(int argc, char** argv) { //now that we know what patch they are running, start up their client object struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); Client* client = new Client(eqsi); entity_list.AddClient(client); } @@ -522,13 +522,13 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); CheckEQEMuErrorAndPause(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -539,7 +539,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); // safe_delete(worldserver); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); } uint32 NetConnection::GetIP() @@ -628,7 +628,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - logger.Log(EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); + Log.Log(EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 9f67afbd5..91f43da6c 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - logger.Log(EQEmuLogSys::Error, "Database error, invalid item"); + Log.Log(EQEmuLogSys::Error, "Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem { if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) { - logger.Log(EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); + Log.Log(EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); } } } diff --git a/zone/object.cpp b/zone/object.cpp index b2632bc2c..9319782f8 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - logger.Log(EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); + Log.Log(EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 07b145d34..343711a65 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -61,19 +61,19 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) if(Ret->loadPaths(PathFile)) { - logger.Log(EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); + Log.Log(EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); } else { - logger.Log(EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); + Log.Log(EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - logger.Log(EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); + Log.Log(EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,18 +103,18 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - logger.Log(EQEmuLogSys::Error, "Bad Magic String in .path file."); + Log.Log(EQEmuLogSys::Error, "Bad Magic String in .path file."); return false; } fread(&Head, sizeof(Head), 1, PathFile); - logger.Log(EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", + Log.Log(EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", (long)Head.version, (long)Head.PathNodeCount); if(Head.version != 2) { - logger.Log(EQEmuLogSys::Error, "Unsupported path file version."); + Log.Log(EQEmuLogSys::Error, "Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - logger.Log(EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + Log.Log(EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque PathManager::FindRoute(int startID, int endID) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -330,7 +330,7 @@ std::deque PathManager::FindRoute(int startID, int endID) } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); return Route; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::deque noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToStart <0 ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return noderoute; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); // Find the nearest PathNode the end point has LOS to @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToEnd < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); return noderoute; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); if(ClosestPathNodeToStart == ClosestPathNodeToEnd) { @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) return To; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); if(From == PathingLastPosition) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((PathingLoopCount > 5) && !IsRooted()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); if(Route.size() == 0) { @@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // If we are already pathing, and the destination is the same as before ... if(SameDestination) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); // Get the coordinates of the first path node we are going to. NextNode = Route.front(); @@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // We have reached the path node. if(NodeLoc == From) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); NodeReached = true; @@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // target, and we may run past the target if we don't check LOS at this point. int RouteSize = Route.size(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); if((RouteSize == 2) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode); } @@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // we have run all the nodes, all that is left is the direct path from the last node // to the destination - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); return To; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // We get here if we were already pathing, but our destination has now changed. // - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); // Update our record of where we are going to. PathingDestination = To; // Check if we now have LOS etc to the new destination. @@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } } @@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { if(!PathingRouteUpdateTimerShort->Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); } else { if(!PathingRouteUpdateTimerLong->Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); } // We are already pathing, destination changed, no LOS. Find the nearest node to our destination. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. if(DestinationPathNode == -1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); Route.clear(); return To; } @@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // one, we will carry on on our path. if(DestinationPathNode == Route.back()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); @@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Check if we have reached a path node. if(NodeLoc == From) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); NodeReached = true; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // Return the coords of our next path node on the route. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); return To; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); Route.clear(); // We will now fall through to get a new route. @@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); if((SameDestination) && !PathingLOSCheckTimer->Check()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); return To; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); return To; } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); Route = zone->pathing->FindRoute(From, To); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); return To; } if(SameDestination && (Route.front() == PathingLastNodeVisited)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Route.clear(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); PathingLoopCount = 0; @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } if(ClosestPathNodeToStart <0 ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return -1; } return ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); return false; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); if (ABS(NewZ - last_z) > 5.0f) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } if (best_z2 == -999990) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); return false; } else { if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); return false; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); } } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) if(d && !d->IsDoorOpen() ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); d->ForceOpen(ForWho); } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 59a865887..a60a5288a 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { if (THIS->IsMerc()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); #endif else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { if (THIS->IsMerc()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); #endif else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); diff --git a/zone/petitions.cpp b/zone/petitions.cpp index deab5789d..37e1c9cab 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,12 +254,12 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } #if EQDEBUG >= 5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); #endif } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index 5cc236176..4dff5aa84 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - logger.Log(EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); + Log.Log(EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - logger.Log(EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + Log.Log(EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - logger.Log(EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - logger.Log(EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + Log.Log(EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - logger.Log(EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); + Log.Log(EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 0494f7f67..c3188d66e 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -154,7 +154,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -170,7 +170,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { QuestManagerCurrentQuestVars(); if (!owner) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::stopalltimers(Mob *mob) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -559,7 +559,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -570,7 +570,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -589,7 +589,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -619,7 +619,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - logger.Log(EQEmuLogSys::Quest, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -646,7 +646,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - logger.Log(EQEmuLogSys::Quest, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -655,7 +655,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - logger.Log(EQEmuLogSys::Quest, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -664,7 +664,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - logger.Log(EQEmuLogSys::Quest, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + Log.Log(EQEmuLogSys::Quest, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -1652,7 +1652,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Quest, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Quest, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); return; } @@ -2074,7 +2074,7 @@ bool QuestManager::istaskenabled(int taskid) { void QuestManager::tasksetselector(int tasksetid) { QuestManagerCurrentQuestVars(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager) initiator->TaskSetSelector(owner, tasksetid); } @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - logger.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } @@ -2809,7 +2809,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - logger.Log(EQEmuLogSys::Quest, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + Log.Log(EQEmuLogSys::Quest, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 9a87b539a..01685b352 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - logger.Log(EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 2aebb5339..288893a1e 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -153,13 +153,13 @@ bool Spawn2::Process() { if (timer.Check()) { timer.Disable(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); //first check our spawn condition, if this isnt active //then we reset the timer and try again next time. if(condition_id != SC_AlwaysEnabled && !zone->spawn_conditions.Check(condition_id, condition_min_value)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); Reset(); return(true); } @@ -170,14 +170,14 @@ bool Spawn2::Process() { } if (sg == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } //have the spawn group pick an NPC for us uint32 npcid = sg->GetNPCType(); if (npcid == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); Reset(); //try again later (why?) return(true); } @@ -185,7 +185,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); if (tmp == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); } @@ -194,7 +194,7 @@ bool Spawn2::Process() { { if(!entity_list.LimitCheckName(tmp->name)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); timer.Start(5000); //try again in five seconds. return(true); } @@ -202,7 +202,7 @@ bool Spawn2::Process() { if(tmp->spawn_limit > 0) { if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); timer.Start(5000); //try again in five seconds. return(true); } @@ -233,10 +233,10 @@ bool Spawn2::Process() { if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && sg->min_delay) npc->AI_SetRoambox(sg->roamdist,sg->roambox[0],sg->roambox[1],sg->roambox[2],sg->roambox[3],sg->delay,sg->min_delay); if(zone->InstantGrids()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); LoadGrid(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); } } return true; @@ -261,7 +261,7 @@ void Spawn2::LoadGrid() { //dont set an NPC's grid until its loaded for them. npcthis->SetGrid(grid_); npcthis->AssignWaypoints(grid_); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); } @@ -272,21 +272,21 @@ void Spawn2::LoadGrid() { void Spawn2::Reset() { timer.Start(resetTimer()); npcthis = nullptr; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { if (delay == 0) { timer.Trigger(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } npcthis = nullptr; @@ -328,7 +328,7 @@ void Spawn2::ForceDespawn() cur = despawnTimer(dtimer); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); timer.Start(cur); } @@ -349,7 +349,7 @@ void Spawn2::DeathReset(bool realdeath) if(spawn2_id) { database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), (cur/1000)); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); //store it to database too } } @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -466,12 +466,12 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { if(GetSpawnCondition() != c.condition_id) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); bool old_state = (old_value >= condition_min_value); bool new_state = (c.value >= condition_min_value); if(old_state == new_state) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); return; //no change } @@ -479,50 +479,50 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { switch(c.on_change) { case SpawnCondition::DoNothing: //that was easy. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); break; case SpawnCondition::DoDepop: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; case SpawnCondition::DoRepopIfReady: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); npcthis->Depop(false); //remove the current mob npcthis = nullptr; } if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled. timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); if(timer_remaining <= 0) Repop(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); } break; default: if(c.on_change < SpawnCondition::DoSignalMin) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); return; //unknown onchange action } int signal_id = c.on_change - SpawnCondition::DoSignalMin; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } void Zone::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); LinkedListIterator iterator(spawn2_list); @@ -592,7 +592,7 @@ void SpawnConditionManager::Process() { EQTime::AddMinutes(cevent.period, &cevent.next); std::string t; EQTime::ToString(&cevent.next, t); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); //save the next event time in the DB UpdateDBEvent(cevent); //find the next closest event timer. @@ -611,7 +611,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); return; //unable to find the spawn condition to operate on } @@ -619,7 +619,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { zone->zone_time.getEQTimeOfDay(&tod); if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); return; } @@ -631,26 +631,26 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { switch(event.action) { case SpawnEvent::ActionSet: new_value = event.argument; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); break; case SpawnEvent::ActionAdd: new_value += event.argument; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionSubtract: new_value -= event.argument; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionMultiply: new_value *= event.argument; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; case SpawnEvent::ActionDivide: new_value /= event.argument; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; default: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); return; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -727,7 +727,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: std::string timeAsString; EQTime::ToString(&event.next, timeAsString); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); return true; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -755,7 +755,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in cond.on_change = (SpawnCondition::OnChange) atoi(row[1]); spawn_conditions[cond.condition_id] = cond; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); } //load values @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - logger.Log(EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); + Log.Log(EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } @@ -811,7 +811,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in spawn_events.push_back(event); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); } //now we need to catch up on events that happened while we were away @@ -846,7 +846,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in //watch for special case of all 0s, which means to reset next to now if(cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 && cevent.next.minute == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); memcpy(&cevent.next, &tod, sizeof(cevent.next)); //add one period EQTime::AddMinutes(cevent.period, &cevent.next); @@ -857,7 +857,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in bool ran = false; while(EQTime::IsTimeBefore(&tod, &cevent.next)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); //this event has been triggered. //execute the event if(!cevent.strict || StrictCheck) @@ -900,9 +900,9 @@ void SpawnConditionManager::FindNearestEvent() { } } if(next_id == -1) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); } void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update) @@ -914,14 +914,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -930,7 +930,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //set our local value cond.value = new_value; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -941,14 +941,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -959,7 +959,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //save it in the DB too UpdateDBCondition(zone_short, instance_id, condition_id, new_value); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -969,7 +969,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //this is a remote spawn condition, update the DB and send //an update packet to the zone if its up - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); UpdateDBCondition(zone_short, instance_id, condition_id, new_value); @@ -989,7 +989,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance void SpawnConditionManager::ReloadEvent(uint32 event_id) { std::string zone_short_name; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1002,7 +1002,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { //load the event into the old event slot if(!LoadDBEvent(event_id, cevent, zone_short_name)) { //unable to find the event in the database... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } //sync up our nearest event @@ -1015,7 +1015,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { SpawnEvent e; if(!LoadDBEvent(event_id, e, zone_short_name)) { //unable to find the event in the database... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } @@ -1032,7 +1032,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1047,13 +1047,13 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri cevent.enabled = enabled; cevent.strict = strict; if(reset_base) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); //start with the time now zone->zone_time.getEQTimeOfDay(&cevent.next); //advance the next time by our period EQTime::AddMinutes(cevent.period, &cevent.next); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); } //save the event in the DB @@ -1062,7 +1062,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri //sync up our nearest event FindNearestEvent(); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); } //even if we dont change anything, we still found it return; @@ -1081,24 +1081,24 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri SpawnEvent e; std::string zone_short_name; if(!LoadDBEvent(event_id, e, zone_short_name)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); //unable to find the event in the database... return; } if(e.enabled == enabled && !reset_base) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); return; //no changes. } e.enabled = enabled; if(reset_base) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); //start with the time now zone->zone_time.getEQTimeOfDay(&e.next); //advance the next time by our period EQTime::AddMinutes(e.period, &e.next); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); } //save the event in the DB UpdateDBEvent(e); @@ -1123,7 +1123,7 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); return(0); //unable to find the spawn condition } @@ -1138,12 +1138,12 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc zone_short, instance_id, condition_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } if (results.RowCount() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index abd93c84c..0b3201da3 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa uint32 SpawnGroup::GetNPCType() { #if EQDEBUG >= 10 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); #endif int npcType = 0; int totalchance = 0; @@ -167,7 +167,7 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND zone = '%s'", zone_name); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); return false; } @@ -195,7 +195,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroupid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); return false; } @@ -210,7 +210,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "ORDER BY chance", spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); return false; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index cb4b77f78..a9c58cd5a 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -464,7 +464,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) break; } default: - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); return(1000); /* nice long delay for them, the caller depends on this! */ } @@ -683,7 +683,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -695,12 +695,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const ItemInst* Ammo = m_inv[MainAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); return; } @@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const Item_Struct* AmmoItem = Ammo->GetItem(); if(RangeItem->ItemType != ItemTypeBow) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID()); return; } if(AmmoItem->ItemType != ItemTypeArrow) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); //look for ammo in inventory if we only have 1 left... if(Ammo->GetCharges() == 1) { @@ -746,7 +746,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { Ammo = baginst; ammo_slot = m_inv.CalcSlotId(r, i); found = true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); break; } } @@ -761,17 +761,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (aslot != INVALID_INDEX) { ammo_slot = aslot; Ammo = m_inv[aslot]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); } } } float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -799,9 +799,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){ DeleteItemInInventory(ammo_slot, 1, true); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); } CheckIncreaseSkill(SkillArchery, GetTarget(), -15); @@ -873,7 +873,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillArchery); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillArchery, 0, RangeWeapon, Ammo, AmmoSlot, speed); @@ -882,7 +882,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); bool HeadShot = false; uint32 HeadShot_Dmg = TryHeadShot(other, SkillArchery); @@ -923,7 +923,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite MaxDmg += MaxDmg*bonusArcheryDamageModifier / 100; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); bool dobonus = false; if(GetClass() == RANGER && GetLevel() > 50){ @@ -944,7 +944,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite hate *= 2; MaxDmg = mod_archery_bonus_damage(MaxDmg, RangeWeapon); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); } } @@ -1192,7 +1192,7 @@ void NPC::RangedAttack(Mob* other) //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -1361,7 +1361,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -1371,19 +1371,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const ItemInst* RangeWeapon = m_inv[MainRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); if(RangeWeapon->GetCharges() == 1) { //first check ammo @@ -1392,7 +1392,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = MainAmmo; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal); @@ -1400,17 +1400,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //the item wont change, but the instance does, not that it matters ammo_slot = aslot; RangeWeapon = m_inv[aslot]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } } } float range = item->Range + GetRangeDistTargetSizeMod(other); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1489,7 +1489,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillThrowing); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); return; @@ -1497,7 +1497,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); int16 WDmg = 0; @@ -1533,7 +1533,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) other->AvoidDamage(this, TotalDmg, false); //CanRiposte=false - Can not riposte throw attacks. diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 1e0f29e47..cfa9e55c4 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -476,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(!target_zone) { #ifdef SPELL_EFFECT_SPAM - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); #endif if(IsClient()) CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); @@ -485,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { #ifdef SPELL_EFFECT_SPAM - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); #endif if(IsClient()) CastToClient()->MovePC(target_zone, x, y, z, heading); @@ -711,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) stun_resist += aabonuses.StunResist; if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; @@ -721,7 +721,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } } break; @@ -1649,7 +1649,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", spell_id, caster->GetName()); CastToCorpse()->CastRezz(spell_id, caster); @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - logger.Log(EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + Log.Log(EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } @@ -3065,7 +3065,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, int mod = caster->GetInstrumentMod(spell_id); mod = ApplySpellEffectiveness(caster, spell_id, mod, true); effect_value = effect_value * mod / 10; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); } effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster); @@ -3127,7 +3127,7 @@ snare has both of them negative, yet their range should work the same: updownsign = 1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", spell_id, formula, base, max, caster_level, updownsign); switch(formula) @@ -3326,7 +3326,7 @@ snare has both of them negative, yet their range should work the same: result = ubase * (caster_level * (formula - 2000) + 1); } else - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); } } @@ -3351,7 +3351,7 @@ snare has both of them negative, yet their range should work the same: if (base < 0 && result > 0) result *= -1; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3383,18 +3383,18 @@ void Mob::BuffProcess() IsMezSpell(buffs[buffs_i].spellid) || IsBlindSpell(buffs[buffs_i].spellid)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } } else if (buffs[buffs_i].ticsremaining < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); } } else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)) @@ -3759,7 +3759,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient() && !CastToClient()->IsDead()) CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); if(spells[buffs[slot].spellid].viral_targets > 0) { bool last_virus = true; @@ -4817,7 +4817,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -5156,7 +5156,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - logger.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } diff --git a/zone/spells.cpp b/zone/spells.cpp index e3c826b97..1f6c514fe 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -147,7 +147,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -166,7 +166,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, (IsAmnesiad() && IsDiscipline(spell_id)) ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -204,7 +204,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, //cannot cast under divine aura if(DivineAura()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -234,7 +234,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -243,7 +243,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, } if (HasActiveSong() && IsBardSong(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client _StopSong(); } @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - logger.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + Log.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - logger.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + Log.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - logger.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + Log.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -349,7 +349,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, const SPDat_Spell_Struct &spell = spells[spell_id]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", spell.name, spell_id, target_id, slot, cast_time, mana_cost, item_slot==0xFFFFFFFF?999:item_slot); casting_spell_id = spell_id; @@ -363,7 +363,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_type = type; SaveSpellLoc(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); // if this spell doesn't require a target, or if it's an optional target // and a target wasn't provided, then it's us; unless TGB is on and this @@ -375,7 +375,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, spell.targettype == ST_Beam || spell.targettype == ST_TargetOptional) && target_id == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); target_id = GetID(); } @@ -392,7 +392,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, // we checked for spells not requiring targets above if(target_id == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, SPELL_NEED_TAR); @@ -430,7 +430,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { mana_cost = 0; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, INSUFFICIENT_MANA); @@ -451,7 +451,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_resist_adjust = resist_adjust; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", spell_id, cast_time, orgcasttime, mana_cost); // cast time is 0, just finish it right now and be done with it @@ -517,7 +517,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); return false; @@ -756,7 +756,7 @@ bool Client::CheckFizzle(uint16 spell_id) float fizzle_roll = zone->random.Real(0, 100); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); if(fizzle_roll > fizzlechance) return(true); @@ -816,7 +816,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) ZeroCastingVars(); // resets all the state keeping stuff - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); if(!spellid) return; @@ -893,7 +893,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? Message_StringID(13, SPELL_RECAST); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -907,7 +907,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { Message_StringID(13, SPELL_RECAST); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -916,7 +916,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!IsValidSpell(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); InterruptSpell(); return; } @@ -927,7 +927,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(delaytimer) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); Message(13, "You are unable to focus."); InterruptSpell(); return; @@ -937,7 +937,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // make sure they aren't somehow casting 2 timed spells at once if (casting_spell_id != spell_id) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); Message_StringID(13,ALREADY_CASTING); InterruptSpell(); return; @@ -952,7 +952,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if (IsBardSong(spell_id)) { if(spells[spell_id].buffduration == 0xFFFF || spells[spell_id].recast_time != 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); } else { bardsong = spell_id; bardsong_slot = slot; @@ -962,7 +962,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, else bardsong_target_id = spell_target->GetID(); bardsong_timer.Start(6000); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); bard_song_mode = true; } } @@ -1041,10 +1041,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); InterruptSpell(); return; } @@ -1060,10 +1060,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(IsClient()) { int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { if(reg_focus > 0) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); Client *c = this->CastToClient(); int component, component_count, inv_slot_id; bool missingreags = false; @@ -1116,11 +1116,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, break; default: // some non-instrument component. Let it go, but record it in the log - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); } if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); if(c->GetGM()) c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { @@ -1143,12 +1143,12 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, const Item_Struct *item = database.GetItem(component); if(item) { c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { char TempItemName[64]; strcpy((char*)&TempItemName, "UNKNOWN"); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); } } } // end bard/not bard ifs @@ -1169,7 +1169,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (component == -1) continue; component_count = spells[spell_id].component_counts[t_count]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); // Components found, Deleting // now we go looking for and deleting the items one by one for(int s = 0; s < component_count; s++) @@ -1234,7 +1234,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { Message_StringID(13, SPELL_RECAST); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -1253,15 +1253,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(fromaug) { charges = -1; } //Don't destroy the parent item if(charges > -1) { // charged item, expend a charge - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); DeleteChargeFromSlot = inventory_slot; } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; @@ -1280,7 +1280,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // we're done casting, now try to apply the spell if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust) ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); InterruptSpell(); return; } @@ -1309,7 +1309,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, this->CastToClient()->CheckSongSkillIncrease(spell_id); this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); } else { @@ -1344,7 +1344,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, delaytimer = true; spellend_timer.Start(400,true); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); } @@ -1391,7 +1391,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce && (IsGrouped() // still self only if not grouped || IsRaidGrouped()) && (HasProjectIllusion())){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); targetType = ST_GroupClientAndPet; } @@ -1474,7 +1474,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce ) { //invalid target - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1487,7 +1487,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3)) { //invalid target - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1501,7 +1501,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (spell_target != GetPet()) || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, body_type); Message_StringID(13, SPELL_NEED_TAR); @@ -1526,7 +1526,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || mob_body != target_bt) { //invalid target - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); if(!spell_target) Message_StringID(13,SPELL_NEED_TAR); else @@ -1544,7 +1544,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1552,14 +1552,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target->IsNPC()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1568,7 +1568,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } @@ -1580,7 +1580,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target || !spell_target->IsPlayerCorpse()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); uint32 message = ONLY_ON_CORPSES; if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; @@ -1596,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = GetPet(); if(!spell_target) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); Message_StringID(13,NO_PET); return false; // can't cast these unless we have a target } @@ -1666,7 +1666,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1703,7 +1703,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1800,14 +1800,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } @@ -1878,7 +1878,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; @@ -1957,7 +1957,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) return(false); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target // spell that's recast every 2500 msec for AEDuration msec. There are @@ -1968,7 +1968,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Mob *beacon_loc = spell_target ? spell_target : this; Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); spell_target = nullptr; ae_center = beacon; CastAction = AECaster; @@ -1977,7 +1977,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // check line of sight to target if it's a detrimental spell if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); Message_StringID(13,CANT_SEE_TARGET); return false; } @@ -2008,13 +2008,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range; if(dist2 > range2) { //target is out of range. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); Message_StringID(13, TARGET_TOO_CLOSE); return(false); } @@ -2043,7 +2043,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS if(spell_target == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } if (isproc) { @@ -2067,11 +2067,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(IsPlayerIllusionSpell(spell_id) && IsClient() && (HasProjectIllusion())){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); SetProjectIllusion(false); } else{ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); } break; } @@ -2235,7 +2235,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // CastSpell already reduced the cost for it if we're a client with focus if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); if (!DoHPToManaCovert(mana_used)) SetMana(GetMana() - mana_used); TryTriggerOnValueAmount(false, true); @@ -2247,7 +2247,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF) { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; @@ -2263,7 +2263,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(reduction) recast -= reduction; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } @@ -2301,7 +2301,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(slot == USE_ITEM_SPELL_SLOT) { //bard songs should never come from items... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); return(false); } @@ -2309,12 +2309,12 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } if(ae_center != nullptr && ae_center->IsBeacon()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2323,18 +2323,18 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(mana_used > 0) { if(mana_used > GetMana()) { //ran out of mana... this calls StopSong() for us - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); return(false); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); SetMana(GetMana() - mana_used); } // check line of sight to target if it's a detrimental spell if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); Message_StringID(13, CANT_SEE_TARGET); return(false); } @@ -2349,7 +2349,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range2 = range * range; if(dist2 > range2) { //target is out of range. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } @@ -2365,10 +2365,10 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case SingleTarget: { if(spell_target == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); spell_target->BardPulse(spell_id, this); break; } @@ -2386,7 +2386,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { { // we can't cast an AE spell without something to center it on if(ae_center == nullptr) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2394,9 +2394,9 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(spell_target) { // this must be an AETarget spell // affect the target too spell_target->BardPulse(spell_id, this); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); } bool affect_caster = !IsNPC(); //NPC AE spells do not affect the NPC caster entity_list.AEBardPulse(this, ae_center, spell_id, affect_caster); @@ -2406,13 +2406,13 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case GroupSpell: { if(spell_target->IsGrouped()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); Group *target_group = entity_list.GetGroupByMob(spell_target); if(target_group) target_group->GroupBardPulse(this, spell_id); } else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); Raid *r = entity_list.GetRaidByClient(spell_target->CastToClient()); if(r){ uint32 gid = r->GetGroup(spell_target->GetName()); @@ -2429,7 +2429,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); BardPulse(spell_id, this); #ifdef GROUP_BUFF_PETS if (GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) @@ -2455,13 +2455,13 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { if(buffs[buffs_i].spellid != spell_id) continue; if(buffs[buffs_i].casterid != caster->GetID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); return; } //extend the spell if it will expire before the next pulse if(buffs[buffs_i].ticsremaining <= 3) { buffs[buffs_i].ticsremaining += 3; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); } //should we send this buff update to the client... seems like it would @@ -2559,7 +2559,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { //we are done... return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); //this spell is not affecting this mob, apply it. caster->SpellOnTarget(spell_id, this); } @@ -2601,7 +2601,7 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste res = mod_buff_duration(res, caster, target, spell_id); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", spell_id, castlevel, formula, duration, res); return(res); @@ -2673,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) return duration ? duration : 3600; default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); return 0; } } @@ -2695,15 +2695,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); // Same Spells and dot exemption is set to 1 or spell is Manaburn if (spellid1 == spellid2) { if (sp1.dot_stacking_exempt == 1 && caster1 != caster2) { // same caster can refresh - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); return -1; } else if (spellid1 == 2751) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); return -1; } } @@ -2735,7 +2735,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { if(!IsDetrimentalSpell(spellid1) && !IsDetrimentalSpell(spellid2)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); return (0); } } @@ -2804,16 +2804,16 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value, sp1_value, (sp1_value < overwrite_below_value)?"Overwriting":"Not overwriting"); if(sp1_value < overwrite_below_value) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); return 1; // overwrite spell if its value is less } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value); } @@ -2827,22 +2827,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value, sp2_value, (sp2_value < blocked_below_value)?"Blocked":"Not blocked"); if (sp2_value < blocked_below_value) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); return -1; //blocked } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } } } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", sp1.name, spellid1, sp2.name, spellid2); } @@ -2905,13 +2905,13 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(IsNPC() && caster1 && caster2 && caster1 != caster2) { if(effect1 == SE_CurrentHP && sp1_detrimental && sp2_detrimental) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); continue; } } if(effect1 == SE_CompleteHeal){ //SE_CompleteHeal never stacks or overwrites ever, always block. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); return (-1); } @@ -2923,7 +2923,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(sp_det_mismatch) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); continue; } @@ -2932,7 +2932,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, and the effect is a dot we can go ahead and stack it */ if(effect1 == SE_CurrentHP && spellid1 != spellid2 && sp1_detrimental && sp2_detrimental) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); continue; } @@ -2958,7 +2958,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, sp2_value = 0 - sp2_value; if(sp2_value < sp1_value) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", sp2.name, sp2_value, sp1.name, sp1_value, sp2.name); return -1; // can't stack } @@ -2967,7 +2967,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //we dont return here... a better value on this one effect dosent mean they are //all better... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", sp1.name, sp1_value, sp2.name, sp2_value, sp1.name); will_overwrite = true; } @@ -2976,15 +2976,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //so now we see if this new spell is any better, or if its not related at all if(will_overwrite) { if (values_equal && effect_match && !IsGroupSpell(spellid2) && IsGroupSpell(spellid1)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", sp2.name, spellid2, sp1.name, spellid1); return -1; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); return(1); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); return 0; } @@ -3043,11 +3043,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } if (duration == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); return -2; // no duration? this isn't a buff } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); // first we loop through everything checking that the spell @@ -3077,12 +3077,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid ret = CheckStackConflict(curbuf.spellid, curbuf.casterlevel, spell_id, caster_level, entity_list.GetMobID(curbuf.casterid), caster, buffslot); if (ret == -1) { // stop the spell - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); return -1; } if (ret == 1) { // set a flag to indicate that there will be overwriting - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); // If this is the first buff it would override, use its slot if (!will_overwrite) @@ -3106,7 +3106,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid for (buffslot = 0; buffslot < buff_count; buffslot++) { const Buffs_Struct &curbuf = buffs[buffslot]; if (IsBeneficialSpell(curbuf.spellid)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", spell_id, curbuf.spellid, buffslot); BuffFadeBySlot(buffslot, false); emptyslot = buffslot; @@ -3114,11 +3114,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } } if(emptyslot == -1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); return -1; } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); return -1; } } @@ -3169,7 +3169,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].UpdateClient = true; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); if (IsPet() && GetOwner() && GetOwner()->IsClient()) SendPetBuffsToClient(); @@ -3207,7 +3207,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) { int i, ret, firstfree = -2; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); int buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) @@ -3231,19 +3231,19 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) if(ret == 1) { // should overwrite current slot if(iFailIfOverwrite) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return(-1); } if(firstfree == -2) firstfree = i; } if(ret == -1) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return -1; // stop the spell, can't stack it } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); return firstfree; } @@ -3270,7 +3270,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // well we can't cast a spell on target without a target if(!spelltar) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); Message(13, "SOT: You must have a target for this spell."); return false; } @@ -3298,7 +3298,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r uint16 caster_level = GetCasterLevel(spell_id); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); // Actual cast action - this causes the caster animation and the particles // around the target @@ -3378,7 +3378,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Spells, EnableBlockedBuffs)) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", spell_id, spelltar->GetName()); safe_delete(action_packet); return true; @@ -3386,7 +3386,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBlockedPetBuff(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", spell_id, spelltar->GetName(), spelltar->GetOwner()->GetName()); safe_delete(action_packet); return true; @@ -3395,7 +3395,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // invuln mobs can't be affected by any spells, good or bad if(spelltar->GetInvul() || spelltar->DivineAura()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3406,17 +3406,17 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Pets, UnTargetableSwarmPet)) { if (spelltar->IsNPC()) { if (!spelltar->CastToNPC()->GetSwarmOwner()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } @@ -3525,9 +3525,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spells[spell_id].targettype == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); @@ -3537,7 +3537,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r } else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; @@ -3551,7 +3551,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsImmuneToSpell(spell_id, this)) { //the above call does the message to the client if needed - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3644,7 +3644,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spell_effectiveness == 0 || !IsPartialCapableSpell(spell_id) ) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); @@ -3692,7 +3692,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsAIControlled() && IsDetrimentalSpell(spell_id) && !IsHarmonySpell(spell_id)) { int32 aggro_amount = CheckAggroAmount(spell_id, isproc); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); if(aggro_amount > 0) spelltar->AddToHateList(this, aggro_amount); else{ int32 newhate = spelltar->GetHateAmount(this) + aggro_amount; @@ -3709,7 +3709,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // make sure spelltar is high enough level for the buff if(RuleB(Spells, BuffLevelRestrictions) && !spelltar->CheckSpellLevelRestriction(spell_id)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); @@ -3721,7 +3721,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_type != 1) // AA is handled differently Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); @@ -3825,14 +3825,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r safe_delete(action_packet); safe_delete(message_packet); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); return true; } void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) @@ -4005,7 +4005,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) //this spell like 10 times, this could easily be consolidated //into one loop through with a switch statement. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); if(!IsValidSpell(spell_id)) return true; @@ -4016,7 +4016,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(IsMezSpell(spell_id)) { if(GetSpecialAbility(UNMEZABLE)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); caster->Message_StringID(MT_Shout, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4034,7 +4034,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if((GetLevel() > spells[spell_id].max[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL); return true; } @@ -4043,7 +4043,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // slow and haste spells if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); caster->Message_StringID(MT_Shout, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4059,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4070,13 +4070,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) return true; } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id); if (aggro > 0) { @@ -4090,7 +4090,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) { Message(13, "Your are immune to fear."); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } @@ -4100,7 +4100,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNCHARMABLE)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); caster->Message_StringID(MT_Shout, CANNOT_CHARM); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4113,7 +4113,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); caster->Message(MT_Shout, "You cannot charm yourself."); return true; } @@ -4126,7 +4126,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) assert(effect_index >= 0); if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_CHARM_YET); return true; } @@ -4140,7 +4140,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) ) { if(GetSpecialAbility(UNSNAREABLE)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); caster->Message_StringID(MT_Shout, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4156,7 +4156,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); caster->Message_StringID(MT_Shout, CANT_DRAIN_SELF); return true; } @@ -4166,13 +4166,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); caster->Message_StringID(MT_Shout, CANNOT_SAC_SELF); return true; } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); return false; } @@ -4209,7 +4209,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use if(GetSpecialAbility(IMMUNE_MAGIC)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); return(0); } @@ -4230,7 +4230,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int fear_resist_bonuses = CalcFearResistChance(); if(zone->random.Roll(fear_resist_bonuses)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); return 0; } } @@ -4248,7 +4248,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int resist_bonuses = CalcResistChanceBonus(); if(resist_bonuses && zone->random.Roll(resist_bonuses)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); return 0; } } @@ -4256,7 +4256,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get the resist chance for the target if(resist_type == RESIST_NONE) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); return 100; } @@ -4822,7 +4822,7 @@ void Client::MemSpell(uint16 spell_id, int slot, bool update_client) } m_pp.mem_spells[slot] = spell_id; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); database.SaveCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4837,7 +4837,7 @@ void Client::UnmemSpell(int slot, bool update_client) if(slot > MAX_PP_MEMSPELL || slot < 0) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); m_pp.mem_spells[slot] = 0xFFFFFFFF; database.DeleteCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4870,7 +4870,7 @@ void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client) m_pp.spell_book[slot] = spell_id; database.SaveCharacterSpell(this->CharacterID(), spell_id, slot); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); if(update_client) { @@ -4883,7 +4883,7 @@ void Client::UnscribeSpell(int slot, bool update_client) if(slot >= MAX_PP_SPELLBOOK || slot < 0) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); m_pp.spell_book[slot] = 0xFFFFFFFF; database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[slot], slot); @@ -4914,7 +4914,7 @@ void Client::UntrainDisc(int slot, bool update_client) if(slot >= MAX_PP_DISCIPLINES || slot < 0) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); m_pp.disciplines.values[slot] = 0; database.DeleteCharacterDisc(this->CharacterID(), slot); @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + Log.Log(EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + Log.Log(EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - logger.Log(EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + Log.Log(EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } @@ -5040,7 +5040,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); - logger.Log(EQEmuLogSys::Normal, + Log.Log(EQEmuLogSys::Normal, "FindType: type = %d; value = %d; threshold = %d", type, value, threshold); if (value < threshold) @@ -5089,23 +5089,23 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; PermaProcs[i].base_spellID = base_spell_id; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); } else { for (i = 0; i < MAX_PROCS; i++) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; SpellProcs[i].base_spellID = base_spell_id;; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); } return false; } @@ -5116,7 +5116,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].chance = 0; SpellProcs[i].base_spellID = SPELL_UNKNOWN; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); } } return true; @@ -5133,7 +5133,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id DefensiveProcs[i].spellID = spell_id; DefensiveProcs[i].chance = iChance; DefensiveProcs[i].base_spellID = base_spell_id; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5148,7 +5148,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) DefensiveProcs[i].spellID = SPELL_UNKNOWN; DefensiveProcs[i].chance = 0; DefensiveProcs[i].base_spellID = SPELL_UNKNOWN; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); } } return true; @@ -5165,7 +5165,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id) RangedProcs[i].spellID = spell_id; RangedProcs[i].chance = iChance; RangedProcs[i].base_spellID = base_spell_id; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5180,7 +5180,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) RangedProcs[i].spellID = SPELL_UNKNOWN; RangedProcs[i].chance = 0; RangedProcs[i].base_spellID = SPELL_UNKNOWN;; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); } } return true; @@ -5211,7 +5211,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) int Mob::GetCasterLevel(uint16 spell_id) { int level = GetLevel(); level += itembonuses.effective_casting_level + spellbonuses.effective_casting_level + aabonuses.effective_casting_level; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); return(level); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 593926f38..3cae8a687 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() { int taskID = atoi(row[1]); TaskSets[taskSet].push_back(taskID); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); } return true; @@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() { bool TaskManager::LoadSingleTask(int TaskID) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false; @@ -115,21 +115,21 @@ bool TaskManager::LoadSingleTask(int TaskID) { void TaskManager::ReloadGoalLists() { if(!GoalListManager.LoadLists()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); } bool TaskManager::LoadTasks(int singleTask) { // If TaskID !=0, then just load the task specified. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); std::string query; if(singleTask == 0) { if(!GoalListManager.LoadLists()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); if(!LoadTaskSets()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, " "`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, " @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->SequenceMode = ActivitiesSequential; Tasks[taskID]->LastStep = 0; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward, Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel, Tasks[taskID]->Repeatable ? "Yes" : "No"); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - logger.Log(EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " + Log.Log(EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]); Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " "GoalMethod: %i, GoalCount: %3i, ZoneID:%3i", Tasks[taskID]->ActivityCount, activityID, taskID, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type, @@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); Tasks[taskID]->ActivityCount++; } @@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { int characterID = c->CharacterID(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { for(int task=0; taskActiveTasks[task].Updated) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) " "VALUES (%i, %i, %i, %i)", characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(!state->ActiveTasks[task].Activity[activityIndex].Updated) continue; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", characterID, task, activityIndex); if(updatedActivityCount==0) @@ -358,11 +358,11 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(updatedActivityCount == 0) continue; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { for(unsigned int i=state->LastCompletedTaskLoaded; iCompletedTasks.size(); i++) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); int taskID = state->CompletedTasks[i].TaskID; if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr)) @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -459,14 +459,14 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTaskCount = 0; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` " "FROM `character_tasks` " "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - logger.Log(EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); + Log.Log(EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - logger.Log(EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { ++state->ActiveTaskCount; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); } // Load Activities - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` " "FROM `character_activities` " @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,12 +634,12 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); state->EnabledTasks.push_back(taskID); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); } // Check that there is an entry in the client task state for every activity in each task @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - logger.Log(EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + Log.Log(EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - logger.Log(EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " + Log.Log(EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); return true; } @@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { } } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); for(unsigned int i=0; iGetLevel(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, state->EnabledTasks.size()); if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return; @@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if(TaskSets[TaskSetID][0] == 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); std::vector::iterator Iterator = TaskSets[TaskSetID].begin(); while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) { @@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) && (TaskListIndex < MAXCHOOSERENTRIES)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex, TaskSets[TaskSetID][TaskSetIndex]); @@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task return; } // Titanium OpCode: 0x5e7c - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); char *Ptr; int PlayerLevel = c->GetLevel(); @@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); int PlayerLevel = c->GetLevel(); @@ -1275,16 +1275,16 @@ int ClientTaskState::GetActiveTaskID(int index) { static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); } bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { @@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first // activity as active if not complete. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode); if(Task->SequenceMode == ActivitiesSequential) { @@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) { if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTasks.push_back(cti); } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); return AllActivitiesComplete; } @@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { bool CurrentStepComplete = true; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); // If CurrentStep is -1, this is the first call to this method since loading the // client state. Unlock all activities with a step number of 0 if(ActiveTasks[TaskIndex].CurrentStep == -1) { @@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // If we are only keeping one completed record per task, and the player has done // the same task again, erase the previous completed entry for this task. if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI int Ret = false; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); // If the client has no tasks, there is nothing further to check. @@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(Task->Activity[j].Type != ActivityType) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID); continue; } @@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI continue; } // We found an active task to kill this type of NPC, so increment the done count - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); IncrementDoneCount(c, Task, i, j); Ret = true; } @@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI // If the client has no tasks, there is nothing further to check. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); if(ActiveTaskCount == 0) return; @@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(Task->Activity[j].Type != (int)Type) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", c->GetName(), Type, ItemID); continue; } @@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI continue; } // We found an active task related to this item, so increment the done count - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); IncrementDoneCount(c, Task, i, j, Count); } } @@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { // If the client has no tasks, there is nothing further to check. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityExplore) continue; if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", c->GetName(), ExploreID); continue; } @@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { } // We found an active task to explore this area, so set done count to goal count // (Only a goal count of 1 makes sense for explore activities?) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); @@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i bool Ret = false; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); if(ActiveTaskCount == 0) return false; @@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i (Task->Activity[j].Type != ActivityGiveCash)) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID); continue; } @@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i // Is the activity related to these items ? // if((Task->Activity[j].Type == ActivityGiveCash) && Cash) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); IncrementDoneCount(c, Task, i, j, Cash); Ret = true; } @@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i continue; } // We found an active task related to this item, so increment the done count - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); IncrementDoneCount(c, Task, i, j, 1); Ret = true; } @@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { // If the client has no tasks, there is nothing further to check. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityTouch) continue; if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue; if(Task->Activity[j].ZoneID != ZoneID) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", c->GetName()); continue; } // We found an active task to zone into this zone, so set done count to goal count // (Only a goal count of 1 makes sense for touch activities?) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); } @@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { } void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count; @@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true; // Have we reached the goal count for this activity ? if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount, Task->Activity[ActivityID].GoalCount, ActivityID); @@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); // and by the 'Task Stage Completed' message c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex); // Send the updated task/activity list to the client @@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) { void ClientTaskState::FailTask(Client *c, int TaskID) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); if(ActiveTaskCount == 0) return; for(int i=0; i= Task->ActivityCount) return false; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State); @@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update); } void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0; @@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) { if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1; for(unsigned int i=0; iunknown04 = 0x00000002; - logger.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks, "SendTasksComplete"); + Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks, "SendTasksComplete"); DumpPacket(outapp); fflush(stdout); QueuePacket(outapp); @@ -2275,7 +2275,7 @@ void Client::SendTaskComplete(int TaskIndex) { void ClientTaskState::SendTaskHistory(Client *c, int TaskIndex) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Task History Requested for Completed Task Index %i", TaskIndex); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Task History Requested for Completed Task Index %i", TaskIndex); // We only sent the most recent 50 completed tasks, so we need to offset the Index the client sent to us. @@ -2406,7 +2406,7 @@ void Client::SendTaskFailed(int TaskID, int TaskIndex) { //tac->unknown5 = 0x00000001; tac->unknown5 = 0; // 0 for task complete or failed. - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); @@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) if(State->CompletedTasks.size() > 50) FirstTaskToSend = State->CompletedTasks.size() - 50; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend); /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { @@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, @@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, TaskComplete); @@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->SequenceNumber = SequenceNumber; cts->unknown4 = 0x00000002; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); @@ -2932,24 +2932,24 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { int characterID = c->CharacterID(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY; ActiveTaskCount--; @@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { // int FreeSlot = -1; for(int i=0; iProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } @@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() { bool TaskGoalListManager::LoadLists() { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); for(int i=0; i< NumberOfLists; i++) safe_delete_array(TaskGoalLists[i].GoalItemEntries); @@ -3088,12 +3088,12 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } NumberOfLists = results.RowCount(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); TaskGoalLists = new TaskGoalList_Struct[NumberOfLists]; @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3207,7 +3207,7 @@ std::vector TaskGoalListManager::GetListContents(int ListID) { bool TaskGoalListManager::IsInList(int ListID, int Entry) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); int ListIndex = GetListByID(ListID); @@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) { else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry]) LastEntry = MiddleEntry - 1; else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); return true; } @@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() { bool TaskProximityManager::LoadProximities(int zoneID) { TaskProximity proximity; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); TaskProximities.clear(); std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, " @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) { TaskProximity* P = &TaskProximities[i]; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ); if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY || diff --git a/zone/titles.cpp b/zone/titles.cpp index d90c63f6e..4867db69f 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + Log.Log(EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 7ac9cbaf5..2021901ab 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - logger.Log(EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + Log.Log(EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - logger.Log(EQEmuLogSys::Error, "Player tried to augment an item without a container set."); + Log.Log(EQEmuLogSys::Error, "Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - logger.Log(EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); + Log.Log(EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - logger.Log(EQEmuLogSys::Error, "Replace container combine executed in a world container."); + Log.Log(EQEmuLogSys::Error, "Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - logger.Log(EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + Log.Log(EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - logger.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); + Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - logger.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - logger.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - logger.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); + Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - logger.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { //handle caps if(spec->nofail) { chance = 100; //cannot fail. - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); } else if(over_trivial >= 0) { // At reaching trivial the chance goes to 95% going up an additional // percent for every 40 skillpoints above the trivial. @@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { chance = 95; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); float res = zone->random.Real(0, 99); int aa_chance = 0; @@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); itr = spec->onsuccess.begin(); while(itr != spec->onsuccess.end() && !spec->quest) { @@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(MT_Emote,TRADESKILL_FAILED); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); @@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float NotifyNewTitlesAvailable(); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); } bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - logger.Log(EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + Log.Log(EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - logger.Log(EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); + Log.Log(EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - logger.Log(EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + Log.Log(EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - logger.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); + Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,12 +1477,12 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if (results.RowCount() != 1) { - logger.Log(EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); + Log.Log(EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index ff0fc6f5e..99a2d42ed 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -86,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (!owner || !owner->IsClient()) { // This should never happen - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); return; } @@ -126,7 +126,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { inst2->SetCharges(stack_size + inst2->GetCharges()); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); if (_stack_size > 0) inst->SetCharges(_stack_size); @@ -143,7 +143,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { SendItemData(inst, trade_slot_id); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); client->DeleteItemInInventory(MainCursor); @@ -296,7 +296,7 @@ void Trade::LogTrade() void Trade::DumpTrade() { Mob* with = With(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) @@ -307,7 +307,7 @@ void Trade::DumpTrade() const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", inst->GetItem()->ID, inst->GetCharges(), i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); @@ -315,7 +315,7 @@ void Trade::DumpTrade() for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", inst->GetItem()->ID, inst->GetCharges(), Inventory::CalcSlotId(i, j)); } @@ -324,7 +324,7 @@ void Trade::DumpTrade() } } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); } #endif @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; if (partial_inst->GetID() != inst->GetID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -458,7 +458,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st bool qs_log = false; if(other) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); this->AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true); @@ -491,7 +491,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -552,17 +552,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; if (partial_inst->GetID() != inst->GetID()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -606,10 +606,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st inst->SetCharges(0); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); if (other->PutItemInInventory(partial_slot, *partial_inst, true)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, (old_charges - inst->GetCharges())); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -635,7 +635,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName(), (old_charges - inst->GetCharges())); inst->SetCharges(old_charges); @@ -710,7 +710,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -718,7 +718,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -772,17 +772,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -1160,7 +1160,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) { const Item_Struct* item = database.GetItem(ItemID); if(!item){ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); return; } @@ -1219,10 +1219,10 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } @@ -1245,7 +1245,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); return nullptr; } @@ -1302,7 +1302,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ } } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", SerialNumber , Quantity, this->GetName()); return 0; @@ -1311,7 +1311,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Customer,uint16 TraderSlot, int SerialNumber) { if(!Customer) return; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); if(Quantity < Charges) { Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber); m_inv.DeleteItem(Slot, Quantity); @@ -1395,7 +1395,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* if(!Stackable) Quantity = (Charges > 0) ? Charges : 1; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); } if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){ this->DeleteItemInInventory(SlotID, Quantity); @@ -1431,7 +1431,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* } } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, Quantity,this->GetName()); } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1510,13 +1510,13 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat const ItemInst* BuyItem = Trader->FindTraderItemBySerialNumber(tbs->ItemID); if(!BuyItem) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); TradeRequestFailed(app); safe_delete(outapp); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", BuyItem->GetItem()->Name, BuyItem->IsStackable(), tbs->Quantity, BuyItem->GetCharges()); // If the item is not stackable, then we can only be buying one of them. if(!BuyItem->IsStackable()) @@ -1534,12 +1534,12 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat outtbs->Quantity = tbs->Quantity; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - logger.Log(EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." + Log.Log(EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); @@ -1836,11 +1836,11 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); int Size = 0; uint32 ID = 0; @@ -1887,7 +1887,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint VARSTRUCT_ENCODE_TYPE(uint32, bufptr, ID); } else{ - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0); } Cost = atoi(row[5]); @@ -1981,7 +1981,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(inst->IsStackable()) inst->SetMerchantCount(gis->Charges[i]); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor? @@ -2018,7 +2018,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St if(gis->ItemID[i] == ItemID) { tdis->ItemID = gis->SerialNumber[i]; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); _pkt(TRADING__PACKETS, outapp); @@ -2031,7 +2031,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St return; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); ItemInst* inst = database.CreateItem(item); @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantSlot(gis->SerialNumber[i]); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor?? @@ -2073,7 +2073,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { // TraderPriceUpdate_Struct* tpus = (TraderPriceUpdate_Struct*)app->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", GetName(), tpus->SerialNumber, tpus->NewPrice); // Pull the items this Trader currently has for sale from the trader table. @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); if(!gis) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); return; } @@ -2101,7 +2101,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((gis->ItemID[i] > 0) && (gis->SerialNumber[i] == tpus->SerialNumber)) { // We found the item that the Trader wants to change the price of (or add back up for sale). // - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); IDOfItemToUpdate = gis->ItemID[i]; @@ -2127,7 +2127,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { return ; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); // Find what is in their Trader Satchels GetItems_Struct* newgis=GetTraderItems(); @@ -2140,7 +2140,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((newgis->Items[i] > 0) && (newgis->SerialNumber[i] == tpus->SerialNumber)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], newgis->Charges[i]); IDOfItemToAdd = newgis->Items[i]; @@ -2158,7 +2158,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if(!IDOfItemToAdd || !item) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); @@ -2203,7 +2203,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { gis->SerialNumber[i] = newgis->SerialNumber[i]; gis->ItemCost[i] = tpus->NewPrice; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", GetName(), newgis->Items[i], newgis->SerialNumber[i], newgis->Charges[i], tpus->NewPrice, i); } @@ -2249,7 +2249,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { QueuePacket(app); if(OldPrice == tpus->NewPrice) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); safe_delete(gis); return; } @@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { // This method is called when a potential seller in the /barter window searches for matching buyers // - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); char* escSearchString = new char[strlen(searchString) * 2 + 1]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2515,7 +2515,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Quantity = i; break; } - logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2523,7 +2523,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { - logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); if(ItemToTransfer) @@ -2561,7 +2561,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { int16 SellerSlot = m_inv.HasItem(ItemID, 1, invWhereWorn|invWherePersonal|invWhereCursor); if (SellerSlot == INVALID_INDEX) { - logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2569,7 +2569,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer) { - logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2581,7 +2581,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { QuantityMoved += ItemToTransfer->GetCharges(); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2616,7 +2616,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemToTransfer->SetCharges(QuantityToRemoveFromStack); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - logger.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2855,11 +2855,11 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { bool LoreConflict = CheckLoreConflict(item); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", GetName(), BuySlot, ItemID, item->Name, Quantity, ToggleOnOff, Price, ItemCount, LoreConflict); if((item->NoDrop != 0) && !LoreConflict && (Quantity > 0) && HasMoney(Quantity * Price) && ToggleOnOff && (ItemCount == 0)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); database.AddBuyLine(CharacterID(), BuySlot, ItemID, ItemName, Quantity, Price); QueuePacket(app); } diff --git a/zone/trap.cpp b/zone/trap.cpp index 6f8132c3c..51bf3b3ed 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index c9d5877c2..6ee71ee05 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - logger.Log(EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); + Log.Log(EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - logger.Log(EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + Log.Log(EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - logger.Log(EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + Log.Log(EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 45f8db13f..bf7bdc143 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -88,7 +88,7 @@ void NPC::StopWandering() roamer=false; CastToNPC()->SetGrid(0); SendPosition(); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); return; } @@ -107,16 +107,16 @@ void NPC::ResumeWandering() cur_wp=save_wp; UpdateWaypoint(cur_wp); // have him head to last destination from here } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); } else if (AIwalking_timer->Enabled()) { // we are at a waypoint paused normally - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); AIwalking_timer->Trigger(); // disable timer to end pause now } else { - logger.Log(EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Log(EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - logger.Log(EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Log(EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -143,7 +143,7 @@ void NPC::PauseWandering(int pausetime) if (GetGrid() != 0) { DistractedFromGrid = true; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); SendPosition(); if (pausetime<1) { // negative grid number stops him dead in his tracks until ResumeWandering() @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - logger.Log(EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Log(EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -166,7 +166,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if (GetGrid() < 0) { // currently stopped by a quest command SetGrid( 0 - GetGrid()); // get him moving again - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); } AIwalking_timer->Disable(); // disable timer in case he is paused at a wp if (cur_wp>=0) @@ -174,14 +174,14 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) save_wp=cur_wp; // save the current waypoint cur_wp=-1; // flag this move as quest controlled } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); } else { // not on a grid roamer=true; save_wp=0; cur_wp=-2; // flag as quest controlled w/no grid - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); } if (saveguardspot) { @@ -196,7 +196,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if(guard_heading == -1) guard_heading = this->CalculateHeadingToTarget(mtx, mty); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } cur_wp_x = mtx; @@ -212,7 +212,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) void NPC::UpdateWaypoint(int wp_index) { if(wp_index >= static_cast(Waypoints.size())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); return; } std::vector::iterator cur; @@ -224,7 +224,7 @@ void NPC::UpdateWaypoint(int wp_index) cur_wp_z = cur->z; cur_wp_pause = cur->pause; cur_wp_heading = cur->heading; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); //fix up pathing Z if(zone->HasMap() && RuleB(Map, FixPathingZAtWaypoints)) @@ -430,7 +430,7 @@ void NPC::SetWaypointPause() void NPC::SaveGuardSpot(bool iClearGuardSpot) { if (iClearGuardSpot) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); guard_x = 0; guard_y = 0; guard_z = 0; @@ -443,14 +443,14 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) { guard_heading = heading; if(guard_heading == 0) guard_heading = 0.0001; //hack to make IsGuarding simpler - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } } void NPC::NextGuardPosition() { if (!CalculateNewPosition2(guard_x, guard_y, guard_z, GetMovespeed())) { SetHeading(guard_heading); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); } else if((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z)) { @@ -516,15 +516,15 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords if(z_pos-z != 0) { z_pos = z; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); return true; } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); return false; } else if ((ABS(x_pos - x) < 0.1) && (ABS(y_pos - y) < 0.1)) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); if(IsNPC()) { entity_list.ProcessMove(CastToNPC(), x, y, z); @@ -550,7 +550,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); uint8 NPCFlyMode = 0; @@ -569,7 +569,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -612,7 +612,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b //pRunAnimSpeed = (int8)(speed*NPC_RUNANIM_RATIO); //speed *= NPC_SPEED_MULTIPLIER; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -647,7 +647,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b z_pos = new_z; tar_ndx=22-numsteps; heading = CalculateHeadingToTarget(x, y); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } else { @@ -659,7 +659,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = y; z_pos = z; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); } } @@ -678,7 +678,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; heading = CalculateHeadingToTarget(x, y); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } uint8 NPCFlyMode = 0; @@ -698,7 +698,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -759,7 +759,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec moved=false; } SetRunAnimSpeed(0); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); return true; } @@ -773,7 +773,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec pRunAnimSpeed = (uint8)(speed*NPC_RUNANIM_RATIO); speed *= NPC_SPEED_MULTIPLIER; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -790,7 +790,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = x; y_pos = y; z_pos = z; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); } else { float new_x = x_pos + tar_vx*tar_vector; @@ -803,7 +803,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = new_x; y_pos = new_y; z_pos = new_z; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); } uint8 NPCFlyMode = 0; @@ -823,7 +823,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -951,7 +951,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { x_pos = new_x; y_pos = new_y; z_pos = new_z; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); if(flymode == FlyMode1) return; @@ -967,7 +967,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -998,7 +998,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - logger.Log(EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - logger.Log(EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 7bbd5db5d..6bbe3d3ab 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,12 +155,12 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); ZoneConfig::SetZonePort(sci->port); break; } case ServerOP_ZAAuthFailed: { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; @@ -386,12 +386,12 @@ void WorldServer::Process() { } } else { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); } } else - logger.Log(EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); + Log.Log(EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); break; } case ServerOP_EmoteMessage: { @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -748,7 +748,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - logger.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); + Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); @@ -1381,7 +1381,7 @@ void WorldServer::Process() { if(NewCorpse) NewCorpse->Spawn(); else - logger.Log(EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); + Log.Log(EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); break; } @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret; @@ -2005,14 +2005,14 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) { ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); switch(rts->Command) { case RELOADTASKS: entity_list.SaveAllClientsTaskState(); if(rts->Parameter == 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); safe_delete(taskmanager); taskmanager = new TaskManager; taskmanager->LoadTasks(); @@ -2021,7 +2021,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) entity_list.ReloadAllClientsTaskState(); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); taskmanager->LoadTasks(rts->Parameter); entity_list.ReloadAllClientsTaskState(rts->Parameter); } @@ -2030,23 +2030,23 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) case RELOADTASKPROXIMITIES: if(zone) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); taskmanager->LoadProximities(zone->GetZoneID()); } break; case RELOADTASKGOALLISTS: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); taskmanager->ReloadGoalLists(); break; case RELOADTASKSETS: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); taskmanager->LoadTaskSets(); break; default: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); } @@ -2061,7 +2061,7 @@ uint32 WorldServer::NextGroupID() { if(cur_groupid >= last_groupid) { //this is an error... This means that 50 groups were created before //1 packet could make the zone->world->zone trip... so let it error. - logger.Log(EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); + Log.Log(EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); return(0); } if(cur_groupid > (last_groupid - /*50*/995)) { diff --git a/zone/zone.cpp b/zone/zone.cpp index b79335ad0..677284a59 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -90,7 +90,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - logger.Log(EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + Log.Log(EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - logger.Log(EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); + Log.Log(EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); zone->merchantvar = log_levels[1]; - logger.Log(EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); + Log.Log(EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); zone->tradevar = log_levels[2]; - logger.Log(EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); + Log.Log(EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); zone->lootvar = log_levels[3]; - logger.Log(EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); + Log.Log(EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); } else { zone->loglevelvar = uint8(atoi(tmp)); //continue supporting only command logging (for now) @@ -144,15 +144,15 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { delete pack; } - logger.Log(EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - logger.Log(EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + Log.Log(EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); + Log.Log(EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); /* Set Logging */ - logger.StartFileLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + Log.StartFileLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); return true; } @@ -167,11 +167,11 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } - logger.Log(EQEmuLogSys::Status, "Loading Objects from DB..."); + Log.Log(EQEmuLogSys::Status, "Loading Objects from DB..."); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { @@ -288,7 +288,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - logger.Log(EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); + Log.Log(EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name=0; @@ -402,7 +402,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - logger.Log(EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); + Log.Log(EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -474,7 +474,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - logger.Log(EQEmuLogSys::Status, "Loading Merchant Lists..."); + Log.Log(EQEmuLogSys::Status, "Loading Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() { std::map >::iterator cur; uint32 npcid = 0; if (results.RowCount() == 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); return; } for (auto row = results.begin(); row != results.end(); ++row) { @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); return; } @@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){ } if(MERC_DEBUG > 0) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); } @@ -707,11 +707,11 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - logger.Log(EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + Log.Log(EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) - logger.Log(EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); + Log.Log(EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); ZoneLoaded = false; zone->ResetAuth(); @@ -720,24 +720,24 @@ void Zone::Shutdown(bool quite) parse->ReloadQuests(true); UpdateWindowTitle(); - logger.CloseFileLogs(); + Log.CloseFileLogs(); } void Zone::LoadZoneDoors(const char* zone, int16 version) { - logger.Log(EQEmuLogSys::Status, "Loading doors for %s ...", zone); + Log.Log(EQEmuLogSys::Status, "Loading doors for %s ...", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - logger.Log(EQEmuLogSys::Status, "... No doors loaded."); + Log.Log(EQEmuLogSys::Status, "... No doors loaded."); return; } Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - logger.Log(EQEmuLogSys::Error, "... Failed to load doors."); + Log.Log(EQEmuLogSys::Error, "... Failed to load doors."); delete[] dlist; return; } @@ -801,12 +801,12 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); if(graveyard_id() > 0) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); if(GraveYardLoaded) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - logger.Log(EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + Log.Log(EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); Weather_Timer = new Timer(60000); Weather_Timer->Start(); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); zone_weather = 0; weather_intensity = 0; blocked_spells = nullptr; @@ -899,56 +899,56 @@ Zone::~Zone() { bool Zone::Init(bool iStaticZone) { SetStaticZone(iStaticZone); - logger.Log(EQEmuLogSys::Status, "Loading spawn conditions..."); + Log.Log(EQEmuLogSys::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - logger.Log(EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); + Log.Log(EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } - logger.Log(EQEmuLogSys::Status, "Loading static zone points..."); + Log.Log(EQEmuLogSys::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error, "Loading static zone points failed."); + Log.Log(EQEmuLogSys::Error, "Loading static zone points failed."); return false; } - logger.Log(EQEmuLogSys::Status, "Loading spawn groups..."); + Log.Log(EQEmuLogSys::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - logger.Log(EQEmuLogSys::Error, "Loading spawn groups failed."); + Log.Log(EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } - logger.Log(EQEmuLogSys::Status, "Loading spawn2 points..."); + Log.Log(EQEmuLogSys::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error, "Loading spawn2 points failed."); + Log.Log(EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } - logger.Log(EQEmuLogSys::Status, "Loading player corpses..."); + Log.Log(EQEmuLogSys::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - logger.Log(EQEmuLogSys::Error, "Loading player corpses failed."); + Log.Log(EQEmuLogSys::Error, "Loading player corpses failed."); return false; } - logger.Log(EQEmuLogSys::Status, "Loading traps..."); + Log.Log(EQEmuLogSys::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error, "Loading traps failed."); + Log.Log(EQEmuLogSys::Error, "Loading traps failed."); return false; } - logger.Log(EQEmuLogSys::Status, "Loading adventure flavor text..."); + Log.Log(EQEmuLogSys::Status, "Loading adventure flavor text..."); LoadAdventureFlavor(); - logger.Log(EQEmuLogSys::Status, "Loading ground spawns..."); + Log.Log(EQEmuLogSys::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - logger.Log(EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); + Log.Log(EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } - logger.Log(EQEmuLogSys::Status, "Loading World Objects from DB..."); + Log.Log(EQEmuLogSys::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - logger.Log(EQEmuLogSys::Error, "Loading World Objects failed. continuing."); + Log.Log(EQEmuLogSys::Error, "Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1005,10 +1005,10 @@ bool Zone::Init(bool iStaticZone) { } } - logger.Log(EQEmuLogSys::Status, "Loading timezone data..."); + Log.Log(EQEmuLogSys::Status, "Loading timezone data..."); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - logger.Log(EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + Log.Log(EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1019,32 +1019,32 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - logger.Log(EQEmuLogSys::Status, "Reloading Zone Static Data..."); + Log.Log(EQEmuLogSys::Status, "Reloading Zone Static Data..."); - logger.Log(EQEmuLogSys::Status, "Reloading static zone points..."); + Log.Log(EQEmuLogSys::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error, "Loading static zone points failed."); + Log.Log(EQEmuLogSys::Error, "Loading static zone points failed."); } - logger.Log(EQEmuLogSys::Status, "Reloading traps..."); + Log.Log(EQEmuLogSys::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - logger.Log(EQEmuLogSys::Error, "Reloading traps failed."); + Log.Log(EQEmuLogSys::Error, "Reloading traps failed."); } - logger.Log(EQEmuLogSys::Status, "Reloading ground spawns..."); + Log.Log(EQEmuLogSys::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - logger.Log(EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); + Log.Log(EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); - logger.Log(EQEmuLogSys::Status, "Reloading World Objects from DB..."); + Log.Log(EQEmuLogSys::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - logger.Log(EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); + Log.Log(EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1060,7 +1060,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - logger.Log(EQEmuLogSys::Status, "Zone Static Data Reloaded."); + Log.Log(EQEmuLogSys::Status, "Zone Static Data Reloaded."); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault) @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - logger.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - logger.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1098,7 +1098,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - logger.Log(EQEmuLogSys::Status, "Successfully loaded Zone Config."); + Log.Log(EQEmuLogSys::Status, "Successfully loaded Zone Config."); return true; } @@ -1403,11 +1403,11 @@ void Zone::ChangeWeather() weathertimer = weatherTimerRule*1000; Weather_Timer->Start(weathertimer); } - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); } else { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); this->weatherSend(); } } @@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) { quest_manager.ClearAllTimers(); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); initgrids_timer.Start(); @@ -1580,8 +1580,8 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien { if(client) client->CheatDetected(MQZoneUnknownDest, x, y, z); // Someone is trying to use /zone - logger.Log(EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - logger.Log(EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); + Log.Log(EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); + Log.Log(EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); } if(closest_dist > max_distance2) @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - logger.Log(EQEmuLogSys::Error, "... Failed to load blocked spells."); + Log.Log(EQEmuLogSys::Error, "... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 6e15155cf..8a8c82e59 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - logger.Log(EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); + Log.Log(EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -523,14 +523,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } loadti->Code = BazaarTrader_ShowItems; for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -548,13 +548,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -574,7 +574,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { return nullptr; if (results.RowCount() == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); return nullptr; } @@ -587,7 +587,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { const Item_Struct *item = database.GetItem(ItemID); if(!item) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); fflush(stdout); return nullptr; } @@ -597,7 +597,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { ItemInst* inst = database.CreateItem(item); if(!inst) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); fflush(stdout); return nullptr; } @@ -619,25 +619,25 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i", Charges, CharID, SerialNumber); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", SerialNumber, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); const Item_Struct *item = database.GetItem(ItemID); @@ -645,12 +645,12 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg return; if(NewPrice == 0) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 char_id){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); return; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { @@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteBuyLines(uint32 CharID) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); return; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); } @@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons CharID, BuySlot, ItemID, ItemName, Quantity, Price); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity) std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); return true; } @@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u /* Save Home Bind Point */ std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } @@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i uint8 blue = (color & 0x000000FF); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); return true; } bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); return true; } bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); auto results = QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); return true; } @@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); } } return true; @@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } @@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla m_epp->expended_aa ); auto results = database.QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); return true; } @@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru pp->currentEbonCrystals, pp->careerEbonCrystals); auto results = database.QueryDatabase(query); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); return true; } @@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur " VALUES (%u, %u, %u)", character_id, aa_id, current_level); auto results = QueryDatabase(rquery); - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2696,7 +2696,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - logger.Log(EQEmuLogSys::Status, "Loading Blocked Spells from database..."); + Log.Log(EQEmuLogSys::Status, "Loading Blocked Spells from database..."); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapCharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - logger.Log(EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); + Log.Log(EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - logger.Log(EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); + Log.Log(EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 37ea17eb5..c883dc78d 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -44,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { zoning = true; if (app->size != sizeof(ZoneChange_Struct)) { - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); return; } #if EQDEBUG >= 5 - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); DumpPacket(app); #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - logger.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - logger.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - logger.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + Log.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - logger.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + Log.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -193,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { switch(zone_mode) { case EvacToSafeCoords: case ZoneToSafeCoords: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); dest_x = safe_x; dest_y = safe_y; dest_z = safe_z; @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - logger.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + Log.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - logger.Log(EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + Log.Log(EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - logger.Log(EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + Log.Log(EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -347,7 +347,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - logger.Log(EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + Log.Log(EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - logger.Log(EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + Log.Log(EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -534,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z heading = m_pp.binds[0].heading; zonesummon_ignorerestrictions = 1; - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); break; case SummonPC: zonesummon_x = x_pos = x; @@ -543,14 +543,14 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; case Rewind: - logger.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); zonesummon_x = x_pos = x; zonesummon_y = y_pos = y; zonesummon_z = z_pos = z; SetHeading(heading); break; default: - logger.Log(EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + Log.Log(EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z safe_delete(outapp); } - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); //Clear zonesummon variables if we're zoning to our own zone //Client wont generate a zone change packet to the server in this case so //They aren't needed and it keeps behavior on next zone attempt from being undefined. @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - logger.Log(EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //this should not happen... - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); return(false); } if(GetLevel() < minlevel) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); return(false); } if(Admin() < minstatus) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); return(false); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { - logger.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); return(false); } } From 1496f148432d09e26501a2c83468b7d4df7d8ff3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 00:56:26 -0600 Subject: [PATCH 160/707] Remove old function code from consolidation --- common/eqemu_logsys.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 8e3448e5b..c10185570 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -190,18 +190,6 @@ void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, log_category, output_debug_message); } -// void EQEmuLogSys::LogDebug(DebugLevel debug_level, std::string message, ...) -// { -// va_list args; -// va_start(args, message); -// std::string output_message = vStringFormat(message.c_str(), args); -// va_end(args); -// -// EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, 0, output_message); -// EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, 0, output_message); -// EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, 0, output_message); -// } - void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) { if (log_type > EQEmuLogSys::MaxLogID){ From ef04c90d8e794ded51b6d57eb61c613ef66eda12 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:04:59 -0600 Subject: [PATCH 161/707] Remove new log prefix from console output --- common/eqemu_logsys.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index c10185570..d8c73adca 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -168,7 +168,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, co } #endif - std::cout << "[N::" << TypeNames[log_type] << "] " << message << "\n"; + std::cout << "[" << TypeNames[log_type] << "] " << message << "\n"; #ifdef _WINDOWS /* Always set back to white*/ From 975c298c85db52c43a5b7cfdc7c1fc88b841d1b3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:24:35 -0600 Subject: [PATCH 162/707] Consolidate 'LogType' over to 'LogCategory' --- common/eqemu_logsys.h | 85 +++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 97cffc9dd..4a4a26f7a 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -48,45 +48,52 @@ public: Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; - /* If you add to this, make sure you update LogCategoryName */ + /* + If you add to this, make sure you update LogCategoryName + NOTE: Only add to the bottom of the enum because that is the type ID assignment + */ enum LogCategory { None = 0, - Zone_Server = 1, - World_Server, - UCS_Server, - QS_Server, - WebInterface_Server, AA, + AI, + Aggro, + Attack, + Client_Server_Packet, + Combat, + Commands, + Crash, + Debug, Doors, + Error, Guilds, Inventory, Launcher, Netcode, + Normal, Object, + Pathing, + QS_Server, + Quests, Rules, Skills, Spawns, Spells, - Tasks, - Trading, - Tradeskills, - Tribute, + Status, TCP_Connection, - Client_Server_Packet, - Aggro, - Attack, - Quests, - AI, - Combat, - Pathing, + Tasks, + Tradeskills, + Trading, + Tribute, + UCS_Server, + WebInterface_Server, + World_Server, + Zone_Server, MaxCategoryID /* Don't Remove this*/ }; void CloseFileLogs(); void LoadLogSettingsDefaults(); void Log(uint16 log_type, const std::string message, ...); - //void LogDebug(DebugLevel debug_level, std::string message, ...); - //void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); @@ -120,34 +127,40 @@ extern EQEmuLogSys Log; /* If you add to this, make sure you update LogCategory */ static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { "", - "Zone", - "World", - "UCS", - "QueryServer", - "WebInterface", "AA", + "AI", + "Aggro", + "Attack", + "Client_Server_Packet", + "Combat", + "Commands", + "Crash", + "Debug", "Doors", - "Guild", + "Error", + "Guilds", "Inventory", "Launcher", "Netcode", + "Normal", "Object", + "Pathing", + "QS_Server", + "Quests", "Rules", "Skills", "Spawns", "Spells", - "Tasks", - "Trading", - "Tradeskills", - "Tribute", + "Status", "TCP_Connection", - "Client_Server_Packet", - "Aggro", - "Attack", - "Quests", - "AI", - "Combat", - "Pathing" + "Tasks", + "Tradeskills", + "Trading", + "Tribute", + "UCS_Server", + "WebInterface_Server", + "World_Server", + "Zone_Server", }; #endif \ No newline at end of file From e9f8d5fa6d859083624ec25790c461aba4958566 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:27:52 -0600 Subject: [PATCH 163/707] Port Status messages from Type to Category --- client_files/export/main.cpp | 10 +++--- client_files/import/main.cpp | 14 ++++---- common/database.cpp | 2 +- queryserv/database.cpp | 2 +- shared_memory/main.cpp | 16 ++++----- ucs/database.cpp | 2 +- world/worlddb.cpp | 10 +++--- zone/aa.cpp | 6 ++-- zone/client_packet.cpp | 2 +- zone/command.cpp | 2 +- zone/doors.cpp | 2 +- zone/embparser.cpp | 2 +- zone/pathing.cpp | 4 +-- zone/zone.cpp | 66 ++++++++++++++++++------------------ zone/zonedb.cpp | 2 +- zone/zoning.cpp | 2 +- 16 files changed, 72 insertions(+), 72 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 1b129e552..5d421b50c 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -38,7 +38,7 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.Log(EQEmuLogSys::Status, "Client Files Export Utility"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; @@ -50,7 +50,7 @@ int main(int argc, char **argv) { } SharedDatabase database; - Log.Log(EQEmuLogSys::Status, "Connecting to database..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " @@ -66,7 +66,7 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - Log.Log(EQEmuLogSys::Status, "Exporting Spells..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells..."); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { @@ -140,7 +140,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - Log.Log(EQEmuLogSys::Status, "Exporting Skill Caps..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps..."); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { @@ -169,7 +169,7 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - Log.Log(EQEmuLogSys::Status, "Exporting Base Data..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data..."); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 6e65df96b..810309f36 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -36,7 +36,7 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.Log(EQEmuLogSys::Status, "Client Files Import Utility"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; @@ -48,7 +48,7 @@ int main(int argc, char **argv) { } SharedDatabase database; - Log.Log(EQEmuLogSys::Status, "Connecting to database..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " @@ -76,7 +76,7 @@ int GetSpellColumns(SharedDatabase *db) { } void ImportSpells(SharedDatabase *db) { - Log.Log(EQEmuLogSys::Status, "Importing Spells..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { Log.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); @@ -142,19 +142,19 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - Log.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); } } if(spells_imported % 1000 != 0) { - Log.Log(EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - Log.Log(EQEmuLogSys::Status, "Importing Skill Caps..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Skill Caps..."); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { @@ -190,7 +190,7 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - Log.Log(EQEmuLogSys::Status, "Importing Base Data..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Base Data..."); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { diff --git a/common/database.cpp b/common/database.cpp index 5c506fd53..14b461a01 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -89,7 +89,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c return false; } else { - Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index c7c4ec8c9..55c26e47e 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -76,7 +76,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c } else { - Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 765d08c22..0797662eb 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -40,7 +40,7 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.Log(EQEmuLogSys::Status, "Shared Memory Loader Program"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); return 1; @@ -52,7 +52,7 @@ int main(int argc, char **argv) { } SharedDatabase database; - Log.Log(EQEmuLogSys::Status, "Connecting to database..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " @@ -114,7 +114,7 @@ int main(int argc, char **argv) { } if(load_all || load_items) { - Log.Log(EQEmuLogSys::Status, "Loading items..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading items..."); try { LoadItems(&database); } catch(std::exception &ex) { @@ -124,7 +124,7 @@ int main(int argc, char **argv) { } if(load_all || load_factions) { - Log.Log(EQEmuLogSys::Status, "Loading factions..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading factions..."); try { LoadFactions(&database); } catch(std::exception &ex) { @@ -134,7 +134,7 @@ int main(int argc, char **argv) { } if(load_all || load_loot) { - Log.Log(EQEmuLogSys::Status, "Loading loot..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading loot..."); try { LoadLoot(&database); } catch(std::exception &ex) { @@ -144,7 +144,7 @@ int main(int argc, char **argv) { } if(load_all || load_skill_caps) { - Log.Log(EQEmuLogSys::Status, "Loading skill caps..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading skill caps..."); try { LoadSkillCaps(&database); } catch(std::exception &ex) { @@ -154,7 +154,7 @@ int main(int argc, char **argv) { } if(load_all || load_spells) { - Log.Log(EQEmuLogSys::Status, "Loading spells..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spells..."); try { LoadSpells(&database); } catch(std::exception &ex) { @@ -164,7 +164,7 @@ int main(int argc, char **argv) { } if(load_all || load_bd) { - Log.Log(EQEmuLogSys::Status, "Loading base data..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading base data..."); try { LoadBaseData(&database); } catch(std::exception &ex) { diff --git a/ucs/database.cpp b/ucs/database.cpp index d437e3d64..f189e0639 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -81,7 +81,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c } else { - Log.Log(EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 72c90f494..19f3b831d 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -302,7 +302,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* return false; } - Log.Log(EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* } } else { - Log.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.Log(EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru } } else { - Log.Log(EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); diff --git a/zone/aa.cpp b/zone/aa.cpp index 13ab491d6..b7cb4e7d4 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1429,7 +1429,7 @@ SendAA_Struct* Zone::FindAA(uint32 id) { } void Zone::LoadAAs() { - Log.Log(EQEmuLogSys::Status, "Loading AA information..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { Log.Log(EQEmuLogSys::Error, "Failed to load AAs!"); @@ -1447,9 +1447,9 @@ void Zone::LoadAAs() { } //load AA Effects into aa_effects - Log.Log(EQEmuLogSys::Status, "Loading AA Effects..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA Effects..."); if (database.LoadAAEffects2()) - Log.Log(EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); else Log.Log(EQEmuLogSys::Error, "Failed to load AA Effects!"); } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index a39ad8fa2..b85dbf1a7 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6135,7 +6135,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) return; } Client* client = entity_list.GetClientByName(gmn->oldname); - Log.Log(EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(13, "%s not found for name change. Operation failed!", gmn->oldname); diff --git a/zone/command.cpp b/zone/command.cpp index 2e8ecc8f8..f4aaca5e1 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -449,7 +449,7 @@ int command_init(void) { { #ifdef COMMANDS_WARNINGS if(cur->second->access == 0) - Log.Log(EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); #endif } } diff --git a/zone/doors.cpp b/zone/doors.cpp index 6e4640d23..8ac166ddc 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) { - Log.Log(EQEmuLogSys::Status, "Loading Doors from database..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Doors from database..."); // Door tmpDoor; diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 2a9575f8c..e015b14c8 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - Log.Log(EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 343711a65..06a99ade3 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -61,7 +61,7 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) if(Ret->loadPaths(PathFile)) { - Log.Log(EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); } else @@ -109,7 +109,7 @@ bool PathManager::loadPaths(FILE *PathFile) fread(&Head, sizeof(Head), 1, PathFile); - Log.Log(EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", (long)Head.version, (long)Head.PathNodeCount); if(Head.version != 2) diff --git a/zone/zone.cpp b/zone/zone.cpp index 677284a59..6a5f9a9bb 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -90,7 +90,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - Log.Log(EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - Log.Log(EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); zone->merchantvar = log_levels[1]; - Log.Log(EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); zone->tradevar = log_levels[2]; - Log.Log(EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); zone->lootvar = log_levels[3]; - Log.Log(EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); } else { zone->loglevelvar = uint8(atoi(tmp)); //continue supporting only command logging (for now) @@ -145,7 +145,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { } Log.Log(EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - Log.Log(EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); @@ -171,7 +171,7 @@ bool Zone::LoadZoneObjects() { return false; } - Log.Log(EQEmuLogSys::Status, "Loading Objects from DB..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Objects from DB..."); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { @@ -288,7 +288,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - Log.Log(EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name=0; @@ -402,7 +402,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - Log.Log(EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -474,7 +474,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - Log.Log(EQEmuLogSys::Status, "Loading Merchant Lists..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -707,7 +707,7 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - Log.Log(EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) @@ -725,12 +725,12 @@ void Zone::Shutdown(bool quite) void Zone::LoadZoneDoors(const char* zone, int16 version) { - Log.Log(EQEmuLogSys::Status, "Loading doors for %s ...", zone); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading doors for %s ...", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - Log.Log(EQEmuLogSys::Status, "... No doors loaded."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "... No doors loaded."); return; } @@ -899,53 +899,53 @@ Zone::~Zone() { bool Zone::Init(bool iStaticZone) { SetStaticZone(iStaticZone); - Log.Log(EQEmuLogSys::Status, "Loading spawn conditions..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { Log.Log(EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } - Log.Log(EQEmuLogSys::Status, "Loading static zone points..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { Log.Log(EQEmuLogSys::Error, "Loading static zone points failed."); return false; } - Log.Log(EQEmuLogSys::Status, "Loading spawn groups..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { Log.Log(EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } - Log.Log(EQEmuLogSys::Status, "Loading spawn2 points..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { Log.Log(EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } - Log.Log(EQEmuLogSys::Status, "Loading player corpses..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { Log.Log(EQEmuLogSys::Error, "Loading player corpses failed."); return false; } - Log.Log(EQEmuLogSys::Status, "Loading traps..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { Log.Log(EQEmuLogSys::Error, "Loading traps failed."); return false; } - Log.Log(EQEmuLogSys::Status, "Loading adventure flavor text..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading adventure flavor text..."); LoadAdventureFlavor(); - Log.Log(EQEmuLogSys::Status, "Loading ground spawns..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { Log.Log(EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } - Log.Log(EQEmuLogSys::Status, "Loading World Objects from DB..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { Log.Log(EQEmuLogSys::Error, "Loading World Objects failed. continuing."); @@ -1005,10 +1005,10 @@ bool Zone::Init(bool iStaticZone) { } } - Log.Log(EQEmuLogSys::Status, "Loading timezone data..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading timezone data..."); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - Log.Log(EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1019,29 +1019,29 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - Log.Log(EQEmuLogSys::Status, "Reloading Zone Static Data..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading Zone Static Data..."); - Log.Log(EQEmuLogSys::Status, "Reloading static zone points..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { Log.Log(EQEmuLogSys::Error, "Loading static zone points failed."); } - Log.Log(EQEmuLogSys::Status, "Reloading traps..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { Log.Log(EQEmuLogSys::Error, "Reloading traps failed."); } - Log.Log(EQEmuLogSys::Status, "Reloading ground spawns..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { Log.Log(EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); - Log.Log(EQEmuLogSys::Status, "Reloading World Objects from DB..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { Log.Log(EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); @@ -1060,7 +1060,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - Log.Log(EQEmuLogSys::Status, "Zone Static Data Reloaded."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Static Data Reloaded."); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault) @@ -1098,7 +1098,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - Log.Log(EQEmuLogSys::Status, "Successfully loaded Zone Config."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Successfully loaded Zone Config."); return true; } @@ -1580,8 +1580,8 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien { if(client) client->CheatDetected(MQZoneUnknownDest, x, y, z); // Someone is trying to use /zone - Log.Log(EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - Log.Log(EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); } if(closest_dist > max_distance2) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 8a8c82e59..69bae78dc 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2696,7 +2696,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - Log.Log(EQEmuLogSys::Status, "Loading Blocked Spells from database..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Blocked Spells from database..."); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); diff --git a/zone/zoning.cpp b/zone/zoning.cpp index c883dc78d..ec99be644 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -347,7 +347,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - Log.Log(EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it From b3fc0ab06de36ef84c4e49574b7d3a58df8e04bf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:29:28 -0600 Subject: [PATCH 164/707] Consolidate 'LogType' Crash logs over to 'LogCategory' --- common/crash.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/common/crash.cpp b/common/crash.cpp index bbc9c3f49..e573ea1a5 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -25,7 +25,7 @@ public: } } - Log.Log(EQEmuLogSys::Crash, buffer); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, buffer); StackWalker::OnOutput(szText); } }; @@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) switch(ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); break; case EXCEPTION_BREAKPOINT: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); break; case EXCEPTION_DATATYPE_MISALIGNMENT: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); break; case EXCEPTION_FLT_DENORMAL_OPERAND: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); break; case EXCEPTION_FLT_INEXACT_RESULT: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); break; case EXCEPTION_FLT_INVALID_OPERATION: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); break; case EXCEPTION_FLT_OVERFLOW: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); break; case EXCEPTION_FLT_STACK_CHECK: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); break; case EXCEPTION_FLT_UNDERFLOW: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); break; case EXCEPTION_ILLEGAL_INSTRUCTION: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); break; case EXCEPTION_IN_PAGE_ERROR: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); break; case EXCEPTION_INT_OVERFLOW: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); break; case EXCEPTION_INVALID_DISPOSITION: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); break; case EXCEPTION_NONCONTINUABLE_EXCEPTION: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); break; case EXCEPTION_PRIV_INSTRUCTION: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); break; case EXCEPTION_SINGLE_STEP: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); break; case EXCEPTION_STACK_OVERFLOW: - Log.Log(EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); break; default: - Log.Log(EQEmuLogSys::Crash, "Unknown Exception"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "Unknown Exception"); break; } From e691735a2d8d01ce4f7ca9519160b7f9f7dbdc1a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:30:25 -0600 Subject: [PATCH 165/707] Consolidate 'LogType' Error logs over to 'LogCategory' --- client_files/export/main.cpp | 20 ++-- client_files/import/main.cpp | 14 +-- common/database.cpp | 26 ++--- common/eqtime.cpp | 6 +- common/guild_base.cpp | 2 +- common/item.cpp | 2 +- common/ptimer.cpp | 14 +-- common/rulesys.cpp | 8 +- common/shareddb.cpp | 94 +++++++-------- queryserv/database.cpp | 2 +- shared_memory/main.cpp | 18 +-- ucs/database.cpp | 2 +- world/adventure.cpp | 4 +- world/adventure_manager.cpp | 6 +- world/eql_config.cpp | 22 ++-- world/worlddb.cpp | 8 +- zone/aa.cpp | 32 +++--- zone/attack.cpp | 10 +- zone/bot.cpp | 20 ++-- zone/client.cpp | 18 +-- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 216 +++++++++++++++++------------------ zone/client_process.cpp | 2 +- zone/command.cpp | 4 +- zone/corpse.cpp | 2 +- zone/effects.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embxs.cpp | 2 +- zone/entity.cpp | 12 +- zone/exp.cpp | 2 +- zone/forage.cpp | 6 +- zone/groups.cpp | 24 ++-- zone/guild.cpp | 4 +- zone/guild_mgr.cpp | 28 ++--- zone/horse.cpp | 6 +- zone/inventory.cpp | 16 +-- zone/merc.cpp | 8 +- zone/mob_ai.cpp | 2 +- zone/net.cpp | 34 +++--- zone/npc.cpp | 18 +-- zone/object.cpp | 8 +- zone/pathing.cpp | 10 +- zone/petitions.cpp | 8 +- zone/pets.cpp | 16 +-- zone/questmgr.cpp | 4 +- zone/raids.cpp | 18 +-- zone/spawn2.cpp | 22 ++-- zone/spawngroup.cpp | 6 +- zone/spell_effects.cpp | 2 +- zone/spells.cpp | 14 +-- zone/tasks.cpp | 66 +++++------ zone/titles.cpp | 12 +- zone/tradeskills.cpp | 64 +++++------ zone/trading.cpp | 14 +-- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 46 ++++---- zone/worldserver.cpp | 6 +- zone/zone.cpp | 62 +++++----- zone/zonedb.cpp | 54 ++++----- zone/zoning.cpp | 24 ++-- 61 files changed, 594 insertions(+), 594 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 5d421b50c..4dbe79f99 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -40,20 +40,20 @@ int main(int argc, char **argv) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -70,7 +70,7 @@ void ExportSpells(SharedDatabase *db) { FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { - Log.Log(EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); return; } @@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.Log(EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); @@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -144,7 +144,7 @@ void ExportSkillCaps(SharedDatabase *db) { FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { - Log.Log(EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); return; } @@ -173,7 +173,7 @@ void ExportBaseData(SharedDatabase *db) { FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { - Log.Log(EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); return; } @@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.Log(EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 810309f36..c0d98bad5 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -38,20 +38,20 @@ int main(int argc, char **argv) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -79,7 +79,7 @@ void ImportSpells(SharedDatabase *db) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { - Log.Log(EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); return; } @@ -158,7 +158,7 @@ void ImportSkillCaps(SharedDatabase *db) { FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { - Log.Log(EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); return; } @@ -194,7 +194,7 @@ void ImportBaseData(SharedDatabase *db) { FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { - Log.Log(EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); return; } diff --git a/common/database.cpp b/common/database.cpp index 14b461a01..a11d05162 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -84,7 +84,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); return false; } @@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid = GetCharacterID(pp->name); if(!charid) { - Log.Log(EQEmuLogSys::Error, "StoreCharacter: no character id"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id"); return false; } @@ -736,7 +736,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - Log.Log(EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else Log.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); @@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::AddReport(std::string who, std::string against, std::string lines) { @@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines safe_delete_array(escape_str); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { @@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); return; } @@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); } void Database::ClearAllGroups(void) @@ -3255,7 +3255,7 @@ uint32 Database::GetGroupID(const char* name){ if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); return 0; } @@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/common/eqtime.cpp b/common/eqtime.cpp index c689b634c..8f80bed91 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename) of.open(filename); if(!of) { - Log.Log(EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); return false; } //Enable for debugging @@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename) in.open(filename); if(!in) { - Log.Log(EQEmuLogSys::Error, "Could not load EQTime file %s", filename); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename); return false; } in >> version; in.ignore(80, '\n'); if(version != EQT_VERSION) { - Log.Log(EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); return false; } //in >> eqTime.start_eqtime.day; diff --git a/common/guild_base.cpp b/common/guild_base.cpp index b168d49fb..15a7851b8 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -337,7 +337,7 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } diff --git a/common/item.cpp b/common/item.cpp index c564edae7..ba90280a8 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } if (result == INVALID_INDEX) { - Log.Log(EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/common/ptimer.cpp b/common/ptimer.cpp index ea718fdd9..0a987a908 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { if (this == nullptr) { - Log.Log(EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); return(true); } uint32 current_time = get_current_time(); @@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Log(EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Log(EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); #endif return false; } diff --git a/common/rulesys.cpp b/common/rulesys.cpp index e0a1091e3..92a4993aa 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -282,7 +282,7 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } @@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index d6d6916fd..d70fc6387 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } @@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); return false; } @@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (put_slot_id != INVALID_INDEX) continue; - Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", ((is_charid==true)? "charid": "acctid"), id, item_id, slot_id); if (is_charid) @@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { else if (slot_id >= 3111 && slot_id <= 3179) { // Admins: please report any occurrences of this error - Log.Log(EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); put_slot_id = inv->PushCursor(*inst); } else @@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) { - Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); } } @@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - Log.Log(EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.Log(EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); } @@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() { items_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(items_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.Log(EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); return false; } @@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ try { hash.insert(item.ID, item); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); break; } } @@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile) } if (results.RowCount() == 0) { - Log.Log(EQEmuLogSys::Error, "No book to send, (%s)", txtfile); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile); txtout.assign(" ",1); return txtout; } @@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() { faction_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(faction_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.Log(EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); return false; } @@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) inst = new ItemInst(item, charges); if (inst == nullptr) { - Log.Log(EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); - Log.Log(EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() { mutex.Unlock(); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); return false; } @@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) { const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); return; } @@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() { mutex.Unlock(); } catch(std::exception& ex) { - Log.Log(EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); return false; } @@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { cl = atoi(row[1]); if(lvl <= 0) { - Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); continue; } if(lvl >= max_level) { - Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); continue; } if(cl <= 0) { - Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); continue; } if(cl > 16) { - Log.Log(EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); continue; } @@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; @@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() { loot_drop_mmf->Size()); mutex.Unlock(); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); return false; } @@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { return &loot_table_hash->at(loottable_id); } } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); } return nullptr; } @@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { return &loot_drop_hash->at(lootdrop_id); } } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); } return nullptr; } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 55c26e47e..414f7a91f 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -69,7 +69,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 0797662eb..a6921624e 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -42,20 +42,20 @@ int main(int argc, char **argv) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { - Log.Log(EQEmuLogSys::Error, "Unable to load configuration file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Log(EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.Log(EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -118,7 +118,7 @@ int main(int argc, char **argv) { try { LoadItems(&database); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } @@ -128,7 +128,7 @@ int main(int argc, char **argv) { try { LoadFactions(&database); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } @@ -138,7 +138,7 @@ int main(int argc, char **argv) { try { LoadLoot(&database); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } @@ -148,7 +148,7 @@ int main(int argc, char **argv) { try { LoadSkillCaps(&database); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } @@ -158,7 +158,7 @@ int main(int argc, char **argv) { try { LoadSpells(&database); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } @@ -168,7 +168,7 @@ int main(int argc, char **argv) { try { LoadBaseData(&database); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "%s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } diff --git a/ucs/database.cpp b/ucs/database.cpp index f189e0639..8fe5918e7 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -74,7 +74,7 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Log(EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; diff --git a/world/adventure.cpp b/world/adventure.cpp index 0c0c3b18d..02ef42459 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); @@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 53a755bdb..edbed3776 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 80ec90f40..c23c82b06 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() { std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); else { auto row = results.begin(); m_dynamics = atoi(row[0]); @@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() { query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); return; } @@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } @@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } @@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.Log(EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 19f3b831d..2955cd6d9 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,7 +298,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector &rl) { const std::string query = "SELECT name FROM launcher"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); return; } @@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) { MailKeyString, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); } @@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level) std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); return false; } diff --git a/zone/aa.cpp b/zone/aa.cpp index b7cb4e7d4..818a51e50 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - Log.Log(EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); return; } @@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.Log(EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - Log.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - Log.Log(EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -1432,7 +1432,7 @@ void Zone::LoadAAs() { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - Log.Log(EQEmuLogSys::Error, "Failed to load AAs!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AAs!"); aas = nullptr; return; } @@ -1451,7 +1451,7 @@ void Zone::LoadAAs() { if (database.LoadAAEffects2()) Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); else - Log.Log(EQEmuLogSys::Error, "Failed to load AA Effects!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - Log.Log(EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); return false; } @@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/attack.cpp b/zone/attack.cpp index ec696990c..a4240fc60 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1128,7 +1128,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } @@ -1692,7 +1692,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -3887,7 +3887,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3918,7 +3918,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } @@ -4467,7 +4467,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } diff --git a/zone/bot.cpp b/zone/bot.cpp index 111d52675..b204fb419 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.Log(EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); return; } @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadStance()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in Bot::SaveStance()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - Log.Log(EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - Log.Log(EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.Log(EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -6017,7 +6017,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } @@ -15454,7 +15454,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/client.cpp b/zone/client.cpp index 7c993f337..ddfa3584a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5294,7 +5294,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5362,7 +5362,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5389,7 +5389,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5397,7 +5397,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6211,7 +6211,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.Log(EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6225,7 +6225,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - Log.Log(EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -8289,11 +8289,11 @@ std::string Client::TextLink::GenerateLink() if ((m_Link.length() == 0) || (m_Link.length() > 250)) { m_Error = true; m_Link = ""; - Log.Log(EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length()); #if EQDEBUG >= 5 - Log.Log(EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); - Log.Log(EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); #endif } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 5d4221305..006529b66 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.Log(EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index b85dbf1a7..09bae443d 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - Log.Log(EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.Log(EQEmuLogSys::Error, "Error message: %s", error->message); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1324,7 +1324,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - Log.Log(EQEmuLogSys::Error, "GetAuth() returned false kicking client"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1340,7 +1340,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) struct in_addr ghost_addr; ghost_addr.s_addr = eqs->GetRemoteIP(); - Log.Log(EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", client->AccountID(), client->AccountName(), client->GetName(), inet_ntoa(ghost_addr)); client->Save(); client->Disconnect(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - Log.Log(EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1955,7 +1955,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - Log.Log(EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2010,7 +2010,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2190,7 +2190,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2412,7 +2412,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2938,7 +2938,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2957,7 +2957,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -3071,7 +3071,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3228,7 +3228,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3580,7 +3580,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3636,7 +3636,7 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) } else { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - Log.Log(EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3721,13 +3721,13 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - Log.Log(EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - Log.Log(EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); @@ -3838,7 +3838,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - Log.Log(EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3859,7 +3859,7 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - Log.Log(EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } @@ -3955,7 +3955,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4234,7 +4234,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4259,7 +4259,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4310,7 +4310,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4323,11 +4323,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - Log.Log(EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - Log.Log(EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4344,8 +4344,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.Log(EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.Log(EQEmuLogSys::Error, "Error message:%s", error->message); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message:%s", error->message); return; } @@ -4366,7 +4366,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4872,7 +4872,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4909,7 +4909,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - Log.Log(EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -4921,7 +4921,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - Log.Log(EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4942,7 +4942,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5098,7 +5098,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5445,7 +5445,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5536,7 +5536,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5591,7 +5591,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5858,7 +5858,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5910,7 +5910,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5943,7 +5943,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6008,7 +6008,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6058,7 +6058,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6125,7 +6125,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6379,7 +6379,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6396,7 +6396,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6440,7 +6440,7 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6587,7 +6587,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - Log.Log(EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6607,7 +6607,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6656,7 +6656,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6734,7 +6734,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6770,7 +6770,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6864,7 +6864,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -6889,7 +6889,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if ((Action != GuildBankDeposit) && (Action != GuildBankViewItem) && (Action != GuildBankWithdraw)) { - Log.Log(EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); GuildBankAck(); @@ -7050,7 +7050,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsGuildBanker() && !GuildBanks->AllowedToWithdraw(GuildID(), gbwis->Area, gbwis->SlotID, GetName())) { - Log.Log(EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); GuildBankAck(); @@ -7121,7 +7121,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "Unexpected GuildBank action."); - Log.Log(EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } } } @@ -7972,7 +7972,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8002,7 +8002,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8057,7 +8057,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8071,7 +8071,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8108,7 +8108,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - Log.Log(EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8208,7 +8208,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8223,7 +8223,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8421,7 +8421,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8874,7 +8874,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9034,7 +9034,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9071,7 +9071,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - Log.Log(EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9096,7 +9096,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9150,7 +9150,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9698,7 +9698,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - Log.Log(EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9714,7 +9714,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9856,7 +9856,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9869,7 +9869,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10332,7 +10332,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10376,7 +10376,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10446,7 +10446,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - Log.Log(EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10720,7 +10720,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11305,7 +11305,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11334,7 +11334,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11350,7 +11350,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11364,7 +11364,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11378,7 +11378,7 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } @@ -11437,7 +11437,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11727,7 +11727,7 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - Log.Log(EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11771,7 +11771,7 @@ void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11884,7 +11884,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received invalid sized " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11918,7 +11918,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); return; } @@ -11993,7 +11993,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12090,7 +12090,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12258,7 +12258,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - Log.Log(EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12348,7 +12348,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12504,7 +12504,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12797,7 +12797,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12924,7 +12924,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - Log.Log(EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13202,7 +13202,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - Log.Log(EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); return; } @@ -13216,7 +13216,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13369,7 +13369,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13515,7 +13515,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - Log.Log(EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13525,7 +13525,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } else { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); - Log.Log(EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13563,7 +13563,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13599,7 +13599,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13670,7 +13670,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - Log.Log(EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13809,7 +13809,7 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13824,7 +13824,7 @@ void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - Log.Log(EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index fc52e5724..c9a70d87b 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) { if(app->size != sizeof(MemorizeSpell_Struct)) { - Log.Log(EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); DumpPacket(app); return; } diff --git a/zone/command.cpp b/zone/command.cpp index f4aaca5e1..b23134617 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -494,7 +494,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - Log.Log(EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -573,7 +573,7 @@ int command_realdispatch(Client *c, const char *message) #endif if(cur->function == nullptr) { - Log.Log(EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 761b38b51..a16f6f240 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -875,7 +875,7 @@ bool Corpse::Process() { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); } else { - Log.Log(EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); return true; } } diff --git a/zone/effects.cpp b/zone/effects.cpp index aa21fb6b8..457d11d65 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - Log.Log(EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index e5cab5f75..7b823154a 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - Log.Log(EQEmuLogSys::Error, "boot_quest does not take any arguments."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 4075186e0..29425351b 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - Log.Log(EQEmuLogSys::Error, "boot_qc does not take any arguments."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/entity.cpp b/zone/entity.cpp index d400d9cab..17bcf5e6c 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - Log.Log(EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - Log.Log(EQEmuLogSys::Error, "About to delete a client still in a group."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - Log.Log(EQEmuLogSys::Error, "About to delete a client still in a raid."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.Log(EQEmuLogSys::Error, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.Log(EQEmuLogSys::Error, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - Log.Log(EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); diff --git a/zone/exp.cpp b/zone/exp.cpp index adf2ca363..15a120bbe 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetLevel(uint8 set_level, bool command) { if (GetEXPForLevel(set_level) == 0xFFFFFFFF) { - Log.Log(EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); return; } diff --git a/zone/forage.cpp b/zone/forage.cpp index 838122471..beb92eb43 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - Log.Log(EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - Log.Log(EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index f51ccf0e2..1c95c44fc 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - Log.Log(EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index 474f131a9..9f2bfe48b 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -409,7 +409,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -429,7 +429,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 912a7f152..f8c7c9ffd 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -261,7 +261,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { switch(pack->opcode) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; @@ -295,7 +295,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { { if(pack->size != sizeof(ServerGuildRankUpdate_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRankUpdate_Struct)); return; @@ -364,7 +364,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.Log(EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; @@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c) if(Iterator == Banks.end()) { - Log.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); return; } @@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Iterator == Banks.end()) { - Log.Log(EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); return false; } @@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Slot < 0) { - Log.Log(EQEmuLogSys::Error, "No space to add item to the guild bank."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No space to add item to the guild bank."); return false; } @@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/horse.cpp b/zone/horse.cpp index 6fc5dce26..9926cbe8a 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.Log(EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - Log.Log(EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 455757e85..6a43b7059 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - Log.Log(EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - Log.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - Log.Log(EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } @@ -2594,7 +2594,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(InvItem) { // If there was already an item in that weapon slot that we replaced, find a place to put it if(!MoveItemToInventory(InvItem)) - Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2646,7 +2646,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.Log(EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2865,7 +2865,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (log) { - Log.Log(EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { @@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea else { e = ""; } if (log) - Log.Log(EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); if (!silent) requester->Message(1, "%i:%i - inst: %s - parent: %s%s", diff --git a/zone/merc.cpp b/zone/merc.cpp index 106bbc10d..2cfe647af 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - Log.Log(EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index ee6aa0913..7634f14c8 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.Log(EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/net.cpp b/zone/net.cpp index c1b2e70ce..0e869c225 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -150,7 +150,7 @@ int main(int argc, char** argv) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { - Log.Log(EQEmuLogSys::Error, "Loading server configuration failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading server configuration failed."); return 1; } const ZoneConfig *Config=ZoneConfig::get(); @@ -169,7 +169,7 @@ int main(int argc, char** argv) { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Log(EQEmuLogSys::Error, "Cannot continue without a database connection."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Cannot continue without a database connection."); return 1; } @@ -192,16 +192,16 @@ int main(int argc, char** argv) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Log(EQEmuLogSys::Error, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Log(EQEmuLogSys::Error, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.Log(EQEmuLogSys::Error, "Could not set signal handler"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #endif @@ -223,25 +223,25 @@ int main(int argc, char** argv) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { - Log.Log(EQEmuLogSys::Error, "Loading items FAILED!"); - Log.Log(EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading items FAILED!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { - Log.Log(EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { - Log.Log(EQEmuLogSys::Error, "Loading loot FAILED!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { - Log.Log(EQEmuLogSys::Error, "Loading skill caps FAILED!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } @@ -252,7 +252,7 @@ int main(int argc, char** argv) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { - Log.Log(EQEmuLogSys::Error, "Loading base data FAILED!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } @@ -278,7 +278,7 @@ int main(int argc, char** argv) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) - Log.Log(EQEmuLogSys::Error, "Command loading FAILED"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Command loading FAILED"); else Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); @@ -288,7 +288,7 @@ int main(int argc, char** argv) { if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.Log(EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { @@ -321,7 +321,7 @@ int main(int argc, char** argv) { parse->ReloadQuests(); if (!worldserver.Connect()) { - Log.Log(EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -334,7 +334,7 @@ int main(int argc, char** argv) { if (!strlen(zone_name) || !strcmp(zone_name,".")) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - Log.Log(EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; } @@ -371,7 +371,7 @@ int main(int argc, char** argv) { // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); if (!eqsf.Open(Config->ZonePort)) { - Log.Log(EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); worldserver.Disconnect(); worldwasconnected = false; @@ -628,7 +628,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - Log.Log(EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 91f43da6c..241834a78 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - Log.Log(EQEmuLogSys::Error, "Database error, invalid item"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/object.cpp b/zone/object.cpp index 9319782f8..34d85a33c 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - Log.Log(EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 06a99ade3..425ea9e34 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -66,14 +66,14 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) } else { - Log.Log(EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - Log.Log(EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,7 +103,7 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - Log.Log(EQEmuLogSys::Error, "Bad Magic String in .path file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Bad Magic String in .path file."); return false; } @@ -114,7 +114,7 @@ bool PathManager::loadPaths(FILE *PathFile) if(Head.version != 2) { - Log.Log(EQEmuLogSys::Error, "Unsupported path file version."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - Log.Log(EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 37e1c9cab..373152c29 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,7 +254,7 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index 4dff5aa84..690ae6434 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - Log.Log(EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - Log.Log(EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - Log.Log(EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - Log.Log(EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - Log.Log(EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index c3188d66e..41c15bfc5 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - Log.Log(EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 01685b352..d638f07d5 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - Log.Log(EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - Log.Log(EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 288893a1e..709984976 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.Log(EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - Log.Log(EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index 0b3201da3..e98c80209 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -167,7 +167,7 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND zone = '%s'", zone_name); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); return false; } @@ -195,7 +195,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); return false; } @@ -210,7 +210,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "ORDER BY chance", spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); return false; } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index cfa9e55c4..771eba717 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - Log.Log(EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } diff --git a/zone/spells.cpp b/zone/spells.cpp index 1f6c514fe..b13f8583d 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - Log.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - Log.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - Log.Log(EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - Log.Log(EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - Log.Log(EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 3cae8a687..187c4a42f 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.Log(EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -323,7 +323,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -362,7 +362,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -466,7 +466,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - Log.Log(EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - Log.Log(EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,7 +634,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - Log.Log(EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - Log.Log(EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -725,7 +725,7 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -774,7 +774,7 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } bool ClientTaskState::IsTaskEnabled(int TaskID) { @@ -1280,7 +1280,7 @@ static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2938,7 +2938,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); @@ -2947,7 +2947,7 @@ void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); @@ -3088,7 +3088,7 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/titles.cpp b/zone/titles.cpp index 4867db69f..38c344cc6 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 2021901ab..060ecc035 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - Log.Log(EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - Log.Log(EQEmuLogSys::Error, "Player tried to augment an item without a container set."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - Log.Log(EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - Log.Log(EQEmuLogSys::Error, "Replace container combine executed in a world container."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - Log.Log(EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - Log.Log(EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - Log.Log(EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - Log.Log(EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - Log.Log(EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - Log.Log(EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - Log.Log(EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - Log.Log(EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,7 +1477,7 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index 99a2d42ed..d2873cc66 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1539,7 +1539,7 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - Log.Log(EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); @@ -2515,7 +2515,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Quantity = i; break; } - Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2523,7 +2523,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); if(ItemToTransfer) @@ -2561,7 +2561,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { int16 SellerSlot = m_inv.HasItem(ItemID, 1, invWhereWorn|invWherePersonal|invWhereCursor); if (SellerSlot == INVALID_INDEX) { - Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2569,7 +2569,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer) { - Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2581,7 +2581,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { QuantityMoved += ItemToTransfer->GetCharges(); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2616,7 +2616,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemToTransfer->SetCharges(QuantityToRemoveFromStack); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.Log(EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; diff --git a/zone/trap.cpp b/zone/trap.cpp index 51bf3b3ed..3f0582c86 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 6ee71ee05..db3d7ce65 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - Log.Log(EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - Log.Log(EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - Log.Log(EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index bf7bdc143..a11de0bc8 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -116,7 +116,7 @@ void NPC::ResumeWandering() } else { - Log.Log(EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - Log.Log(EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - Log.Log(EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - Log.Log(EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - Log.Log(EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 6bbe3d3ab..1d83cb10c 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -391,7 +391,7 @@ void WorldServer::Process() { } } else - Log.Log(EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); break; } case ServerOP_EmoteMessage: { @@ -1381,7 +1381,7 @@ void WorldServer::Process() { if(NewCorpse) NewCorpse->Spawn(); else - Log.Log(EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); break; } @@ -2061,7 +2061,7 @@ uint32 WorldServer::NextGroupID() { if(cur_groupid >= last_groupid) { //this is an error... This means that 50 groups were created before //1 packet could make the zone->world->zone trip... so let it error. - Log.Log(EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); return(0); } if(cur_groupid > (last_groupid - /*50*/995)) { diff --git a/zone/zone.cpp b/zone/zone.cpp index 6a5f9a9bb..0b1b584d0 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -167,7 +167,7 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); return; } @@ -737,7 +737,7 @@ void Zone::LoadZoneDoors(const char* zone, int16 version) Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - Log.Log(EQEmuLogSys::Error, "... Failed to load doors."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load doors."); delete[] dlist; return; } @@ -806,7 +806,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) if(GraveYardLoaded) Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - Log.Log(EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -901,38 +901,38 @@ bool Zone::Init(bool iStaticZone) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - Log.Log(EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - Log.Log(EQEmuLogSys::Error, "Loading static zone points failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); return false; } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - Log.Log(EQEmuLogSys::Error, "Loading spawn groups failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - Log.Log(EQEmuLogSys::Error, "Loading spawn2 points failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - Log.Log(EQEmuLogSys::Error, "Loading player corpses failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading player corpses failed."); return false; } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - Log.Log(EQEmuLogSys::Error, "Loading traps failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading traps failed."); return false; } @@ -942,13 +942,13 @@ bool Zone::Init(bool iStaticZone) { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - Log.Log(EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.Log(EQEmuLogSys::Error, "Loading World Objects failed. continuing."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1024,27 +1024,27 @@ void Zone::ReloadStaticData() { Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - Log.Log(EQEmuLogSys::Error, "Loading static zone points failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - Log.Log(EQEmuLogSys::Error, "Reloading traps failed."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading traps failed."); } Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - Log.Log(EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.Log(EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.Log(EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - Log.Log(EQEmuLogSys::Error, "... Failed to load blocked spells."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 69bae78dc..8a6393391 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - Log.Log(EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapCharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - Log.Log(EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - Log.Log(EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index ec99be644..052849943 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - Log.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - Log.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - Log.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - Log.Log(EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - Log.Log(EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - Log.Log(EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - Log.Log(EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - Log.Log(EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -550,7 +550,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; default: - Log.Log(EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } From ec7fd9b4e7a8577598194ff7e019a8867bbca32e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:32:18 -0600 Subject: [PATCH 166/707] Consolidate 'LogType' Normal logs over to 'LogCategory' --- zone/bot.cpp | 2 +- zone/client.cpp | 4 ++-- zone/command.cpp | 34 +++++++++++++++++----------------- zone/exp.cpp | 2 +- zone/npc.cpp | 2 +- zone/spell_effects.cpp | 4 ++-- zone/spells.cpp | 2 +- zone/tradeskills.cpp | 2 +- zone/zone.cpp | 4 ++-- 9 files changed, 28 insertions(+), 28 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index b204fb419..7ad758706 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; default: - Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; diff --git a/zone/client.cpp b/zone/client.cpp index ddfa3584a..e10b1bb93 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1911,7 +1911,7 @@ void Client::ReadBook(BookRequest_Struct *book) { if (booktxt2[0] != '\0') { #if EQDEBUG >= 6 - Log.Log(EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); #endif EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct)); @@ -2364,7 +2364,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 Save(); - Log.Log(EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " "Too many specializations skills were above 50.", GetCleanName()); } diff --git a/zone/command.cpp b/zone/command.cpp index b23134617..0665f3385 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -1292,7 +1292,7 @@ void command_viewpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Log(EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1317,7 +1317,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Log(EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1343,7 +1343,7 @@ void command_delpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Log(EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); } @@ -1566,7 +1566,7 @@ void command_permaclass(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); t->Kick(); @@ -1588,7 +1588,7 @@ void command_permarace(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's race - zone to take effect",t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); t->SetBaseGender(tmp); @@ -1612,7 +1612,7 @@ void command_permagender(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's gender - zone to take effect",t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); t->SendIllusionPacket(atoi(sep->arg[1])); @@ -1954,7 +1954,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) { - Log.Log(EQEmuLogSys::Normal, "Spawning database spawn"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Spawning database spawn"); uint16 cond = 0; int16 cond_min = 0; if(sep->IsNumber(4)) { @@ -2274,7 +2274,7 @@ void command_setlanguage(Client *c, const Seperator *sep) } else { - Log.Log(EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); uint8 langid = (uint8)atoi(sep->arg[1]); uint8 value = (uint8)atoi(sep->arg[2]); c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value ); @@ -2299,7 +2299,7 @@ void command_setskill(Client *c, const Seperator *sep) c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { - Log.Log(EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); int skill_num = atoi(sep->arg[1]); uint16 skill_value = atoi(sep->arg[2]); if(skill_num < HIGHEST_SKILL) @@ -2319,7 +2319,7 @@ void command_setskillall(Client *c, const Seperator *sep) } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { - Log.Log(EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); uint16 level = atoi(sep->arg[1]); for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) { c->GetTarget()->CastToClient()->SetSkill(skill_num, level); @@ -3114,7 +3114,7 @@ void command_listpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Log(EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); if (results.RowCount() == 0) return; @@ -3771,7 +3771,7 @@ void command_lastname(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - Log.Log(EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); @@ -4869,7 +4869,7 @@ void command_manaburn(Client *c, const Seperator *sep) target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/); c->Message(4,"You unleash an enormous blast of magical energies."); } - Log.Log(EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); } } else @@ -5221,7 +5221,7 @@ void command_scribespells(Client *c, const Seperator *sep) t->Message(0, "Scribing spells to spellbook."); if(t != c) c->Message(0, "Scribing spells for %s.", t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot)) { @@ -5278,7 +5278,7 @@ void command_scribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) { book_slot = t->GetNextAvailableSpellBookSlot(); @@ -5325,7 +5325,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); @@ -7862,7 +7862,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->Message(0, "Training disciplines"); if(t != c) c->Message(0, "Training disciplines for %s.", t->GetName()); - Log.Log(EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++) { diff --git a/zone/exp.cpp b/zone/exp.cpp index 15a120bbe..074e86d2a 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command) safe_delete(outapp); this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change - Log.Log(EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); CalcBonuses(); diff --git a/zone/npc.cpp b/zone/npc.cpp index 241834a78..2351afafa 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem { if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) { - Log.Log(EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); } } } diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 771eba717..ecffd1921 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -4817,7 +4817,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -5156,7 +5156,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.Log(EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } diff --git a/zone/spells.cpp b/zone/spells.cpp index b13f8583d..0587d11ee 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -5040,7 +5040,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); - Log.Log(EQEmuLogSys::Normal, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "FindType: type = %d; value = %d; threshold = %d", type, value, threshold); if (value < threshold) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 060ecc035..572c02521 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1482,7 +1482,7 @@ void Client::LearnRecipe(uint32 recipeID) } if (results.RowCount() != 1) { - Log.Log(EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); return; } diff --git a/zone/zone.cpp b/zone/zone.cpp index 0b1b584d0..c901a65b9 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -144,7 +144,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { delete pack; } - Log.Log(EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); @@ -711,7 +711,7 @@ void Zone::Shutdown(bool quite) petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) - Log.Log(EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); ZoneLoaded = false; zone->ResetAuth(); From 40d0fba63fe815f850e35c3fc83d292d8cdb95a5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:32:57 -0600 Subject: [PATCH 167/707] Consolidate 'LogType' Quest logs over to 'LogCategory' --- zone/embperl.cpp | 10 +++++----- zone/questmgr.cpp | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 46a43246e..7653b5cc4 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -140,12 +140,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - Log.Log(EQEmuLogSys::Quest, "perl error: %s", err); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "perl error: %s", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - Log.Log(EQEmuLogSys::Quest, "Tying perl output to eqemu logs"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -170,14 +170,14 @@ void Embperl::DoInit() { ,FALSE ); - Log.Log(EQEmuLogSys::Quest, "Loading perlemb plugins."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Loading perlemb plugins."); try { eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE); } catch(const char *err) { - Log.Log(EQEmuLogSys::Quest, "Warning - plugin.pl: %s", err); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Warning - plugin.pl: %s", err); } try { @@ -195,7 +195,7 @@ void Embperl::DoInit() { } catch(const char *err) { - Log.Log(EQEmuLogSys::Quest, "Perl warning: %s", err); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Perl warning: %s", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 41c15bfc5..068817178 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -154,7 +154,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -170,7 +170,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::stopalltimers(Mob *mob) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -559,7 +559,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -570,7 +570,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -589,7 +589,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -619,7 +619,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.Log(EQEmuLogSys::Quest, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -646,7 +646,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - Log.Log(EQEmuLogSys::Quest, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -655,7 +655,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - Log.Log(EQEmuLogSys::Quest, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -664,7 +664,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - Log.Log(EQEmuLogSys::Quest, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -1652,7 +1652,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Log(EQEmuLogSys::Quest, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); return; } @@ -2809,7 +2809,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - Log.Log(EQEmuLogSys::Quest, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); } } From b51185733376110a737886b14d03ddc1e9c4c007 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:34:31 -0600 Subject: [PATCH 168/707] Consolidate 'LogType' Commands logs over to 'LogCategory' --- zone/command.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 0665f3385..6408071b2 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -443,7 +443,7 @@ int command_init(void) { if ((itr=command_settings.find(cur->first))!=command_settings.end()) { cur->second->access = itr->second; - Log.Log(EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); } else { @@ -568,7 +568,7 @@ int command_realdispatch(Client *c, const char *message) #ifdef COMMANDS_LOGGING if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - Log.Log(EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } #endif From 375f4af946de5b03a59ae8a7d0935e9806e4f99a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:36:10 -0600 Subject: [PATCH 169/707] Consolidate 'LogType' Error (Straggler) logs over to 'LogCategory' --- common/shareddb.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index d70fc6387..3abca55d8 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.Log(EQEmuLogSys::Error, + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: %s %i has an invalid item_id %i in inventory slot %i", ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); continue; @@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.Log(EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); continue; } From 063a9214ae6ddfe15f61106f9e2f037f77fbeb66 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:37:54 -0600 Subject: [PATCH 170/707] Consolidate 'LogType' Debug logs over to 'LogCategory' --- common/database.cpp | 6 +++--- common/timeoutmgr.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index a11d05162..2bf2786bb 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -739,7 +739,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else - Log.Log(EQEmuLogSys::Debug, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); #endif } @@ -3262,7 +3262,7 @@ uint32 Database::GetGroupID(const char* name){ if (results.RowCount() == 0) { // Commenting this out until logging levels can prevent this from going to console - //Log.Log(EQEmuLogSys::Debug, "Character not in a group: %s", name); + //Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Character not in a group: %s", name); return 0; } @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - Log.Log(EQEmuLogSys::Debug, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index 5cc77e750..f0908b558 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() { Timeoutable *it = *cur; if(it->next_check.Check()) { #ifdef TIMEOUT_DEBUG - Log.Log(EQEmuLogSys::Debug, "Checking timeout on 0x%x\n", it); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Checking timeout on 0x%x\n", it); #endif it->CheckTimeout(); } @@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) { DeleteMember(who); //just in case... prolly not needed. members.push_back(who); #ifdef TIMEOUT_DEBUG - Log.Log(EQEmuLogSys::Debug, "Adding timeoutable 0x%x\n", who); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Adding timeoutable 0x%x\n", who); #endif } void TimeoutManager::DeleteMember(Timeoutable *who) { #ifdef TIMEOUT_DEBUG - Log.Log(EQEmuLogSys::Debug, "Removing timeoutable 0x%x\n", who); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Removing timeoutable 0x%x\n", who); #endif std::vector::iterator cur,end; cur = members.begin(); From 57ac6c0e98dd55a6174fe72558c97d909f0c73aa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:39:01 -0600 Subject: [PATCH 171/707] Remove EQEmuLogSys::Log from consolidation of types into categories --- common/debug.cpp | 2 +- common/eqemu_logsys.cpp | 16 ---------------- common/eqemu_logsys.h | 11 ----------- 3 files changed, 1 insertion(+), 28 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 9b15bcbd9..7dbd28751 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -158,7 +158,7 @@ bool EQEmuLog::write(LogIDs id, const char *fmt, ...) va_list argptr, tmpargptr; va_start(argptr, fmt); - Log.Log(id, vStringFormat(fmt, argptr).c_str()); + // Log.Log(id, vStringFormat(fmt, argptr).c_str()); return true; } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index d8c73adca..faa05083b 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -190,22 +190,6 @@ void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, log_category, output_debug_message); } -void EQEmuLogSys::Log(uint16 log_type, const std::string message, ...) -{ - if (log_type > EQEmuLogSys::MaxLogID){ - return; - } - - va_list args; - va_start(args, message); - std::string output_message = vStringFormat(message.c_str(), args); - va_end(args); - - EQEmuLogSys::ProcessConsoleMessage(log_type, 0, output_message); - EQEmuLogSys::ProcessGMSay(log_type, 0, output_message); - EQEmuLogSys::ProcessLogWrite(log_type, 0, output_message); -} - void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ time_t raw_time; struct tm * time_info; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 4a4a26f7a..de49967db 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -31,17 +31,6 @@ public: EQEmuLogSys(); ~EQEmuLogSys(); - enum LogType { - Status = 0, /* This must stay the first entry in this list */ - Normal, /* Normal Logs */ - Error, /* Error Logs */ - Debug, /* Debug Logs */ - Quest, /* Quest Logs */ - Commands, /* Issued Commands */ - Crash, /* Crash Logs */ - MaxLogID /* Max, used in functions to get the max log ID */ - }; - enum DebugLevel { General = 0, /* 0 - Low-Level general debugging, useful info on single line */ Moderate, /* 1 - Informational based, used in functions, when particular things load */ From 0926a5ded390870cdf3fe2ec52f8819c302ff084 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:41:11 -0600 Subject: [PATCH 172/707] Refactor ProcessGMSay to no longer use type --- common/eqemu_logsys.cpp | 32 +++++++++++--------------------- common/eqemu_logsys.h | 1 - 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index faa05083b..0b4b61d8c 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -61,25 +61,15 @@ namespace Console { }; } -static const char* TypeNames[EQEmuLogSys::MaxLogID] = { - "Status", - "Normal", - "Error", - "Debug", - "Quest", - "Command", - "Crash", -}; - -static Console::Color LogColors[EQEmuLogSys::MaxLogID] = { - Console::Color::Yellow, // "Status", - Console::Color::Yellow, // "Normal", - Console::Color::LightRed, // "Error", - Console::Color::LightGreen, // "Debug", - Console::Color::LightCyan, // "Quest", - Console::Color::LightMagenta, // "Command", - Console::Color::LightRed // "Crash" -}; +// static Console::Color LogColors[MaxCategoryID] = { +// Console::Color::Yellow, // "Status", +// Console::Color::Yellow, // "Normal", +// Console::Color::LightRed, // "Error", +// Console::Color::LightGreen, // "Debug", +// Console::Color::LightCyan, // "Quest", +// Console::Color::LightMagenta, // "Command", +// Console::Color::LightRed // "Crash" +// }; EQEmuLogSys::EQEmuLogSys(){ @@ -109,7 +99,7 @@ std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, s return StringFormat("%s%s", category_string.c_str(), in_message.c_str()); } -void EQEmuLogSys::ProcessGMSay(uint16 log_type, uint16 log_category, std::string message) +void EQEmuLogSys::ProcessGMSay(uint16 log_category, std::string message) { /* Check if category enabled for process */ if (log_settings[log_category].log_to_gmsay == 0) @@ -186,7 +176,7 @@ void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, log_category, output_debug_message); - EQEmuLogSys::ProcessGMSay(EQEmuLogSys::Debug, log_category, output_debug_message); + EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, log_category, output_debug_message); } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index de49967db..42b39af7e 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -82,7 +82,6 @@ public: void CloseFileLogs(); void LoadLogSettingsDefaults(); - void Log(uint16 log_type, const std::string message, ...); void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); From 564bff07fe411a920adff8a2964390b20564cc4b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:42:23 -0600 Subject: [PATCH 173/707] Refactor ProcessLogWrite to no longer use type --- common/eqemu_logsys.cpp | 6 +++--- common/eqemu_logsys.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 0b4b61d8c..0322f9c96 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -110,11 +110,11 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_category, std::string message) return; if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - on_log_gmsay_hook(log_type, message); + on_log_gmsay_hook(log_category, message); } } -void EQEmuLogSys::ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message) +void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) { /* Check if category enabled for process */ if (log_settings[log_category].log_to_file == 0) @@ -177,7 +177,7 @@ void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); - EQEmuLogSys::ProcessLogWrite(EQEmuLogSys::Debug, log_category, output_debug_message); + EQEmuLogSys::ProcessLogWrite(log_category, output_debug_message); } void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 42b39af7e..11bf6d3c0 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -106,8 +106,8 @@ private: std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); void ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message); - void ProcessGMSay(uint16 log_type, uint16 log_category, std::string message); - void ProcessLogWrite(uint16 log_type, uint16 log_category, std::string message); + void ProcessGMSay(uint16 log_category, std::string message); + void ProcessLogWrite(uint16 log_category, std::string message); }; extern EQEmuLogSys Log; From 40d12d952eeab6057b6c5f9aa9e2e04f66019686 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:45:58 -0600 Subject: [PATCH 174/707] Refactor ProcessConsoleMessage to no longer use type --- common/eqemu_logsys.cpp | 22 +++++++++------------- common/eqemu_logsys.h | 4 ++-- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 0322f9c96..a6425284f 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -124,23 +124,19 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) EQEmuLogSys::SetCurrentTimeStamp(time_stamp); if (process_log){ - process_log << time_stamp << " " << StringFormat("[%s] ", TypeNames[log_type]).c_str() << message << std::endl; + process_log << time_stamp << " " << StringFormat("[%s] ", LogCategoryName[log_category]).c_str() << message << std::endl; } else{ // std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; } } -void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message) +void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string message) { /* Check if category enabled for process */ if (log_settings[log_category].log_to_console == 0) return; - if (log_type > EQEmuLogSys::MaxLogID){ - return; - } - #ifdef _WINDOWS HANDLE console_handle; console_handle = GetStdHandle(STD_OUTPUT_HANDLE); @@ -150,15 +146,15 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_type, uint16 log_category, co info.FontWeight = FW_NORMAL; wcscpy(info.FaceName, L"Lucida Console"); SetCurrentConsoleFontEx(console_handle, NULL, &info); - if (LogColors[log_type]){ - SetConsoleTextAttribute(console_handle, LogColors[log_type]); - } - else{ + //if (LogColors[log_type]){ + // SetConsoleTextAttribute(console_handle, LogColors[log_type]); + //} + //else{ SetConsoleTextAttribute(console_handle, Console::Color::White); - } + //} #endif - std::cout << "[" << TypeNames[log_type] << "] " << message << "\n"; + std::cout << "[" << LogCategoryName[log_category] << "] " << message << "\n"; #ifdef _WINDOWS /* Always set back to white*/ @@ -175,7 +171,7 @@ void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); - EQEmuLogSys::ProcessConsoleMessage(EQEmuLogSys::Debug, log_category, output_debug_message); + EQEmuLogSys::ProcessConsoleMessage(log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); EQEmuLogSys::ProcessLogWrite(log_category, output_debug_message); } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 11bf6d3c0..9955a2f2e 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -101,11 +101,11 @@ public: private: bool zone_general_init = false; - std::function on_log_gmsay_hook; + std::function on_log_gmsay_hook; std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); - void ProcessConsoleMessage(uint16 log_type, uint16 log_category, const std::string message); + void ProcessConsoleMessage(uint16 log_category, const std::string message); void ProcessGMSay(uint16 log_category, std::string message); void ProcessLogWrite(uint16 log_category, std::string message); }; From b15e5f791303735ed306fbacb92462e09ae901e2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:48:07 -0600 Subject: [PATCH 175/707] Refactor GMSayHookCallBackProcess to use category instead of type --- common/database.cpp | 2 +- zone/zone.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 2bf2786bb..5c4a4c1fc 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } diff --git a/zone/zone.h b/zone/zone.h index 6c437bed2..b99feb093 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -67,15 +67,15 @@ struct item_tick_struct { std::string qglobal; }; -static uint32 gmsay_log_message_colors[EQEmuLogSys::MaxLogID] = { - 15, // "Status", - Yellow - 15, // "Normal", - Yellow - 3, // "Error", - Red - 14, // "Debug", - Light Green - 4, // "Quest", - 5, // "Command", - 3 // "Crash" -}; +// static uint32 gmsay_log_message_colors[EQEmuLogSys::MaxLogID] = { +// 15, // "Status", - Yellow +// 15, // "Normal", - Yellow +// 3, // "Error", - Red +// 14, // "Debug", - Light Green +// 4, // "Quest", +// 5, // "Command", +// 3 // "Crash" +// }; class Client; class Map; @@ -271,7 +271,7 @@ public: // random object that provides random values for the zone EQEmu::Random random; - static void GMSayHookCallBackProcess(uint16 log_type, std::string& message){ entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_type], "%s", message.c_str()); } + static void GMSayHookCallBackProcess(uint16 log_category, std::string& message){ entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_category], "%s", message.c_str()); } //MODDING HOOKS void mod_init(); From af8ab89a36c20dd687a30748773139bd89ce9d13 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:50:05 -0600 Subject: [PATCH 176/707] Compile state --- zone/embxs.cpp | 2 +- zone/zone.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 29425351b..05c9d642e 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quest, str); + Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); } } diff --git a/zone/zone.h b/zone/zone.h index b99feb093..e022a870c 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -271,7 +271,7 @@ public: // random object that provides random values for the zone EQEmu::Random random; - static void GMSayHookCallBackProcess(uint16 log_category, std::string& message){ entity_list.MessageStatus(0, 80, gmsay_log_message_colors[log_category], "%s", message.c_str()); } + static void GMSayHookCallBackProcess(uint16 log_category, std::string& message){ entity_list.MessageStatus(0, 80, 15, "%s", message.c_str()); } //MODDING HOOKS void mod_init(); From 1c048cb1d15acea7ddc9018cfe406f93d08ea260 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 01:54:09 -0600 Subject: [PATCH 177/707] Renamed DebugCategory to DoLog as the aggregate logging function for simplicity of use and shortened syntax of Log.DoLog --- client_files/export/main.cpp | 30 +-- client_files/import/main.cpp | 28 +- common/crash.cpp | 44 +-- common/database.cpp | 34 +-- common/eq_stream.cpp | 242 ++++++++--------- common/eq_stream_factory.cpp | 8 +- common/eq_stream_ident.cpp | 20 +- common/eqemu_logsys.cpp | 6 +- common/eqemu_logsys.h | 4 +- common/eqtime.cpp | 6 +- common/guild_base.cpp | 132 ++++----- common/item.cpp | 2 +- common/misc_functions.h | 2 +- common/patches/rof.cpp | 34 +-- common/patches/rof2.cpp | 34 +-- common/patches/sod.cpp | 22 +- common/patches/sof.cpp | 22 +- common/patches/ss_define.h | 8 +- common/patches/titanium.cpp | 22 +- common/patches/underfoot.cpp | 22 +- common/ptimer.cpp | 14 +- common/rulesys.cpp | 36 +-- common/shareddb.cpp | 106 ++++---- common/spdat.cpp | 2 +- common/struct_strategy.cpp | 4 +- common/tcp_connection.cpp | 4 +- common/tcp_server.cpp | 4 +- common/timeoutmgr.cpp | 6 +- common/worldconn.cpp | 4 +- eqlaunch/eqlaunch.cpp | 18 +- eqlaunch/worldserver.cpp | 18 +- eqlaunch/zone_launch.cpp | 46 ++-- queryserv/database.cpp | 60 ++--- queryserv/lfguild.cpp | 14 +- queryserv/queryserv.cpp | 16 +- queryserv/worldserver.cpp | 6 +- shared_memory/main.cpp | 34 +-- ucs/chatchannel.cpp | 32 +-- ucs/clientlist.cpp | 78 +++--- ucs/database.cpp | 90 +++---- ucs/ucs.cpp | 26 +- ucs/worldserver.cpp | 8 +- world/adventure.cpp | 4 +- world/adventure_manager.cpp | 6 +- world/client.cpp | 168 ++++++------ world/cliententry.cpp | 2 +- world/clientlist.cpp | 12 +- world/console.cpp | 24 +- world/eql_config.cpp | 22 +- world/eqw.cpp | 2 +- world/eqw_http_handler.cpp | 14 +- world/eqw_parser.cpp | 6 +- world/launcher_link.cpp | 24 +- world/launcher_list.cpp | 10 +- world/login_server.cpp | 32 +-- world/login_server_list.cpp | 2 +- world/net.cpp | 116 ++++---- world/queryserv.cpp | 12 +- world/ucs.cpp | 12 +- world/wguild_mgr.cpp | 26 +- world/worlddb.cpp | 18 +- world/zonelist.cpp | 8 +- world/zoneserver.cpp | 88 +++--- zone/aa.cpp | 46 ++-- zone/aggro.cpp | 22 +- zone/attack.cpp | 174 ++++++------ zone/bonuses.cpp | 6 +- zone/bot.cpp | 114 ++++---- zone/botspellsai.cpp | 4 +- zone/client.cpp | 70 ++--- zone/client_mods.cpp | 12 +- zone/client_packet.cpp | 506 +++++++++++++++++------------------ zone/client_process.cpp | 24 +- zone/command.cpp | 60 ++--- zone/corpse.cpp | 8 +- zone/doors.cpp | 16 +- zone/effects.cpp | 2 +- zone/embparser.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embperl.cpp | 10 +- zone/embxs.cpp | 6 +- zone/entity.cpp | 14 +- zone/exp.cpp | 8 +- zone/fearpath.cpp | 4 +- zone/forage.cpp | 6 +- zone/groups.cpp | 36 +-- zone/guild.cpp | 20 +- zone/guild_mgr.cpp | 48 ++-- zone/horse.cpp | 6 +- zone/inventory.cpp | 154 +++++------ zone/loottables.cpp | 4 +- zone/merc.cpp | 16 +- zone/mob.cpp | 6 +- zone/mob_ai.cpp | 20 +- zone/net.cpp | 108 ++++---- zone/npc.cpp | 20 +- zone/object.cpp | 8 +- zone/pathing.cpp | 146 +++++----- zone/perl_client.cpp | 16 +- zone/petitions.cpp | 10 +- zone/pets.cpp | 16 +- zone/questmgr.cpp | 30 +-- zone/raids.cpp | 22 +- zone/spawn2.cpp | 152 +++++------ zone/spawngroup.cpp | 8 +- zone/special_attacks.cpp | 58 ++-- zone/spell_effects.cpp | 32 +-- zone/spells.cpp | 352 ++++++++++++------------ zone/tasks.cpp | 250 ++++++++--------- zone/titles.cpp | 12 +- zone/tradeskills.cpp | 82 +++--- zone/trading.cpp | 122 ++++----- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 108 ++++---- zone/worldserver.cpp | 42 +-- zone/zone.cpp | 148 +++++----- zone/zonedb.cpp | 124 ++++----- zone/zoning.cpp | 46 ++-- 119 files changed, 2653 insertions(+), 2653 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 4dbe79f99..feec1f440 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -38,22 +38,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -66,11 +66,11 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells..."); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); return; } @@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); @@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -140,11 +140,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps..."); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); return; } @@ -169,11 +169,11 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data..."); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); return; } @@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index c0d98bad5..285398ec8 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -36,22 +36,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -76,10 +76,10 @@ int GetSpellColumns(SharedDatabase *db) { } void ImportSpells(SharedDatabase *db) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); return; } @@ -142,23 +142,23 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); } } if(spells_imported % 1000 != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Skill Caps..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Skill Caps..."); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); return; } @@ -190,11 +190,11 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Base Data..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Base Data..."); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); return; } diff --git a/common/crash.cpp b/common/crash.cpp index e573ea1a5..8b9b48339 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -25,7 +25,7 @@ public: } } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, buffer); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, buffer); StackWalker::OnOutput(szText); } }; @@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) switch(ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); break; case EXCEPTION_BREAKPOINT: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); break; case EXCEPTION_DATATYPE_MISALIGNMENT: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); break; case EXCEPTION_FLT_DENORMAL_OPERAND: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); break; case EXCEPTION_FLT_INEXACT_RESULT: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); break; case EXCEPTION_FLT_INVALID_OPERATION: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); break; case EXCEPTION_FLT_OVERFLOW: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); break; case EXCEPTION_FLT_STACK_CHECK: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); break; case EXCEPTION_FLT_UNDERFLOW: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); break; case EXCEPTION_ILLEGAL_INSTRUCTION: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); break; case EXCEPTION_IN_PAGE_ERROR: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); break; case EXCEPTION_INT_OVERFLOW: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); break; case EXCEPTION_INVALID_DISPOSITION: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); break; case EXCEPTION_NONCONTINUABLE_EXCEPTION: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); break; case EXCEPTION_PRIV_INSTRUCTION: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); break; case EXCEPTION_SINGLE_STEP: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); break; case EXCEPTION_STACK_OVERFLOW: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Crash, "Unknown Exception"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "Unknown Exception"); break; } diff --git a/common/database.cpp b/common/database.cpp index 5c4a4c1fc..af21f2bd1 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -84,12 +84,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); return false; } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid = GetCharacterID(pp->name); if(!charid) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id"); return false; } @@ -736,10 +736,10 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); #endif } @@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::AddReport(std::string who, std::string against, std::string lines) { @@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines safe_delete_array(escape_str); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { @@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); return; } @@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); } void Database::ClearAllGroups(void) @@ -3255,14 +3255,14 @@ uint32 Database::GetGroupID(const char* name){ if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); return 0; } if (results.RowCount() == 0) { // Commenting this out until logging levels can prevent this from going to console - //Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Character not in a group: %s", name); + //Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Character not in a group: %s", name); return 0; } @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } @@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 9ae9db4e3..99bff02f1 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) { OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; @@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { EQRawApplicationPacket *ap=nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; @@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processed < p->size) { subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processedsize) { EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); processed+=subpacket_length+1; } else { subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length); processed+=subpacket_length+3; } @@ -178,29 +178,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Packet: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); delete qp; } @@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // Check for an embedded OP_AppCombinded (protocol level 0x19) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -228,29 +228,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Fragment: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); delete qp; } SetNextAckToSend(seq); @@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (oversize_buffer) { memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2); oversize_offset+=p->size-2; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); if (oversize_offset==oversize_length) { if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); //_raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; } else { EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); if (ap) { ap->copyInfo(p); InboundQueuePush(ap); @@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) oversize_buffer=new unsigned char[oversize_length]; memcpy(oversize_buffer,p->pBuffer+6,p->size-6); oversize_offset=p->size-6; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); } } } @@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_KeepAlive: { #ifndef COLLECTOR NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); #endif } break; case OP_Ack: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionRequest: { if(p->Size() < sizeof(SessionRequest)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); break; } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case // streamactive means we identified the opcode for the stream, we cannot re-establish this connection @@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); SetMaxLen(ntohl(Request->MaxLength)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); SetState(ESTABLISHED); #ifndef COLLECTOR Key=0x11223344; @@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionResponse: { if(p->Size() < sizeof(SessionResponse)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); break; } @@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) compressed=(Response->Format&FLAG_COMPRESSED); encoded=(Response->Format&FLAG_ENCODED); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); // Kinda kludgy, but trie for now if (StreamType==UnknownStream) { @@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) EQStreamState state = GetState(); if(state == ESTABLISHED) { //client initiated disconnect? - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); _SendDisconnect(); SetState(CLOSED); } else if(state == CLOSING) { //we were waiting for this anyways, ignore pending messages, send the reply and be closed. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); _SendDisconnect(); SetState(CLOSED); } else { //we are expecting this (or have already gotten it, but dont care either way) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); SetState(CLOSED); } } @@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_OutOfOrderAck: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } //if the packet they got out of order is between our last acked packet and the last sent packet, then its valid. if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, seq, SequencedBase, SequencedBase+NextSequencedSend); bool retransmit_acked_packets = false; @@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if(!retransmit_acked_packets) { uint16 sqsize = SequencedQueue.size(); uint16 index = seq - SequencedBase; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); if (index < sqsize) { std::deque::iterator sitr; sitr = SequencedQueue.begin(); @@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) NextSequencedSend = 0; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionStatRequest: { if(p->Size() < sizeof(SessionStats)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); break; } #ifndef COLLECTOR SessionStats *Stats=(SessionStats *)p->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, (unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta), (unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta), (unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta)); @@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX) retransmittimeout = RETRANSMIT_TIMEOUT_MAX; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); } } #endif } break; case OP_SessionStatResponse: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); } break; case OP_OutOfSession: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); } break; default: @@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) return; if(OpMgr == nullptr || *OpMgr == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; } @@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) // Convert the EQApplicationPacket to 1 or more EQProtocolPackets if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); @@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); SequencedPush(out); @@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) out->size=chunksize+2; SequencedPush(out); used+=chunksize; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); } delete p; delete[] tmpbuff; @@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p) #else MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); *(uint16 *)(p->pBuffer)=htons(NextOutSeq); SequencedQueue.push_back(p); NextOutSeq++; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) delete p; #else MOutboundQueue.lock(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); NonSequencedQueue.push(p); MOutboundQueue.unlock(); #endif @@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) void EQStream::SendAck(uint16 seq) { uint16 Seq=htons(seq); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); SetLastAckSent(seq); NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16))); } void EQStream::SendOutOfOrderAck(uint16 seq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); uint16 Seq=htons(seq); NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16))); } @@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd) // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " "buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend); NextSequencedSend = 0; retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet @@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // And remove it form the queue p = NonSequencedQueue.front(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); NonSequencedQueue.pop(); } else if (!p->combine(NonSequencedQueue.front())) { // Tryint to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked, so just remove this packet and it's spot in the queue - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); delete NonSequencedQueue.front(); NonSequencedQueue.pop(); } @@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd) if (sitr!=SequencedQueue.end()) { if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging... if(SequencedQueue.empty()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); SeqEmpty=true; continue; } if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) { if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); sitr++; NextSequencedSend++; } else if (!p) { // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } @@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } else { // No more sequenced packets @@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd) // We have a packet still, must have run out of both seq and non-seq, so send it if (p) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); ReadyToSend.push(p); BytesWritten+=p->size; } @@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd) if(SeqEmpty && NonSeqEmpty) { //no more data to send if(CheckState(CLOSING)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); //we are waiting for the queues to empty, now we can do our disconnect. //this packet will not actually go out until the next call to Write(). _SendDisconnect(); @@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses out->size=sizeof(SessionResponse); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no"); NonSequencedPush(out); @@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); NonSequencedPush(out); } @@ -932,7 +932,7 @@ void EQStream::_SendDisconnect() *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); } void EQStream::InboundQueuePush(EQRawApplicationPacket *p) @@ -959,7 +959,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if (emu_op == OP_Unknown) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -986,7 +986,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if(emu_op == OP_Unknown) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -1014,7 +1014,7 @@ void EQStream::InboundQueueClear() { EQApplicationPacket *p=nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); MInboundQueue.lock(); if (!InboundQueue.empty()) { @@ -1057,7 +1057,7 @@ void EQStream::OutboundQueueClear() { EQProtocolPacket *p=nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); MOutboundQueue.lock(); while(!NonSequencedQueue.empty()) { @@ -1079,7 +1079,7 @@ void EQStream::PacketQueueClear() { EQProtocolPacket *p=nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); if(!PacketQueue.empty()) { std::map::iterator itr; @@ -1111,7 +1111,7 @@ uint32 newlength=0; delete p; ProcessQueue(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); _hex(NET__NET_CREATE_HEX, buffer, length); } } @@ -1141,33 +1141,33 @@ std::deque::iterator itr, tmp; MOutboundQueue.lock(); //do a bit of sanity checking. if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } SeqOrder ord = CompareSequence(SequencedBase, seq); if(ord == SeqInOrder) { //they are not acking anything new... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); } else if(ord == SeqPast) { //they are nacking blocks going back before our buffer, wtf? - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); //this is a good ack, we get to ack some blocks. seq++; //we stop at the block right after their ack, counting on the wrap of both numbers. while(SequencedBase != seq) { if(SequencedQueue.empty()) { -Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); +Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); SequencedBase = NextOutSeq; NextSequencedSend = 0; break; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); //clean out the acked packet delete SequencedQueue.front(); SequencedQueue.pop_front(); @@ -1178,10 +1178,10 @@ Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS SequencedBase++; } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } @@ -1191,7 +1191,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::SetNextAckToSend(uint32 seq) { MAcks.lock(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); NextAckToSend=seq; MAcks.unlock(); } @@ -1199,7 +1199,7 @@ void EQStream::SetNextAckToSend(uint32 seq) void EQStream::SetLastAckSent(uint32 seq) { MAcks.lock(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); LastAckSent=seq; MAcks.unlock(); } @@ -1212,10 +1212,10 @@ void EQStream::ProcessQueue() EQProtocolPacket *qp=nullptr; while((qp=RemoveQueue(NextInSeq))!=nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } } @@ -1226,21 +1226,21 @@ EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } return qp; } void EQStream::SetStreamType(EQStreamType type) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); StreamType=type; switch (StreamType) { case LoginStream: app_opcode_size=1; compressed=false; encoded=false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); break; case ChatOrMailStream: case ChatStream: @@ -1248,7 +1248,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=1; compressed=false; encoded=true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); break; case ZoneStream: case WorldStream: @@ -1256,7 +1256,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=2; compressed=true; encoded=false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); break; } } @@ -1306,7 +1306,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq) void EQStream::SetState(EQStreamState state) { MState.lock(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); State=state; MState.unlock(); } @@ -1318,29 +1318,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { EQStreamState orig_state = GetState(); if (orig_state == CLOSING && !outgoing_data) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); _SendDisconnect(); SetState(DISCONNECTING); } else if (LastPacket && (now-LastPacket) > timeout) { switch(orig_state) { case CLOSING: //if we time out in the closing state, they are not acking us, just give up - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); _SendDisconnect(); SetState(CLOSED); break; case DISCONNECTING: //we timed out waiting for them to send us the disconnect reply, just give up. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); SetState(CLOSED); break; case CLOSED: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); break; case ESTABLISHED: //we timed out during normal operation. Try to be nice about it. //we will almost certainly time out again waiting for the disconnect reply, but oh well. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); _SendDisconnect(); SetState(DISCONNECTING); break; @@ -1369,11 +1369,11 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, AVERAGE_DELTA_MAX); } } else { @@ -1381,7 +1381,7 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } @@ -1391,12 +1391,12 @@ void EQStream::AdjustRates(uint32 average_delta) void EQStream::Close() { if(HasOutgoingData()) { //there is pending data, wait for it to go out. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); SetState(CLOSING); } else { //otherwise, we are done, we can drop immediately. _SendDisconnect(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); SetState(DISCONNECTING); } } @@ -1424,19 +1424,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. if(p->size == sig->first_length) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else if(sig->first_length == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else { //opcode matched but length did not. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); res = MatchFailed; } } else { //first opcode did not match.. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); res = MatchFailed; } } diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index f0fb30929..ce09e380e 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif fs->ReaderLoop(); #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); @@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif fs->WriterLoop(); #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index d267a013c..adba3dddf 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -46,7 +46,7 @@ void EQStreamIdentifier::Process() { //first see if this stream has expired if(r->expire.Check(false)) { //this stream has failed to match any pattern in our timeframe. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); delete r; cur = m_streams.erase(cur); @@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() { } if(r->stream->GetState() != ESTABLISHED) { //the stream closed before it was identified. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); switch(r->stream->GetState()) { case ESTABLISHED: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); break; case CLOSING: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); break; case DISCONNECTING: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); break; case CLOSED: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); break; } r->stream->ReleaseFromUse(); @@ -109,7 +109,7 @@ void EQStreamIdentifier::Process() { case EQStream::MatchSuccessful: { //yay, a match. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further r->stream->SetActive(true); @@ -123,7 +123,7 @@ void EQStreamIdentifier::Process() { } case EQStream::MatchFailed: //do nothing... - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); break; } } @@ -131,7 +131,7 @@ void EQStreamIdentifier::Process() { //if we checked all patches and did not find a match. if(all_ready && !found_one) { //the stream cannot be identified. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index a6425284f..c2559a233 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -91,7 +91,7 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings_loaded = true; } -std::string EQEmuLogSys::FormatDebugCategoryMessageString(uint16 log_category, std::string in_message){ +std::string EQEmuLogSys::FormatDoLogMessageString(uint16 log_category, std::string in_message){ std::string category_string = ""; if (log_category > 0 && LogCategoryName[log_category]){ category_string = StringFormat("[%s] ", LogCategoryName[log_category]); @@ -162,14 +162,14 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m #endif } -void EQEmuLogSys::DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...) +void EQEmuLogSys::DoLog(DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - std::string output_debug_message = EQEmuLogSys::FormatDebugCategoryMessageString(log_category, output_message); + std::string output_debug_message = EQEmuLogSys::FormatDoLogMessageString(log_category, output_message); EQEmuLogSys::ProcessConsoleMessage(log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 9955a2f2e..23e737720 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -82,7 +82,7 @@ public: void CloseFileLogs(); void LoadLogSettingsDefaults(); - void DebugCategory(DebugLevel debug_level, uint16 log_category, std::string message, ...); + void DoLog(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); @@ -103,7 +103,7 @@ private: bool zone_general_init = false; std::function on_log_gmsay_hook; - std::string FormatDebugCategoryMessageString(uint16 log_category, std::string in_message); + std::string FormatDoLogMessageString(uint16 log_category, std::string in_message); void ProcessConsoleMessage(uint16 log_category, const std::string message); void ProcessGMSay(uint16 log_category, std::string message); diff --git a/common/eqtime.cpp b/common/eqtime.cpp index 8f80bed91..6d6ab3fb8 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename) of.open(filename); if(!of) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); return false; } //Enable for debugging @@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename) in.open(filename); if(!in) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename); return false; } in >> version; in.ignore(80, '\n'); if(version != EQT_VERSION) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); return false; } //in >> eqTime.start_eqtime.day; diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 15a7851b8..acb275e55 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); return(false); } @@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); continue; } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); return false; } @@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } @@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); return true; } @@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); return(false); } GuildInfo *info = res->second; @@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; @@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); @@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } safe_delete_array(title_esc); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); return true; } uint32 BaseGuildManager::_GetFreeGuildID() { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -337,18 +337,18 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); return index; } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); return GUILD_NONE; } @@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) { //now store the resulting guild setup into the DB. if(!_StoreGuildDB(new_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); return(GUILD_NONE); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); return(new_id); } @@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id); QueryWithLogging(query, "deleting guild bank"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); return(true); } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); return false; } @@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); safe_delete_array(esc); return false; } safe_delete_array(esc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); info->name = name; //update our local record. @@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); return false; } @@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(!DBSetGuildRank(leader, GUILD_LEADER)) return false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); info->leader_char_id = leader; //update our local record. @@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; @@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c safe_delete_array(esc); safe_delete_array(esc_set); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); info->motd = motd; //update our local record. info->motd_setter = setter; //update our local record. @@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); info->url = URL; //update our local record. @@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); info->channel = Channel; //update our local record. @@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); return true; } @@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); return true; } @@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } @@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); return true; @@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { if(m_db == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); return false; } @@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); return true; @@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const { bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const { if(guild_id == GUILD_NONE) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); return(false); //invalid guild } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); return(char_id == res->second->leader_char_id); } @@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { if(status >= 250) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); return(true); //250+ as allowed anything } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); return(false); //invalid guild } bool granted = (res->second->minstatus <= status); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied"); return(granted); @@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const { if(rank > GUILD_MAX_RANK) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid rank } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid guild } bool granted = res->second->ranks[rank].permissions[act]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", res->second->name.c_str(), guild_id, res->second->ranks[rank].name.c_str(), rank, GuildActionNames[act], act, @@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/common/item.cpp b/common/item.cpp index ba90280a8..60ddab14c 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } if (result == INVALID_INDEX) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/common/misc_functions.h b/common/misc_functions.h index 27e648511..53ede739a 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 9e952ca74..bf0ec395b 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -52,7 +52,7 @@ namespace RoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -316,7 +316,7 @@ namespace RoF if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -551,7 +551,7 @@ namespace RoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -585,7 +585,7 @@ namespace RoF safe_delete_array(Serialized); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1386,7 +1386,7 @@ namespace RoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2556,7 +2556,7 @@ namespace RoF outapp->WriteUInt8(0); // Unknown - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3321,7 +3321,7 @@ namespace RoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3654,7 +3654,7 @@ namespace RoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3902,7 +3902,7 @@ namespace RoF Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); @@ -4498,7 +4498,7 @@ namespace RoF SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5455,7 +5455,7 @@ namespace RoF RoFSlot.MainSlot = TempSlot; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5496,7 +5496,7 @@ namespace RoF RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5601,7 +5601,7 @@ namespace RoF ServerSlot = INVALID_INDEX; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -5636,7 +5636,7 @@ namespace RoF ServerSlot = TempSlot; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 0fa71bb36..4ed34e193 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -52,7 +52,7 @@ namespace RoF2 //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF2 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF2 opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -382,7 +382,7 @@ namespace RoF2 if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -617,7 +617,7 @@ namespace RoF2 if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -651,7 +651,7 @@ namespace RoF2 safe_delete_array(Serialized); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1452,7 +1452,7 @@ namespace RoF2 char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType); if (!serialized) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2640,7 +2640,7 @@ namespace RoF2 // Think we need 1 byte of padding at the end outapp->WriteUInt8(0); // Unknown - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3387,7 +3387,7 @@ namespace RoF2 if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3721,7 +3721,7 @@ namespace RoF2 //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3973,7 +3973,7 @@ namespace RoF2 Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); @@ -4569,7 +4569,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5546,7 +5546,7 @@ namespace RoF2 RoF2Slot.MainSlot = TempSlot; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5587,7 +5587,7 @@ namespace RoF2 RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5696,7 +5696,7 @@ namespace RoF2 ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } @@ -5731,7 +5731,7 @@ namespace RoF2 ServerSlot = TempSlot; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 5b9ea0aab..750cac18b 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -50,7 +50,7 @@ namespace SoD //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoD - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoD opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -247,7 +247,7 @@ namespace SoD if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -359,7 +359,7 @@ namespace SoD if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -391,7 +391,7 @@ namespace SoD } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -967,7 +967,7 @@ namespace SoD char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2108,7 +2108,7 @@ namespace SoD if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2363,7 +2363,7 @@ namespace SoD //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3091,7 +3091,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 0ab39d521..4b215813e 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -50,7 +50,7 @@ namespace SoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoF - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -214,7 +214,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -337,7 +337,7 @@ namespace SoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -371,7 +371,7 @@ namespace SoF } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -766,7 +766,7 @@ namespace SoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1707,7 +1707,7 @@ namespace SoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1887,7 +1887,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -2429,7 +2429,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index de9237636..f96720713 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index f607941fd..c46cba392 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -48,7 +48,7 @@ namespace Titanium //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -74,7 +74,7 @@ namespace Titanium - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -89,10 +89,10 @@ namespace Titanium opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -187,7 +187,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -268,7 +268,7 @@ namespace Titanium int itemcount = in->size / sizeof(InternalSerializedItem_Struct); if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; return; } @@ -285,7 +285,7 @@ namespace Titanium safe_delete_array(serialized); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -635,7 +635,7 @@ namespace Titanium char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1157,7 +1157,7 @@ namespace Titanium if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1274,7 +1274,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -1623,7 +1623,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 2602a62c1..faa19af67 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -50,7 +50,7 @@ namespace Underfoot //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace Underfoot - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace Underfoot opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -307,7 +307,7 @@ namespace Underfoot if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -494,7 +494,7 @@ namespace Underfoot if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -526,7 +526,7 @@ namespace Underfoot safe_delete_array(Serialized); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1190,7 +1190,7 @@ namespace Underfoot char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2374,7 +2374,7 @@ namespace Underfoot if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2624,7 +2624,7 @@ namespace Underfoot //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3406,7 +3406,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = UnderfootToServerSlot(eq->from_slot); emu->to_slot = UnderfootToServerSlot(eq->to_slot); diff --git a/common/ptimer.cpp b/common/ptimer.cpp index 0a987a908..c9fe7f4f6 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { if (this == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); return(true); } uint32 current_time = get_current_time(); @@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); #endif return false; } diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 92a4993aa..ef8e0fa4d 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); return(false); } } @@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas switch(type) { case IntRule: m_RuleIntValues [index] = atoi(rule_value); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); break; case RealRule: m_RuleRealValues[index] = atof(rule_value); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); break; case BoolRule: uint32 val = 0; if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1")) val = 1; m_RuleBoolValues[index] = val; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); break; } @@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas } void RuleManager::ResetRules() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); #define RULE_INT(cat, rule, default_value) \ m_RuleIntValues[ Int__##rule ] = default_value; #define RULE_REAL(cat, rule, default_value) \ @@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & return(true); } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); return(false); } @@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) { m_activeRuleset = _FindOrCreateRuleset(db, ruleset); if(m_activeRuleset == -1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); return; } m_activeName = ruleset; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } int r; @@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { int rsid = GetRulesetID(db, ruleset); if(rsid < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); return(false); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); m_activeRuleset = rsid; m_activeName = ruleset; @@ -282,13 +282,13 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } for(auto row = results.begin(); row != results.end(); ++row) if(!SetRule(row[0], row[1], nullptr, false)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); return true; } @@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } @@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 3abca55d8..924e4cfe5 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } @@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); return false; } @@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: %s %i has an invalid item_id %i in inventory slot %i", ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); continue; @@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (put_slot_id != INVALID_INDEX) continue; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", ((is_charid==true)? "charid": "acctid"), id, item_id, slot_id); if (is_charid) @@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); continue; } @@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { else if (slot_id >= 3111 && slot_id <= 3179) { // Admins: please report any occurrences of this error - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); put_slot_id = inv->PushCursor(*inst); } else @@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); } } @@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); } @@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() { items_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(items_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); return false; } @@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ try { hash.insert(item.ID, item); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); break; } } @@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile) } if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile); txtout.assign(" ",1); return txtout; } @@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() { faction_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(faction_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); return false; } @@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) inst = new ItemInst(item, charges); if (inst == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() { mutex.Unlock(); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); return false; } @@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) { const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); return; } @@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } @@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() { mutex.Unlock(); } catch(std::exception& ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); return false; } @@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { cl = atoi(row[1]); if(lvl <= 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); continue; } if(lvl >= max_level) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); continue; } if(cl <= 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); continue; } if(cl > 16) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); continue; } @@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; @@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() { loot_drop_mmf->Size()); mutex.Unlock(); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); return false; } @@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { return &loot_table_hash->at(loottable_id); } } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); } return nullptr; } @@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { return &loot_drop_hash->at(lootdrop_id); } } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); } return nullptr; } diff --git a/common/spdat.cpp b/common/spdat.cpp index c54dfd1de..a628c8fa7 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -839,7 +839,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index a0890c1ec..eb8244d04 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -39,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo EQApplicationPacket *p = *in_p; *in_p = nullptr; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); delete p; } void StructStrategy::ErrorDecoder(EQApplicationPacket *p) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); p->SetOpcode(OP_Unknown); } diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index b7434b947..9bf1de258 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index f61418a50..8fdf64dd7 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); #endif tcps->MLoopRunning.lock(); @@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index f0908b558..92bf6e32e 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() { Timeoutable *it = *cur; if(it->next_check.Check()) { #ifdef TIMEOUT_DEBUG - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Checking timeout on 0x%x\n", it); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Checking timeout on 0x%x\n", it); #endif it->CheckTimeout(); } @@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) { DeleteMember(who); //just in case... prolly not needed. members.push_back(who); #ifdef TIMEOUT_DEBUG - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Adding timeoutable 0x%x\n", who); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Adding timeoutable 0x%x\n", who); #endif } void TimeoutManager::DeleteMember(Timeoutable *who) { #ifdef TIMEOUT_DEBUG - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None,, "Removing timeoutable 0x%x\n", who); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Removing timeoutable 0x%x\n", who); #endif std::vector::iterator cur,end; cur = members.begin(); diff --git a/common/worldconn.cpp b/common/worldconn.cpp index f1820186f..1947ec0e8 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) { void WorldConnection::OnConnected() { const EQEmuConfig *Config=EQEmuConfig::get(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16); MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); @@ -76,7 +76,7 @@ bool WorldConnection::Connect() { if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { return true; } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); } return false; } diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index c145ed9a6..47ccbf6a9 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -47,13 +47,13 @@ int main(int argc, char *argv[]) { launcher_name = argv[1]; } if(launcher_name.length() < 1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); return 1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); if (!EQEmuConfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); return 1; } const EQEmuConfig *Config = EQEmuConfig::get(); @@ -62,16 +62,16 @@ int main(int argc, char *argv[]) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::map zones; WorldServer world(zones, launcher_name.c_str(), Config); if (!world.Connect()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); } std::map::iterator zone, zend; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); // zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1"); @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { void CatchSignal(int sig_num) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); RunLoops = false; } diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index 4d537c40b..a63ac1022 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -74,14 +74,14 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; } case ServerOP_LauncherZoneRequest: { if(pack->size != sizeof(LauncherZoneRequest)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); break; } const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer; @@ -90,9 +90,9 @@ void WorldServer::Process() { switch(ZoneRequestCommands(lzr->command)) { case ZR_Start: { if(m_zones.find(lzr->short_name) != m_zones.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config); m_zones[lzr->short_name] = l; } @@ -101,9 +101,9 @@ void WorldServer::Process() { case ZR_Restart: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); res->second->Restart(); } break; @@ -111,9 +111,9 @@ void WorldServer::Process() { case ZR_Stop: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); res->second->Stop(); } break; @@ -127,7 +127,7 @@ void WorldServer::Process() { } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); break; } } diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index 66baf675b..2e40a94d1 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -72,7 +72,7 @@ void ZoneLaunch::Start() { //spec is consumed, even on failure m_ref = ProcLauncher::get()->Launch(spec); if(m_ref == ProcLauncher::ProcError) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); m_timer.Start(m_config->RestartWait); return; } @@ -84,17 +84,17 @@ void ZoneLaunch::Start() { SendStatus(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); } void ZoneLaunch::Restart() { switch(m_state) { case StateRestartPending: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); break; case StateStartPending: //we havent started yet, do nothing - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); break; case StateStarted: //process is running along, kill it off.. @@ -102,20 +102,20 @@ void ZoneLaunch::Restart() { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, true)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateRestartPending; break; case StateStopPending: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); break; case StateStopped: //process is already stopped... nothing to do.. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -124,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) { switch(m_state) { case StateStartPending: //we havent started yet, transition directly to stopped. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); m_state = StateStopped; break; case StateStarted: @@ -134,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, graceful)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateStopPending; break; case StateStopped: //process is already stopped... nothing to do.. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -164,17 +164,17 @@ bool ZoneLaunch::Process() { m_timer.Disable(); //actually start up the program - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); Start(); //now update the shared timer to reflect the proper start interval. if(s_running == 1) { //we are the first zone started. wait that interval. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); s_startTimer.Start(m_config->InitialBootWait); } else { //just some follow on zone, use that interval. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); s_startTimer.Start(m_config->ZoneBootInterval); } @@ -187,7 +187,7 @@ bool ZoneLaunch::Process() { //waiting for notification that our child has died.. if(m_timer.Check()) { //we have timed out, try to kill the child again - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Restart(); } break; @@ -197,12 +197,12 @@ bool ZoneLaunch::Process() { //we have timed out, try to kill the child again m_killFails++; if(m_killFails > 5) { //should get this number from somewhere.. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); m_state = StateStopped; s_running--; SendStatus(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Stop(false); } } @@ -221,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche switch(m_state) { case StateStartPending: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateStarted: //something happened to our happy process... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateRestartPending: //it finally died, start it on up again - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); m_state = StateStartPending; break; case StateStopPending: //it finally died, transition to close. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); m_state = StateStopped; break; case StateStopped: //we already thought it was stopped... dont care... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); break; } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 414f7a91f..292fb7bf2 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -69,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, safe_delete_array(escapedMessage); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } @@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->char2_money.silver, QS->char2_money.copper, QS->char2_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->npc_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(members == 0) @@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ lastIndex, QS->Chars[i].char_id); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->char_id, QS->stack_size, QS->char_count, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->char_count, QS->postaction); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->char_money.copper, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { std::string query(queryBuffer); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } safe_delete(pack); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index cb3143d7b..e2ef1dd6c 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -40,7 +40,7 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -242,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -257,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -288,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -305,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -335,7 +335,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } @@ -348,7 +348,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 9011d94f5..76dfc7b5a 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -65,16 +65,16 @@ int main() { */ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!database.Connect( @@ -83,22 +83,22 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } /* Initialize Logging */ if (!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index b2a3d0605..f4aca7f06 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -53,7 +53,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -66,7 +66,7 @@ void WorldServer::Process() ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { case 0: { break; @@ -148,7 +148,7 @@ void WorldServer::Process() break; } default: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); break; } break; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index a6921624e..38c4640b5 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -40,22 +40,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -114,61 +114,61 @@ int main(int argc, char **argv) { } if(load_all || load_items) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading items..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading items..."); try { LoadItems(&database); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_factions) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading factions..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading factions..."); try { LoadFactions(&database); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_loot) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading loot..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading loot..."); try { LoadLoot(&database); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_skill_caps) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading skill caps..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading skill caps..."); try { LoadSkillCaps(&database); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_spells) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spells..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spells..."); try { LoadSpells(&database); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_bd) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading base data..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading base data..."); try { LoadBaseData(&database); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 06c05516f..c1d797f26 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -42,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -149,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) { void ChatChannelList::RemoveChannel(ChatChannel *Channel) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); LinkedListIterator iterator(ChatChannels); @@ -170,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) { void ChatChannelList::RemoveAllChannels() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); LinkedListIterator iterator(ChatChannels); @@ -228,7 +228,7 @@ void ChatChannel::AddClient(Client *c) { if(IsClientInChannel(c)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); return; } @@ -237,7 +237,7 @@ void ChatChannel::AddClient(Client *c) { int AccountStatus = c->GetAccountStatus(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); LinkedListIterator iterator(ClientsInChannel); @@ -262,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) { if(!c) return false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); bool HideMe = c->GetHideMe(); @@ -299,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) { if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0)) return false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000); } @@ -397,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); ChannelClient->SendChannelMessage(Name, Message, Sender); } @@ -479,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client return nullptr; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); ChatChannel *RequiredChannel = FindChannel(NormalisedName); @@ -555,7 +555,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); @@ -572,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) { Invitees.push_back(Invitee); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); } } @@ -587,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) { Invitees.erase(Iterator); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); return; } @@ -613,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) { Moderators.push_back(Moderator); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); } } @@ -628,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) { Moderators.erase(Iterator); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); return; } @@ -654,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) { Voiced.push_back(inVoiced); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); } } @@ -669,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) { Voiced.erase(Iterator); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); return; } diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index de18778c8..0ad2b6157 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -236,7 +236,7 @@ std::vector ParseRecipients(std::string RecipientString) { static void ProcessMailTo(Client *c, std::string MailMessage) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); std::vector Recipients; @@ -305,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -400,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) { static void ProcessCommandBuddy(Client *c, std::string Buddy) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); c->GeneralChannelMessage("Buddy list modified"); uint8 SubAction = 1; @@ -430,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { static void ProcessCommandIgnore(Client *c, std::string Ignoree) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); c->GeneralChannelMessage("Ignore list modified"); uint8 SubAction = 0; @@ -481,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) { exit(1); if (chatsf->Open()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); exit(1); } @@ -560,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) { if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName()) && (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); struct in_addr in; in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -586,7 +586,7 @@ void Clientlist::Process() { in.s_addr = eqs->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); eqs->SetOpcodeManager(&ChatOpMgr); @@ -606,7 +606,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -646,7 +646,7 @@ void Clientlist::Process() { if(strlen(PacketBuffer) != 9) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -667,11 +667,11 @@ void Clientlist::Process() { else CharacterName = MailBoxString.substr(LastPeriod + 1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; @@ -703,7 +703,7 @@ void Clientlist::Process() { default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); break; } } @@ -716,7 +716,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()), KeyValid, (*Iterator)->GetForceDisconnect()); @@ -860,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) break; case CommandSetMessageStatus: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); ProcessSetMessageStatus(Parameters); break; @@ -885,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) default: c->SendHelp(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); } } @@ -896,7 +896,7 @@ void Clientlist::CloseAllConnections() { for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); (*Iterator)->CloseConnection(); } @@ -905,7 +905,7 @@ void Clientlist::CloseAllConnections() { void Client::AddCharacter(int CharID, const char *CharacterName, int Level) { if(!CharacterName) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); CharacterEntry NewCharacter; NewCharacter.CharID = CharID; NewCharacter.Name = CharacterName; @@ -971,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { for(int i = 0; i < MAX_JOINED_CHANNELS; i++) if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; } } @@ -1012,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) { } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); int NumberOfChannels = ChannelCount(); @@ -1113,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) { void Client::LeaveChannels(std::string ChannelNameList) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); std::string::size_type CurrentPos = 0; @@ -1292,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message) std::string ChannelName = Message.substr(1, MessageStart-1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1435,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if(RuleB(Chat, EnableAntiSpam)) @@ -1647,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) { else Message = "Password change on channel " + ChannelName; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1702,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1790,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Invitee); @@ -1918,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Moderator); @@ -1999,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Voicee); @@ -2087,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Kickee); @@ -2196,32 +2196,32 @@ void Client::SetConnectionType(char c) { case 'S': { TypeOfConnection = ConnectionTypeCombined; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); break; } case 'U': { TypeOfConnection = ConnectionTypeCombined; UnderfootOrLater = true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); break; } case 'M': { TypeOfConnection = ConnectionTypeMail; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); break; } case 'C': { TypeOfConnection = ConnectionTypeChat; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); break; } default: { TypeOfConnection = ConnectionTypeUnknown; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); } } } @@ -2299,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin void Client::ChangeMailBox(int NewMailBox) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); SetMailBox(NewMailBox); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); auto outapp = new EQApplicationPacket(OP_MailboxChange, 2); @@ -2377,13 +2377,13 @@ std::string Client::MailBoxName() { if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return ""; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index 8fe5918e7..0c1bdee65 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -74,14 +74,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) { client->GetAccountID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); if(results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); return; } @@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) { client->SetKarma(atoi(row[2])); client->SetRevoked((atoi(row[3])==1?true:false)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); } int Database::FindAccount(const char *characterName, Client *client) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); client->ClearCharacters(); @@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) { characterName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); return -1; } if (results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); return -1; } @@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) { int accountID = atoi(row[1]); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` " "WHERE `account_id` = %i AND `name` != '%s'", @@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri characterName.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); return false; } @@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri else sprintf(combinedKey, "%s", MailKey.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); return !strcmp(row[0], combinedKey); } @@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } safe_delete(safeCharName); if (results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); return -1; } @@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ bool Database::LoadChatChannels() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -267,25 +267,25 @@ bool Database::LoadChatChannels() { void Database::SetChannelPassword(std::string channelName, std::string password) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::SetChannelOwner(std::string channelName, std::string owner) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) { int unknownField3 = 1; int characterID = FindCharacter(client->MailBoxName().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) { int characterID = FindCharacter(client->MailBoxName().c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) { auto row = results.begin(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]); @@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub characterID = FindCharacter(characterName.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); if(characterID <= 0) return false; @@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); Client *client = CL->IsCharacterOnline(characterName); @@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub void Database::SetMessageStatus(int messageNumber, int status) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); if(status == 0) { std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber); @@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::ExpireMail() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } auto row = results.begin(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { @@ -524,9 +524,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); if(results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -536,9 +536,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); if(results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread @@ -547,9 +547,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); if(results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } @@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); } @@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends if(atoi(row[0]) == 0) { ignorees.push_back(name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); continue; } friends.push_back(name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); } } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 196200a48..22f285f25 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -78,11 +78,11 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); return 1; } @@ -90,13 +90,13 @@ int main() { Config = ucsconfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); WorldShortName = Config->ShortName; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -104,22 +104,22 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -127,7 +127,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -138,11 +138,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index c6e91d47c..dc327cb48 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -52,7 +52,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -67,7 +67,7 @@ void WorldServer::Process() while((pack = tcpc.PopPacket())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { @@ -88,7 +88,7 @@ void WorldServer::Process() std::string Message = Buffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); Client *c = CL->FindCharacter(From); @@ -99,7 +99,7 @@ void WorldServer::Process() if(!c) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); break; } diff --git a/world/adventure.cpp b/world/adventure.cpp index 02ef42459..14a7a141b 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); @@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index edbed3776..3fbcf96bb 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/world/client.cpp b/world/client.cpp index 1606de8af..268c0153c 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -136,7 +136,7 @@ void Client::SendEnterWorld(std::string name) eqs->Close(); return; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); } } @@ -378,7 +378,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if (strlen(password) <= 1) { // TODO: Find out how to tell the client wrong username/password - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); return false; } @@ -408,31 +408,31 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password))) #else if (loginserverlist.Connected() == false && !pZoning) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); return false; } if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password)))) #endif { if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); if(!minilogin) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); return false; } cle->SetOnline(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); if(minilogin){ WorldConfig::DisableStats(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); } const WorldConfig *Config=WorldConfig::get(); @@ -465,7 +465,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { } else { // TODO: Find out how to tell the client wrong username/password - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); return false; } @@ -479,7 +479,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); return false; } @@ -487,7 +487,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) uchar race = app->pBuffer[64]; uchar clas = app->pBuffer[68]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); EQApplicationPacket *outapp; outapp = new EQApplicationPacket; @@ -648,11 +648,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app) bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); return false; } else if (app->size != sizeof(CharCreate_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); DumpPacket(app); // the previous behavior was essentially returning true here // but that seems a bit odd to me. @@ -679,14 +679,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); eqs->Close(); return true; } if(GetAdmin() < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); eqs->Close(); return true; } @@ -702,14 +702,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { uint32 tmpaccid = 0; charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID); if (charid == 0 || tmpaccid != GetAccountID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); eqs->Close(); return true; } // Make sure this account owns this character if (tmpaccid != GetAccountID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); eqs->Close(); return true; } @@ -737,7 +737,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { zoneID = database.MoveCharacterToBind(charid,4); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able."); eqs->Close(); return true; @@ -770,7 +770,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character."); eqs->Close(); return true; @@ -780,7 +780,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (zoneID == 0 || !database.GetZoneName(zoneID)) { // This is to save people in an invalid zone, once it's removed from the DB database.MoveCharacterToZone(charid, "arena"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); } if(instanceID > 0) @@ -894,7 +894,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) { uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer); if(char_acct_id == GetAccountID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); database.DeleteCharacter((char *)app->pBuffer); SendCharInfo(); } @@ -915,25 +915,25 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { EmuOpcode opcode = app->GetOpcode(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); _pkt(WORLD__CLIENT_TRACE,app); if (!eqs->CheckState(ESTABLISHED)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); return false; } // Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) { if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); eqs->Close(); } } if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) { // Got a packet other than OP_SendLoginInfo when not logged in - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); return false; } else if (opcode == OP_AckPacket) { @@ -1005,7 +1005,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); _pkt(WORLD__CLIENT_ERR,app); return true; } @@ -1024,7 +1024,7 @@ bool Client::Process() { to.sin_addr.s_addr = ip; if (autobootup_timeout.Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); ZoneUnavail(); } if(connect.Check()){ @@ -1058,7 +1058,7 @@ bool Client::Process() { loginserverlist.SendPacket(pack); safe_delete(pack); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); return false; } @@ -1107,17 +1107,17 @@ void Client::EnterWorld(bool TryBootup) { } else { if (TryBootup) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); autobootup_timeout.Start(); pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID); if (pwaitingforbootup == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); ZoneUnavail(); } return; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); ZoneUnavail(); return; } @@ -1126,12 +1126,12 @@ void Client::EnterWorld(bool TryBootup) { cle->SetChar(charid, char_name); database.UpdateLiveChar(char_name, GetAccountID()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); // database.SetAuthentication(account_id, char_name, zone_name, ip); if (seencharsel) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); ZoneUnavail(); return; } @@ -1169,9 +1169,9 @@ void Client::Clearance(int8 response) { if (zs == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); } ZoneUnavail(); @@ -1181,20 +1181,20 @@ void Client::Clearance(int8 response) EQApplicationPacket* outapp; if (zs->GetCAddress() == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); ZoneUnavail(); return; } if (zoneID == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } const char* zonename = database.GetZoneName(zoneID); if (zonename == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } @@ -1225,7 +1225,7 @@ void Client::Clearance(int8 response) } strcpy(zsi->ip, zs_addr); zsi->port =zs->GetCPort(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); QueuePacket(outapp); safe_delete(outapp); @@ -1256,7 +1256,7 @@ bool Client::GenPassKey(char* key) { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); _pkt(WORLD__CLIENT_TRACE, app); ack_req = true; // It's broke right now, dont delete this line till fix it. =P @@ -1355,27 +1355,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA, stats_sum); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); /* Validate the char creation struct */ if (ClientVersionBit & BIT_SoFAndLater) { if (!CheckCharCreateInfoSoF(cc)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } else { if (!CheckCharCreateInfoTitanium(cc)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } @@ -1437,21 +1437,21 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) /* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */ if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); pp.zone_id = RuleI(World, SoFStartZoneID); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); } else { /* if there's a startzone variable put them in there */ if (database.GetVariable("startzone", startzone, 50)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); pp.zone_id = database.GetZoneID(startzone); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); } else { /* otherwise use normal starting zone logic */ bool ValidStartZone = false; if (ClientVersionBit & BIT_TitaniumAndEarlier) @@ -1490,11 +1490,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) pp.binds[0].z = pp.z; pp.binds[0].heading = pp.heading; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z); /* Starting Items inventory */ @@ -1503,10 +1503,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) // now we give the pp and the inv we made to StoreCharacter // to see if we can store it if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); return false; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); return true; } @@ -1516,7 +1516,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) if (!cc) return false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); RaceClassCombos class_combo; bool found = false; @@ -1533,7 +1533,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); return false; } @@ -1550,7 +1550,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); return false; } @@ -1563,37 +1563,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) allocation.DefaultPointAllocation[6]; if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); return false; } if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); return false; } if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); return false; } if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); return false; } if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); return false; } if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); return false; } if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); return false; } @@ -1606,7 +1606,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) current_stats += cc->WIS - allocation.BaseStats[5]; current_stats += cc->CHA - allocation.BaseStats[6]; if (current_stats > max_stats) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); return false; } @@ -1687,7 +1687,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) if (!cc) return false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); classtemp = cc->class_ - 1; racetemp = cc->race - 1; @@ -1700,16 +1700,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // if out of range looking it up in the table would crash stuff // so we return from these if (classtemp >= PLAYER_CLASS_COUNT) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); return false; } if (racetemp >= _TABLE_RACES) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); return false; } if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs? - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); // we return from this one, since if it's an invalid combination our table // doesn't have meaningful values for the stats return false; @@ -1737,43 +1737,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // that are messed up not just the first hit if (bTOTAL + stat_points != cTOTAL) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); Charerrors++; } if (cc->STR > bSTR + stat_points || cc->STR < bSTR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); Charerrors++; } if (cc->STA > bSTA + stat_points || cc->STA < bSTA) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); Charerrors++; } if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); Charerrors++; } if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); Charerrors++; } if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); Charerrors++; } if (cc->INT > bINT + stat_points || cc->INT < bINT) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); Charerrors++; } if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); Charerrors++; } /*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of) I am NOT writing those tables - kathgar*/ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); return Charerrors == 0; } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index 1dc8f3eca..ceb147fa3 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) { int16 tmpStatus = WorldConfig::get()->DefaultStatus; paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID()); if (!paccountid) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); return false; } strn0cpy(paccountname, plsname, sizeof(paccountname)); diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 0d874b304..c3cbc7a7c 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -56,7 +56,7 @@ void ClientList::Process() { if (!iterator.GetData()->Process()) { struct in_addr in; in.s_addr = iterator.GetData()->GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); //the client destructor should take care of this. // iterator.GetData()->Free(); iterator.RemoveCurrent(); @@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID) if(!from) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); return; } @@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S safe_delete(output); } catch(...){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); return; } } @@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon safe_delete(pack2); } catch(...){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); return; } } @@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) { iterator.Reset(); while(iterator.MoreElements()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); if (iterator.GetData()->GetAccountID() == account_id) { Client* tmp = iterator.GetData(); return tmp; @@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) { iterator.Reset(); while(iterator.MoreElements()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); if (iterator.GetData()->GetCharName() == charname) { Client* tmp = iterator.GetData(); return tmp; diff --git a/world/console.cpp b/world/console.cpp index f1f4a7edf..6b51deb34 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -88,7 +88,7 @@ void Console::Die() { state = CONSOLE_STATE_CLOSED; struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); tcpc->Disconnect(); } @@ -219,7 +219,7 @@ bool Console::Process() { if (!tcpc->Connected()) { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); return false; } //if we have not gotten the special markers after this timer, send login prompt @@ -234,7 +234,7 @@ bool Console::Process() { SendMessage(1, "Timeout, disconnecting..."); struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); return false; } @@ -243,29 +243,29 @@ bool Console::Process() { in.s_addr = GetIP(); if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) { auto zs = new ZoneServer(tcpc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); zoneserver_list.Add(zs); numzones++; tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); launcher_list.Add(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); UCSLink.SetConnection(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); QSLink.SetConnection(tcpc); tcpc = 0; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); } return false; } @@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) { state = CONSOLE_STATE_CLOSED; return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); SendMessage(1, 0); SendMessage(2, "Login accepted."); state = CONSOLE_STATE_CONNECTED; @@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) { break; } case CONSOLE_STATE_CONNECTED: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); Seperator sep(command); if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) { SendMessage(1, " whoami"); @@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) { tmpname[0] = '*'; strcpy(&tmpname[1], paccountname); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0)); } } @@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) { #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); } else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) { if (strcasecmp(sep.arg[1], "list") == 0) { diff --git a/world/eql_config.cpp b/world/eql_config.cpp index c23c82b06..c2088b56d 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() { std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); else { auto row = results.begin(); m_dynamics = atoi(row[0]); @@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() { query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); return; } @@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } @@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } @@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/eqw.cpp b/world/eqw.cpp index 1c0b811ee..2cc6262df 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -269,7 +269,7 @@ void EQW::LSReconnect() { pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index 9737bca12..fbe6ea000 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const { int16 status = 0; uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status); if(acctid == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); return(false); } if(status < httpLoginStatus) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); return(false); } @@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP } void EQWHTTPServer::Stop() { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); m_running = false; Close(); } bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { if(m_running) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); return(false); } //load up our nice mime types if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); return(false); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); } //fire up the server thread char errbuf[TCPServer_ErrorBufferSize]; if(!Open(port, errbuf)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); return(false); } diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index f3f5dd50f..4c80ac7e7 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -65,7 +65,7 @@ EQWParser::EQWParser() { my_perl = perl_alloc(); _empty_sv = newSV(0); if(!my_perl) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); else DoInit(); } @@ -182,10 +182,10 @@ void EQWParser::DoInit() { #ifdef EMBPERL_PLUGIN - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); std::string err; if(!eval_file("world", "worldui.pl", err)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); } eval_pv( diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 8e1c65afe..300d94b3f 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -79,7 +79,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -90,7 +90,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -100,7 +100,7 @@ bool LauncherLink::Process() { } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -114,25 +114,25 @@ bool LauncherLink::Process() { break; } case ServerOP_ZAAuth: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); break; } case ServerOP_LauncherConnectInfo: { const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer; if(HasName()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); break; } m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); if(config == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); std::vector result; //database.GetLauncherZones(it->name, result); @@ -146,7 +146,7 @@ bool LauncherLink::Process() { zs.port = cur->port; zs.up = false; zs.starts = 0; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); m_states[cur->name] = zs; } @@ -162,17 +162,17 @@ bool LauncherLink::Process() { std::map::iterator res; res = m_states.find(it->short_name); if(res == m_states.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); break; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); res->second.up = it->running; res->second.starts = it->start_count; break; } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) { zs.port = port; zs.up = false; zs.starts = 0; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); m_states[short_name] = zs; StartZone(short_name); diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 56c9c38e1..4b2af8169 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -60,7 +60,7 @@ void LauncherList::Process() { //printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); cur = m_pendingLaunchers.erase(cur); delete l; } else if(l->HasName()) { @@ -72,10 +72,10 @@ void LauncherList::Process() { std::map::iterator res; res = m_launchers.find(name); if(res != m_launchers.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); delete res->second; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); //put the launcher in the list. m_launchers[name] = l; } else { @@ -91,7 +91,7 @@ void LauncherList::Process() { //printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); curl = m_launchers.erase(curl); delete l; } else { @@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { void LauncherList::Add(EmuTCPConnection *conn) { auto it = new LauncherLink(nextID++, conn); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); m_pendingLaunchers.push_back(it); } diff --git a/world/login_server.cpp b/world/login_server.cpp index 10b6e36c8..688a50a4b 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -96,7 +96,7 @@ bool LoginServer::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { @@ -160,12 +160,12 @@ bool LoginServer::Process() { case ServerOP_LSFatalError: { #ifndef IGNORE_LS_FATAL_ERROR WorldConfig::DisableLoginserver(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); #else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); #endif if (pack->size > 1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); } break; } @@ -177,18 +177,18 @@ bool LoginServer::Process() { case ServerOP_LSRemoteAddr: { if (!Config->WorldAddress.length()) { WorldConfig::SetWorldAddress((char *)pack->pBuffer); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); } break; } case ServerOP_LSAccountUpdate: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); CanAccountUpdate = true; break; } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -202,10 +202,10 @@ bool LoginServer::Process() { bool LoginServer::InitLoginServer() { if(Connected() == false) { if(ConnectReady()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); Connect(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", LoginServerAddress,LoginServerPort); } } @@ -216,29 +216,29 @@ bool LoginServer::Connect() { char tmp[25]; if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){ minilogin = true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); } else minilogin = false; if (minilogin && WorldConfig::get()->WorldAddress.length()==0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); return false; } char errbuf[TCPConnection_ErrorBufferSize]; if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); return false; } if (LoginServerIP == 0 || LoginServerPort == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); return false; } if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); if (minilogin) SendInfo(); else @@ -248,7 +248,7 @@ bool LoginServer::Connect() { return true; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); return false; } } @@ -324,7 +324,7 @@ void LoginServer::SendStatus() { void LoginServer::SendAccountUpdate(ServerPacket* pack) { ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; if(CanUpdate()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); strn0cpy(s->worldaccount, LoginAccount, 30); strn0cpy(s->worldpassword, LoginPassword, 30); SendPacket(pack); diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index 1504badcc..305c79b23 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) { bool LoginServerList::SendAccountUpdate(ServerPacket* pack) { LinkedListIterator iterator(list); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); iterator.Reset(); while(iterator.MoreElements()){ if(iterator.GetData()->CanUpdate()) { diff --git a/world/net.cpp b/world/net.cpp index d6ea3259d..1d96c6d54 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -126,36 +126,36 @@ int main(int argc, char** argv) { } // Load server configuration - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #endif @@ -164,7 +164,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -172,19 +172,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -280,56 +280,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); database.LoadVariables(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); database.LoadZoneNames(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); database.ClearGroup(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); if (!database.LoadItems()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -338,45 +338,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -404,7 +404,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -417,19 +417,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -492,16 +492,16 @@ int main(int argc, char** argv) { } Sleep(20); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); console_list.KillAll(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); tcps.Close(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); eqsf.Close(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); CheckEQEMuErrorAndPause(); @@ -509,9 +509,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); RunLoops = false; } diff --git a/world/queryserv.cpp b/world/queryserv.cpp index b206dc961..d15f7d48a 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); Stream->Disconnect(); } @@ -57,7 +57,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -69,7 +69,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -79,7 +79,7 @@ bool QueryServConnection::Process() } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -97,7 +97,7 @@ bool QueryServConnection::Process() } case ServerOP_ZAAuth: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); break; } case ServerOP_QueryServGeneric: @@ -114,7 +114,7 @@ bool QueryServConnection::Process() } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/ucs.cpp b/world/ucs.cpp index 91ac8afba..22a1ecdf6 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); Stream->Disconnect(); } @@ -52,7 +52,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -64,7 +64,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -74,7 +74,7 @@ bool UCSConnection::Process() } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -92,12 +92,12 @@ bool UCSConnection::Process() } case ServerOP_ZAAuth: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); break; } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index a4de9647d..e0621ef8d 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -34,7 +34,7 @@ WorldGuildManager guild_mgr; void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, } void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui } void WorldGuildManager::SendGuildDelete(uint32 guild_id) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!RefreshGuild(s->guild_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); //can we do anything? } @@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); //preform the local update client_list.UpdateClientGuild(s->char_id, s->guild_id); @@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!LocalDeleteGuild(s->guild_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); //can we do anything? } @@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildMemberUpdate: { if(pack->size != sizeof(ServerGuildMemberUpdate_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); return; } @@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { } default: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); break; } } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 2955cd6d9..6ec2df6a6 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,11 +298,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector &rl) { const std::string query = "SELECT name FROM launcher"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); return; } @@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) { MailKeyString, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); } @@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level) std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index d1abf523a..38485fb59 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -79,7 +79,7 @@ void ZSList::KillAll() { void ZSList::Process() { if(shutdowntimer && shutdowntimer->Check()){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); auto pack2 = new ServerPacket; pack2->opcode = ServerOP_ShutdownAll; pack2->size=0; @@ -99,10 +99,10 @@ void ZSList::Process() { ZoneServer* zs = iterator.GetData(); struct in_addr in; in.s_addr = zs->GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); zs->LSShutDownUpdate(zs->GetZoneID()); if (holdzones){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); if(!zs->IsStaticZone()) RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID()); else @@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip s->port = port; s->zoneid = zoneid; if(zoneid != 0) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); tmp[z]->SendPacket(pack); delete pack; safe_delete_array(tmp); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 4a09a7b98..3d4376aeb 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -77,7 +77,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { char* longname; if (iZoneID) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, iStaticZone ? " (Static)" : ""); zoneID = iZoneID; @@ -188,7 +188,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -199,7 +199,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -209,7 +209,7 @@ bool ZoneServer::Process() { } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } } @@ -541,10 +541,10 @@ bool ZoneServer::Process() { RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer; if (zoneserver_list.SendPacket(pack)){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); } break; } @@ -589,10 +589,10 @@ bool ZoneServer::Process() { ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer; sci->port = clientport; SendPacket(&p); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); } else { clientport=sci->port; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); } } @@ -602,7 +602,7 @@ bool ZoneServer::Process() { const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer; launcher_name = ln->launcher_name; launched_name = ln->zone_name; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); break; } case ServerOP_ShutdownAll: { @@ -685,12 +685,12 @@ bool ZoneServer::Process() { if(WorldConfig::get()->UpdateStats) client = client_list.FindCharacter(ztz->name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", ztz->name, ztz->current_zone_id, ztz->requested_zone_id); /* This is a request from the egress zone */ if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) { ztz->response = 0; @@ -708,20 +708,20 @@ bool ZoneServer::Process() { /* Zone was already running*/ if(ingress_server) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); ztz->response = 1; } /* Boot the Zone*/ else { int server_id; if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); // bootup successful, ready to rock ztz->response = 1; ingress_server = zoneserver_list.FindByID(server_id); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); // bootup failed, send back error code 0 ztz->response = 0; } @@ -736,7 +736,7 @@ bool ZoneServer::Process() { /* Response from Ingress server, route back to egress */ else{ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); ZoneServer *egress_server = nullptr; if(ztz->current_instance_id > 0) { egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id); @@ -754,7 +754,7 @@ bool ZoneServer::Process() { } case ServerOP_ClientList: { if (pack->size != sizeof(ServerClientList_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); break; } client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer); @@ -763,7 +763,7 @@ bool ZoneServer::Process() { case ServerOP_ClientListKA: { ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer; if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); break; } client_list.CLEKeepAlive(sclka->numupdates, sclka->wid); @@ -868,7 +868,7 @@ bool ZoneServer::Process() { } case ServerOP_GMGoto: { if (pack->size != sizeof(ServerGMGoto_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); break; } ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer; @@ -888,7 +888,7 @@ bool ZoneServer::Process() { } case ServerOP_Lock: { if (pack->size != sizeof(ServerLock_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); break; } ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer; @@ -913,7 +913,7 @@ bool ZoneServer::Process() { } case ServerOP_Motd: { if (pack->size != sizeof(ServerMotd_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); break; } ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer; @@ -924,7 +924,7 @@ bool ZoneServer::Process() { } case ServerOP_Uptime: { if (pack->size != sizeof(ServerUptime_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); break; } ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer; @@ -943,7 +943,7 @@ bool ZoneServer::Process() { break; } case ServerOP_GetWorldTime: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); auto pack = new ServerPacket; pack->opcode = ServerOP_SyncWorldTime; @@ -958,17 +958,17 @@ bool ZoneServer::Process() { break; } case ServerOP_SetWorldTime: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str()); zoneserver_list.SendTimeSync(); break; } case ServerOP_IPLookup: { if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); break; } ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer; @@ -980,7 +980,7 @@ bool ZoneServer::Process() { } case ServerOP_LockZone: { if (pack->size < sizeof(ServerLockZone_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); break; } ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer; @@ -1025,10 +1025,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if (zs->SendPacket(pack)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } } break; @@ -1047,10 +1047,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(cle->instance()); if(zs) { if(zs->SendPacket(pack)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); } } else @@ -1067,10 +1067,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } } @@ -1079,10 +1079,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(cle->zone()); if(zs) { if(zs->SendPacket(pack)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); } } else { @@ -1098,10 +1098,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } } @@ -1119,10 +1119,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1138,10 +1138,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } else @@ -1149,10 +1149,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1254,7 +1254,7 @@ bool ZoneServer::Process() { case ServerOP_LSAccountUpdate: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); loginserverlist.SendAccountUpdate(pack); break; } @@ -1309,7 +1309,7 @@ bool ZoneServer::Process() { } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/zone/aa.cpp b/zone/aa.cpp index 818a51e50..207f944b4 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); return; } @@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -951,7 +951,7 @@ void Client::SendAAStats() { void Client::BuyAA(AA_Action* action) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); //find the AA information from the database SendAA_Struct* aa2 = zone->FindAA(action->ability); @@ -963,7 +963,7 @@ void Client::BuyAA(AA_Action* action) a = action->ability - i; if(a <= 0) break; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); aa2 = zone->FindAA(a); if(aa2 != nullptr) break; @@ -980,7 +980,7 @@ void Client::BuyAA(AA_Action* action) uint32 cur_level = GetAA(aa2->id); if((aa2->id + cur_level) != action->ability) { //got invalid AA - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); return; } @@ -1011,7 +1011,7 @@ void Client::BuyAA(AA_Action* action) if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); m_pp.aapoints -= real_cost; @@ -1429,10 +1429,10 @@ SendAA_Struct* Zone::FindAA(uint32 id) { } void Zone::LoadAAs() { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AAs!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AAs!"); aas = nullptr; return; } @@ -1447,11 +1447,11 @@ void Zone::LoadAAs() { } //load AA Effects into aa_effects - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA Effects..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA Effects..."); if (database.LoadAAEffects2()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AA Effects!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); return false; } @@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/aggro.cpp b/zone/aggro.cpp index c1f3d4ce3..cbd051e1a 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,17 +342,17 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); return( mod_will_aggro(mob, this) ); } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); return(false); } @@ -466,7 +466,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { //Father Nitwit: make sure we can see them. if(mob->CheckLosFN(sender)) { #if (EQDEBUG>=5) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); #endif mob->AddToHateList(attacker, 1, 0, false); @@ -693,7 +693,7 @@ type', in which case, the answer is yes. } while( reverse++ == 0 ); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); return false; } @@ -833,7 +833,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) } while( reverse++ == 0 ); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); return false; } @@ -945,7 +945,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; #if LOSDEBUG>=5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); #endif return zone->zonemap->CheckLoS(myloc, oloc); } diff --git a/zone/attack.cpp b/zone/attack.cpp index a4240fc60..81862872e 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -57,7 +57,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); switch (item->ItemType) { @@ -187,7 +187,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC() && !attacker->IsPet()) chancetohit += RuleR(Combat, NPCBonusHitChance); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); bool pvpmode = false; if(IsClient() && other->IsClient()) @@ -208,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate the level difference - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); double level_difference = attacker_level - defender_level; double range = defender->GetLevel(); @@ -236,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); if(attacker->IsClient()) { chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse))); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); } if(defender->IsClient()) { chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); } //I dont think this is 100% correct, but at least it does something... if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->spellbonuses.MeleeSkillCheck; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->itembonuses.MeleeSkillCheck; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } //Avoidance Bonuses on defender decreases baseline hit chance by percent. @@ -308,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate final chance to hit chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker); @@ -327,7 +327,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); // @@ -336,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c float tohit_roll = zone->random.Real(0, 100); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); return(tohit_roll <= chancetohit); } @@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) { damage = -3; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac damage -= (myac * zone->random.Int(0, acrandom) / 10000); } if (damage<1) damage=1; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); } } @@ -1128,14 +1128,14 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } if(!GetTarget()) SetTarget(other); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( @@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b || (GetHP() < 0) || (!IsAttackAllowed(other)) ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); return false; // Only bards can attack while casting } if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b damage = mod_client_damage(damage, skillinuse, Hand, weapon, other); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); int hit_chance_bonus = 0; @@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it other->AvoidDamage(this, damage); @@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(damage > 0) CommonOutgoingHitSuccess(other, damage, skillinuse); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att } int exploss = 0; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); /* #1: Send death packet to everyone @@ -1692,7 +1692,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); RemoveFromHateList(other); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); } return false; } @@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); return false; } @@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); damage = (min_dmg+eleBane); } if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } @@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } if(other->IsClient() && other->CastToClient()->IsSitting()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); damage = (max_dmg+eleBane); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); @@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool hate += opts->hate_flat; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list other->AddToHateList(this, hate); @@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(damage > 0) { CommonOutgoingHitSuccess(other, damage, skillinuse); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list if(damage > 0) other->AddToHateList(this, hate); @@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); if(other->IsClient() && IsPet() && GetOwner()->IsClient()) { //pets do half damage to clients in pvp @@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //cant riposte a riposte if (bRiposte && damage == -3) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); return false; } @@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); parse->EventNPC(EVENT_ATTACK, this, other, "", 0); } attacked_timer.Start(CombatEventTimer_expire); @@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; if(killerMob) { @@ -2028,7 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if (IsEngaged()) { zone->DelAggroMob(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); } SetHP(0); SetPet(0); @@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { if(DS == 0 && rev_ds == 0) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); //invert DS... spells yield negative values for a true damage shield if(DS < 0) { @@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; if(rev_ds < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? } @@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage) int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; if(damage_to_reduce >= buffs[slot].melee_rune) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); damage -= damage_to_reduce; @@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage) if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); if (spellbonuses.MitigateMeleeRune[3]) @@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune); damage -= buffs[slot].magic_rune; if(!TryFadeEffect(slot)) @@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); if (spellbonuses.MitigateSpellRune[3]) @@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == SkillAbjuration); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); if (GetInvul() || DivineAura()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } @@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int healed = damage; healed = attacker->GetActSpellHealing(spell_id, healed); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); attacker->HealDamage(healed); //we used to do a message to the client, but its gone now. @@ -3506,7 +3506,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse()) { if (!pet->IsHeld()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1); pet->SetTarget(attacker); Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); @@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //see if any runes want to reduce this damage if(spell_id == SPELL_UNKNOWN) { damage = ReduceDamage(damage); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); damage = ReduceAllDamage(damage); TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); } else { @@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //fade mez if we are mezzed if (IsMezzed() && attacker) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); @@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int stun_resist = itembonuses.StunResist + spellbonuses.StunResist; int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); if (IsClient()) { stun_resist += aabonuses.StunResist; frontal_stun_resist += aabonuses.FrontalStunResist; @@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (((GetBaseRace() == OGRE && IsClient()) || (frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); } else { // Normal stun resist check. if (stun_resist && zone->random.Roll(stun_resist)) { if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds } } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); } } @@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //increment chances of interrupting if(IsCasting()) { //shouldnt interrupt on regular spell damage attacked_count++; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); } } @@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) ProcChance += ProcChance * ProcBonus / 100.0f; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h ProcBonus += static_cast(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f; ProcChance = ProcChance + (ProcChance * ProcBonus); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3887,7 +3887,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3918,17 +3918,17 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } if (!IsAttackAllowed(on)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); return; } if (DivineAura()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); return; } @@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on static_cast(weapon->ProcRate)) / 100.0f; if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really. if (weapon->Proc.Level > ourlevel) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); if (IsPet()) { @@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on Message_StringID(13, PROC_TOOLOW); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100); ExecWeaponProc(inst, weapon->Proc.Effect, on); @@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, // Perma procs (AAs) if (PermaProcs[i].spellID != SPELL_UNKNOWN) { if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus? - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d procing spell %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); ExecWeaponProc(nullptr, PermaProcs[i].spellID, on); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d failed to proc %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); } @@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (SpellProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(SpellProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d procing spell %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d failed to proc %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); } @@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (RangedProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(RangedProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d procing spell %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d failed to proc %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); } @@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Mob::DoRiposte(Mob* defender) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) { //Live AA - Double Riposte if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); if (HasDied()) return; } @@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) { DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); if (defender->GetClass() == MONK) defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); @@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); damage += (damage*dmgbonusmod/10000); } } @@ -4467,7 +4467,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } @@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { if (!TryFadeEffect(spellbonuses.Root[1])) { BuffFadeBySlot(spellbonuses.Root[1]); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); return true; } } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); return false; } @@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible() { //break invis when you attack if(invisible) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index fde1dacc8..4806c2241 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -77,9 +77,9 @@ void Client::CalcBonuses() CalcSpellBonuses(&spellbonuses); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); CalcAABonuses(&aabonuses); //we're not quite ready for this - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); RecalcWeight(); @@ -634,7 +634,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) diff --git a/zone/bot.cpp b/zone/bot.cpp index 7ad758706..ed9b9e1f3 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); return; } @@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadStance()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveStance()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); } @@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) { if(!RangeWeapon || !Ammo) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); if(!IsAttackAllowed(other) || IsCasting() || @@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) { //break invis when you attack if(invisible) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -3362,7 +3362,7 @@ void Bot::AI_Process() { else if(!IsRooted()) { if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed()); SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY())); return; @@ -3689,7 +3689,7 @@ void Bot::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -3972,7 +3972,7 @@ void Bot::PetAIProcess() { { botPet->SetRunAnimSpeed(0); if(!botPet->IsRooted()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed()); return; } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); parse->EventNPC(EVENT_ATTACK, this, from, "", 0); } @@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ // if spell is lifetap add hp to the caster if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) { int healed = GetActSpellHealing(spell_id, damage); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } @@ -6017,14 +6017,14 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } if(!GetTarget() || GetTarget() != other) SetTarget(other); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || other == nullptr || @@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName()); if(other) { RemoveFromHateList(other); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); } return false; } if(DivineAura()) {//cant attack while invulnerable - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); return false; } @@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(berserk && (GetClass() == BERSERKER)){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b else damage = zone->random.Int(min_hit, max_hit); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel()); if(opts) { @@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(other, skillinuse, Hand)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; other->AddToHateList(this, 0); } else { //we hit, try to avoid it @@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b ApplyMeleeDamageBonus(skillinuse, damage); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); TryCriticalHit(other, skillinuse, damage, opts); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); // now add done damage to the hate list //other->AddToHateList(this, hate); } else other->AddToHateList(this, 0); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //break invis when you attack if(invisible) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -7335,7 +7335,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); } } //Check for spell skill limits. @@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { ProcChance += ProcChance*ProcBonus / 100.0f; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) { damage = -3; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) uint16 levelreq = aabonuses.FinishingBlowLvl[0]; if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse); return true; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); return false; } } @@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Bot::DoRiposte(Mob* defender) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) { defender->GetItemBonuses().GiveDoubleRiposte[0]; if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); } @@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f); float DefenderChance = (float)zone->random.Real(0.00f, 1.00f); if(AttackerChance > DefenderChance) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); // WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW //entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName()); @@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { Result = true; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); } } } @@ -8441,7 +8441,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { return; } - // Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); + // Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER); @@ -8548,7 +8548,7 @@ int32 Bot::CalcMaxMana() { } default: { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(GetClass() != BARD) { if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t //cannot cast under deivne aura if(DivineAura()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t } if (HasActiveSong()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client //_StopSong(); bardsong = 0; @@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(caster->IsBot()) { if(spells[spell_id].targettype == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); return true; } } @@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3) ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); return true; } } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); } } @@ -15454,7 +15454,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index cb2b2f4cd..0cf6d36a6 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -950,7 +950,7 @@ bool Bot::AI_PursueCastCheck() { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) { if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) { @@ -1055,7 +1055,7 @@ bool Bot::AI_EngagedCastCheck() { BotStanceType botStance = GetBotStance(); bool mayGetAggro = HasOrMayGetAggro(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); if(botClass == CLERIC) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { diff --git a/zone/client.cpp b/zone/client.cpp index e10b1bb93..fe5c2758e 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -340,7 +340,7 @@ Client::~Client() { ToggleBuyerMode(false); if(conn_state != ClientConnectFinished) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); ReportConnectingState(); } @@ -438,31 +438,31 @@ void Client::SendLogoutPackets() { void Client::ReportConnectingState() { switch(conn_state) { case NoPacketsReceived: //havent gotten anything - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); break; case ReceivedZoneEntry: //got the first packet, loading up PP - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); break; case PlayerProfileLoaded: //our DB work is done, sending it - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); break; case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); break; case NewZoneRequested: //received and sent new zone request - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); break; case ClientSpawnRequested: //client sent ReqClientSpawn - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); break; case ZoneContentsSent: //objects, doors, zone points - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); break; case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); break; case ClientConnectFinished: //client finally moved to finished state, were done here - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); break; }; } @@ -650,7 +650,7 @@ bool Client::SendAllPackets() { if(eqs) eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); - Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); + Log.DoLog(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); } return true; } @@ -698,7 +698,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s char message[4096]; strn0cpy(message, orig_message, sizeof(message)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); if (targetname == nullptr) { targetname = (!GetTarget()) ? "" : GetTarget()->GetName(); @@ -1506,7 +1506,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); + Log.DoLog(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); @@ -1911,7 +1911,7 @@ void Client::ReadBook(BookRequest_Struct *book) { if (booktxt2[0] != '\0') { #if EQDEBUG >= 6 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); #endif EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct)); @@ -2105,7 +2105,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ SaveCurrency(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); } void Client::EVENT_ITEM_ScriptStopReturn(){ @@ -2145,7 +2145,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat SaveCurrency(); #if (EQDEBUG>=5) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); #endif } @@ -2235,13 +2235,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha if(zone->random.Real(0, 99) < Chance) { SetSkill(skillid, GetRawSkill(skillid) + 1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); return true; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); } return false; } @@ -2262,10 +2262,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) { if(zone->random.Real(0,100) < Chance) { // if they make the roll IncreaseLanguageSkill(langid); // increase the language skill by 1 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); } else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); } } @@ -2364,7 +2364,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 Save(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " "Too many specializations skills were above 50.", GetCleanName()); } @@ -4544,14 +4544,14 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetClass() != LDON_TREASURE) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", GetName(), target->GetName(), target->GetName()); return; } if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); Message(13, "Treasure chest out of range."); return; @@ -5294,7 +5294,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5362,7 +5362,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5389,7 +5389,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5397,7 +5397,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6211,7 +6211,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6225,7 +6225,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -8149,7 +8149,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); #endif } else @@ -8166,7 +8166,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); #endif } } @@ -8289,11 +8289,11 @@ std::string Client::TextLink::GenerateLink() if ((m_Link.length() == 0) || (m_Link.length() > 250)) { m_Error = true; m_Link = ""; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length()); #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); #endif } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 006529b66..aa12b2299 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; @@ -935,7 +935,7 @@ int32 Client::CalcMaxMana() break; } default: { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -956,7 +956,7 @@ int32 Client::CalcMaxMana() } #if EQDEBUG >= 11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1046,14 +1046,14 @@ int32 Client::CalcBaseMana() break; } default: { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_m = 0; break; } } #if EQDEBUG >= 11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); #endif return max_m; } @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 09bae443d..614b4257e 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -401,7 +401,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) if(is_log_enabled(CLIENT__NET_IN_TRACE)) { char buffer[64]; app->build_header_dump(buffer); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); } EmuOpcode opcode = app->GetOpcode(); @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -460,7 +460,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); char buffer[64]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); if (Log.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ app->build_header_dump(buffer); if (app->size < 1000) @@ -483,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_LINKDEAD: break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); break; } @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. if (!CanBeInZone()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); GoToSafeCoords(database.GetZoneID("arena"), 0); return; } @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message: %s", error->message); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1317,14 +1317,14 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) ClientVersionBit = 0; bool siv = m_inv.SetInventoryVersion(ClientVersion); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); /* Antighost code tmp var is so the search doesnt find this object */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetAuth() returned false kicking client"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1340,7 +1340,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) struct in_addr ghost_addr; ghost_addr.s_addr = eqs->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", client->AccountID(), client->AccountName(), client->GetName(), inet_ntoa(ghost_addr)); client->Save(); client->Disconnect(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1899,7 +1899,7 @@ void Client::Handle_0x0193(const EQApplicationPacket *app) void Client::Handle_OP_AAAction(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); if (app->size != sizeof(AA_Action)){ printf("Error! OP_AAAction size didnt match!\n"); @@ -1908,7 +1908,7 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) AA_Action* action = (AA_Action*)app->pBuffer; if (action->action == aaActionActivate) {//AA Hotkey - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); ActivateAA((aaID)action->ability); } else if (action->action == aaActionBuy) { @@ -1940,7 +1940,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) { if (app->size != sizeof(AcceptNewTask_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", sizeof(AcceptNewTask_Struct), app->size); DumpPacket(app); return; @@ -1955,7 +1955,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2010,7 +2010,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2190,7 +2190,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2280,7 +2280,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Sell_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", app->size, sizeof(Adventure_Sell_Struct)); DumpPacket(app); return; @@ -2412,7 +2412,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2938,7 +2938,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2957,7 +2957,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -2971,7 +2971,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (!IsPoison) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " "after casting, or is not a poison!", ApplyPoisonData->inventorySlot); Message(0, "Error: item not found for inventory slot #%i or is not a poison", ApplyPoisonData->inventorySlot); @@ -2994,7 +2994,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); } } @@ -3009,7 +3009,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); return; } @@ -3039,7 +3039,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); return; } QueuePacket(app); @@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) if (app->size != sizeof(AugmentInfo_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); DumpPacket(app); return; @@ -3071,7 +3071,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3228,7 +3228,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3295,7 +3295,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) { if (app->size != sizeof(bool)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); DumpPacket(app); return; } @@ -3311,7 +3311,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) // Although there are three different structs for OP_Bandolier, they are all the same size. // if (app->size != sizeof(BandolierCreate_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", sizeof(BandolierCreate_Struct), app->size); DumpPacket(app); return; @@ -3330,7 +3330,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) SetBandolier(app); break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); } } @@ -3339,7 +3339,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) { if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); DumpPacket(app); return; } @@ -3424,7 +3424,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) if (app->size < 4) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); DumpPacket(app); return; } @@ -3572,7 +3572,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) default: Message(13, "Unrecognised Barter action."); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); } } @@ -3580,7 +3580,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3635,8 +3635,8 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3721,16 +3721,16 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } return; @@ -3743,7 +3743,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -3838,7 +3838,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3859,14 +3859,14 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*)app->pBuffer; uint32 spid = sbf->spellid; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and @@ -3941,7 +3941,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTask_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", sizeof(CancelTask_Struct), app->size); DumpPacket(app); return; @@ -3955,7 +3955,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4006,16 +4006,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) targetring_z = castspell->z_pos; #ifdef _EQDEBUG - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); #endif - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; @@ -4047,7 +4047,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) //discipline, using the item spell slot if (castspell->inventoryslot == INVALID_INDEX) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); InterruptSpell(castspell->spell_id); } return; @@ -4190,7 +4190,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app) if (app->size != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); DumpPacket(app); @@ -4212,7 +4212,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app) if (app->size != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", app->size); DumpPacket(app); @@ -4234,7 +4234,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4259,7 +4259,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4310,7 +4310,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4323,11 +4323,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4344,8 +4344,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message:%s", error->message); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message:%s", error->message); return; } @@ -4366,7 +4366,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4718,7 +4718,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4812,7 +4812,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4872,7 +4872,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4909,7 +4909,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -4921,7 +4921,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4942,7 +4942,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5098,7 +5098,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5136,7 +5136,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app) if (app->size != sizeof(DelegateAbility_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", sizeof(DelegateAbility_Struct), app->size); DumpPacket(app); @@ -5311,7 +5311,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", sizeof(DoGroupLeadershipAbility_Struct), app->size); DumpPacket(app); @@ -5363,7 +5363,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) } default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", dglas->Ability, dglas->Parameter); break; } @@ -5445,7 +5445,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5536,7 +5536,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5591,7 +5591,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5832,7 +5832,7 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); SendGuildMOTD(true); @@ -5845,7 +5845,7 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); SendGuildList(); } @@ -5858,7 +5858,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5910,7 +5910,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5927,7 +5927,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainEnd_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); DumpPacket(app); return; } @@ -5943,7 +5943,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6008,7 +6008,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6058,7 +6058,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6125,7 +6125,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6135,7 +6135,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) return; } Client* client = entity_list.GetClientByName(gmn->oldname); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(13, "%s not found for name change. Operation failed!", gmn->oldname); @@ -6177,7 +6177,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) if (app->size < sizeof(GMSearchCorpse_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", app->size, sizeof(GMSearchCorpse_Struct)); DumpPacket(app); return; @@ -6300,7 +6300,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainee_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); DumpPacket(app); return; } @@ -6311,7 +6311,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) { if (app->size != sizeof(GMSkillChange_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); DumpPacket(app); return; } @@ -6379,7 +6379,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6396,7 +6396,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6440,12 +6440,12 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; @@ -6587,7 +6587,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6607,7 +6607,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6656,7 +6656,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6725,7 +6725,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) if (g->IsLeader(this)) g->ChangeLeader(NewLeader); else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6734,7 +6734,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6770,7 +6770,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6816,7 +6816,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(GroupUpdate_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", app->size, sizeof(GroupUpdate_Struct)); DumpPacket(app); return; @@ -6835,7 +6835,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) if (group->IsLeader(this)) group->ChangeLeader(newleader); else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6844,7 +6844,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) default: { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); DumpPacket(app); return; } @@ -6864,7 +6864,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -6889,7 +6889,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if ((Action != GuildBankDeposit) && (Action != GuildBankViewItem) && (Action != GuildBankWithdraw)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); GuildBankAck(); @@ -7050,7 +7050,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsGuildBanker() && !GuildBanks->AllowedToWithdraw(GuildID(), gbwis->Area, gbwis->SlotID, GetName())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); GuildBankAck(); @@ -7121,7 +7121,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "Unexpected GuildBank action."); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } } } @@ -7192,7 +7192,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) @@ -7214,12 +7214,12 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.DeleteGuild(GuildID())) Message(0, "Guild delete failed."); else { @@ -7230,10 +7230,10 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); if (app->size != sizeof(GuildDemoteStruct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); return; } @@ -7263,7 +7263,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) uint8 rank = gci.rank - 1; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", demote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7281,7 +7281,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7322,7 +7322,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) //we could send this to the member and prompt them to see if they want to //be demoted (I guess), but I dont see a point in that. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7341,7 +7341,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7353,7 +7353,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); client->QueuePacket(app); } @@ -7376,7 +7376,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7386,7 +7386,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); client->SetPendingGuildInvitation(true); client->QueuePacket(app); @@ -7409,7 +7409,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); SetPendingGuildInvitation(false); @@ -7445,7 +7445,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) else if (!worldserver.Connected()) Message(0, "Error: World server disconnected"); else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", gj->guildeqid, gj->response, gj->inviter, gj->newmember); //we dont really care a lot about what this packet means, as long as @@ -7459,7 +7459,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) if (gj->guildeqid == GuildID()) { //only need to change rank. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), gj->response, guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7471,7 +7471,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", GetName(), CharacterID(), guild_mgr.GetGuildName(gj->guildeqid), gj->guildeqid, gj->response); @@ -7500,10 +7500,10 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); if (app->size < 2) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); return; } @@ -7522,7 +7522,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) Client* newleader = entity_list.GetClientByName(gml->target); if (newleader) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID(), newleader->GetName(), newleader->CharacterID()); @@ -7543,9 +7543,9 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); if (app->size != sizeof(GuildManageBanker_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); return; } GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer; @@ -7620,16 +7620,16 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); return; } void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); if (app->size != sizeof(GuildPromoteStruct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); return; } @@ -7658,7 +7658,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", promote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7675,7 +7675,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); if (app->size < sizeof(GuildUpdate_PublicNote)) { // client calls for a motd on login even if they arent in a guild @@ -7694,7 +7694,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", gpn->target, gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID(), gpn->note); @@ -7711,7 +7711,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7741,7 +7741,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = client->CharacterID(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7757,7 +7757,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = gci.char_id; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", gci.char_name.c_str(), gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7782,7 +7782,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) { if (app->size != sizeof(GuildStatus_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", sizeof(GuildStatus_Struct), app->size); DumpPacket(app); @@ -7839,7 +7839,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) { if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", sizeof(GuildUpdateURLAndChannel_Struct), app->size); DumpPacket(app); @@ -7867,7 +7867,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) void Client::Handle_OP_GuildWar(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); return; } @@ -7943,7 +7943,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app) // if (app->size != sizeof(HideCorpse_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", sizeof(HideCorpse_Struct), app->size); DumpPacket(app); @@ -7972,7 +7972,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8002,7 +8002,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8057,7 +8057,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8071,7 +8071,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8108,7 +8108,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8208,7 +8208,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8223,7 +8223,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8421,7 +8421,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8449,7 +8449,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (slot_id < 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); return; } @@ -8492,7 +8492,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check { @@ -8530,7 +8530,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); } else if (inst->IsType(ItemClassCommon)) { @@ -8603,7 +8603,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } else { @@ -8619,7 +8619,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) else if (item->ItemType == ItemTypeAlcohol) { #if EQDEBUG >= 1 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } } } @@ -8787,7 +8787,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) { if (app->size != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -8874,7 +8874,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9034,7 +9034,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9071,7 +9071,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9096,7 +9096,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); SendLogoutPackets(); @@ -9150,7 +9150,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9327,7 +9327,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) if (app->size != sizeof(MercenaryCommand_Struct)) { Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; } @@ -9384,7 +9384,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); DumpPacket(app); @@ -9519,7 +9519,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app if (app->size != 0) { Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9539,7 +9539,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9564,7 +9564,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID) if (app->size != sizeof(MercenaryMerchantRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); DumpPacket(app); @@ -9636,7 +9636,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) if (app->size != sizeof(SuspendMercenary_Struct)) { Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; } @@ -9660,7 +9660,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9698,7 +9698,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9714,7 +9714,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9797,7 +9797,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9829,7 +9829,7 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9856,7 +9856,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9869,7 +9869,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10332,7 +10332,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10376,7 +10376,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10446,7 +10446,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10516,7 +10516,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) { if (app->size != sizeof(PopupResponse_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", sizeof(PopupResponse_Struct), app->size); DumpPacket(app); return; @@ -10551,7 +10551,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) { if (app->size != sizeof(MovePotionToBelt_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", sizeof(MovePotionToBelt_Struct), app->size); DumpPacket(app); return; @@ -10559,7 +10559,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); return; } @@ -10582,7 +10582,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -10672,7 +10672,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a // if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); DumpPacket(app); @@ -10699,7 +10699,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) // if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", sizeof(PVPLeaderBoardRequest_Struct), app->size); DumpPacket(app); @@ -10720,7 +10720,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11305,7 +11305,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11334,7 +11334,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11350,7 +11350,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11364,7 +11364,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11378,14 +11378,14 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); // results show that object_type is combiner type // some_id = 0 if world combiner, item number otherwise @@ -11437,7 +11437,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11446,7 +11446,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) rss->query[55] = '\0'; //just to be sure. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); // make where clause segment for container(s) char containers[30]; @@ -11506,7 +11506,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -11669,7 +11669,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) // if (app->size != 4) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", 4, app->size); DumpPacket(app); return; @@ -11697,7 +11697,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); @@ -11720,14 +11720,14 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) { if (app->size != sizeof(Sacrifice_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); DumpPacket(app); return; } Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11765,13 +11765,13 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11848,7 +11848,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); if (app->size != sizeof(GuildMOTD_Struct)) { // client calls for a motd on login even if they arent in a guild @@ -11866,7 +11866,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) GuildMOTD_Struct* gmotd = (GuildMOTD_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", guild_mgr.GetGuildName(GuildID()), GuildID(), GetName(), gmotd->motd); if (!guild_mgr.SetGuildMOTD(GuildID(), gmotd->motd, GetName())) { @@ -11884,7 +11884,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11918,7 +11918,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); return; } @@ -11969,7 +11969,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) { if (app->size != sizeof(SetTitle_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); DumpPacket(app); return; } @@ -11993,7 +11993,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12090,7 +12090,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12098,7 +12098,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) t1.start(); Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); DumpPacket(app); #endif @@ -12258,7 +12258,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12348,7 +12348,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12504,7 +12504,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12797,7 +12797,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12834,7 +12834,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) { if (app->size != sizeof(Surname_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); return; } @@ -12924,7 +12924,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13149,7 +13149,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TaskHistoryRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", sizeof(TaskHistoryRequest_Struct), app->size); DumpPacket(app); return; @@ -13202,7 +13202,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); return; } @@ -13216,7 +13216,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13369,7 +13369,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13417,7 +13417,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (c) c->WithCustomer(0); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); break; } @@ -13426,7 +13426,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) break; } default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); break; } } @@ -13512,10 +13512,10 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13524,8 +13524,8 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) HandleTraderPriceUpdate(app); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13550,11 +13550,11 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) BuyTraderItem(tbs, Trader, app); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); } return; @@ -13563,7 +13563,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13599,7 +13599,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13628,7 +13628,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (app->size != sizeof(TraderClick_Struct)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); return; } @@ -13642,7 +13642,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (Customer) outtcs->Approval = Customer->WithCustomer(GetID()); else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" " returned a nullptr pointer"); return; } @@ -13670,7 +13670,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13691,7 +13691,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if (app->size != sizeof(Translocate_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); DumpPacket(app); return; } @@ -13739,7 +13739,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates an item... @@ -13758,7 +13758,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13768,7 +13768,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates money @@ -13787,7 +13787,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13797,7 +13797,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); _pkt(TRIBUTE__IN, app); return; @@ -13805,11 +13805,11 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13819,12 +13819,12 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); @@ -13836,7 +13836,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } @@ -13876,7 +13876,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app) if (app->size != sizeof(VoiceMacroIn_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", sizeof(VoiceMacroIn_Struct), app->size); DumpPacket(app); @@ -13927,7 +13927,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app) { if (app->size != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); DumpPacket(app); return; } @@ -13939,7 +13939,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) { if (app->size < 12) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); DumpPacket(app); return; } @@ -14162,7 +14162,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) } default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index c9a70d87b..834c4882d 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -799,7 +799,7 @@ void Client::OnDisconnect(bool hard_disconnect) { Mob *Other = trade->With(); if(Other) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); FinishTrade(this); if(Other->IsClient()) @@ -836,7 +836,7 @@ void Client::BulkSendInventoryItems() { if(inst) { bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -1037,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { // Account for merchant lists with gaps. if (ml.slot >= i) { if (ml.slot > i) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); i = ml.slot + 1; } } @@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ Client* c = entity_list.GetClientByID(CustomerID); if(!c) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); CustomerID = NewCustomer; return 1; } @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) { if(app->size != sizeof(MemorizeSpell_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); DumpPacket(app); return; } @@ -1723,12 +1723,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id; if(!CanHaveSkill(skill)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); return; } if(MaxSkill(skill) == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); return; } @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/command.cpp b/zone/command.cpp index 6408071b2..551da4d9e 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -443,13 +443,13 @@ int command_init(void) { if ((itr=command_settings.find(cur->first))!=command_settings.end()) { cur->second->access = itr->second; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); } else { #ifdef COMMANDS_WARNINGS if(cur->second->access == 0) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); #endif } } @@ -494,7 +494,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -568,12 +568,12 @@ int command_realdispatch(Client *c, const char *message) #ifdef COMMANDS_LOGGING if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } #endif if(cur->function == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command @@ -1292,7 +1292,7 @@ void command_viewpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1317,7 +1317,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1343,7 +1343,7 @@ void command_delpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); } @@ -1566,7 +1566,7 @@ void command_permaclass(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); t->Kick(); @@ -1588,7 +1588,7 @@ void command_permarace(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's race - zone to take effect",t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); t->SetBaseGender(tmp); @@ -1612,7 +1612,7 @@ void command_permagender(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's gender - zone to take effect",t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); t->SendIllusionPacket(atoi(sep->arg[1])); @@ -1954,7 +1954,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Spawning database spawn"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Spawning database spawn"); uint16 cond = 0; int16 cond_min = 0; if(sep->IsNumber(4)) { @@ -2274,7 +2274,7 @@ void command_setlanguage(Client *c, const Seperator *sep) } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); uint8 langid = (uint8)atoi(sep->arg[1]); uint8 value = (uint8)atoi(sep->arg[2]); c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value ); @@ -2299,7 +2299,7 @@ void command_setskill(Client *c, const Seperator *sep) c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); int skill_num = atoi(sep->arg[1]); uint16 skill_value = atoi(sep->arg[2]); if(skill_num < HIGHEST_SKILL) @@ -2319,7 +2319,7 @@ void command_setskillall(Client *c, const Seperator *sep) } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); uint16 level = atoi(sep->arg[1]); for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) { c->GetTarget()->CastToClient()->SetSkill(skill_num, level); @@ -3114,7 +3114,7 @@ void command_listpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); if (results.RowCount() == 0) return; @@ -3771,7 +3771,7 @@ void command_lastname(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); @@ -4545,10 +4545,10 @@ void command_guild(Client *c, const Seperator *sep) } if(guild_id == GUILD_NONE) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id); } @@ -4597,7 +4597,7 @@ void command_guild(Client *c, const Seperator *sep) return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) @@ -4639,7 +4639,7 @@ void command_guild(Client *c, const Seperator *sep) uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) @@ -4678,7 +4678,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) @@ -4712,7 +4712,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) @@ -4763,7 +4763,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) @@ -4869,7 +4869,7 @@ void command_manaburn(Client *c, const Seperator *sep) target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/); c->Message(4,"You unleash an enormous blast of magical energies."); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); } } else @@ -5221,7 +5221,7 @@ void command_scribespells(Client *c, const Seperator *sep) t->Message(0, "Scribing spells to spellbook."); if(t != c) c->Message(0, "Scribing spells for %s.", t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot)) { @@ -5278,7 +5278,7 @@ void command_scribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) { book_slot = t->GetNextAvailableSpellBookSlot(); @@ -5325,7 +5325,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); @@ -7862,7 +7862,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->Message(0, "Training disciplines"); if(t != c) c->Message(0, "Training disciplines for %s.", t->GetName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++) { @@ -10394,7 +10394,7 @@ void command_logtest(Client *c, const Seperator *sep){ if (sep->IsNumber(1)){ uint32 i = 0; for (i = 0; i < atoi(sep->arg[1]); i++){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } } \ No newline at end of file diff --git a/zone/corpse.cpp b/zone/corpse.cpp index a16f6f240..121feb2c1 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -842,7 +842,7 @@ bool Corpse::Process() { spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); corpse_db_id = 0; } @@ -872,10 +872,10 @@ bool Corpse::Process() { Save(); player_corpse_depop = true; corpse_db_id = 0; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); return true; } } @@ -1083,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); client->Message(0, "Inaccessable Corpse Item: %s", item->Name); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index 8ac166ddc..2d8e4daf6 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -145,9 +145,9 @@ bool Doors::Process() void Doors::HandleClick(Client* sender, uint8 trigger) { //door debugging info dump - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct)); MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer; @@ -303,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); #if EQDEBUG>=5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); #endif if(GetLockpick() <= modskill) @@ -560,13 +560,13 @@ void Doors::ToggleState(Mob *sender) } void Doors::DumpDoor(){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", dest_zone, dest_x, dest_y, dest_z, dest_heading); } @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Doors from database..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Doors from database..."); // Door tmpDoor; diff --git a/zone/effects.cpp b/zone/effects.cpp index 457d11d65..3c0b1ccfd 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index e015b14c8..4a9cb0716 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 7b823154a..88fa72121 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_quest does not take any arguments."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 7653b5cc4..b7ec2b6b2 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -140,12 +140,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "perl error: %s", err); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "perl error: %s", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Tying perl output to eqemu logs"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -170,14 +170,14 @@ void Embperl::DoInit() { ,FALSE ); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Loading perlemb plugins."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Loading perlemb plugins."); try { eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE); } catch(const char *err) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Warning - plugin.pl: %s", err); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Warning - plugin.pl: %s", err); } try { @@ -195,7 +195,7 @@ void Embperl::DoInit() { } catch(const char *err) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Perl warning: %s", err); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Perl warning: %s", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 05c9d642e..8c35b7817 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_qc does not take any arguments."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. @@ -100,7 +100,7 @@ XS(XS_EQEmuIO_PRINT) int len = 0; for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); len = 0; pos = i+1; } else { @@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); } } diff --git a/zone/entity.cpp b/zone/entity.cpp index 17bcf5e6c..068b91f3a 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a group."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a raid."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); @@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID) // If we have been passed a TaskID, only reload the client state if they have // that Task active. if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); client->RemoveClientTaskState(); client->LoadClientTaskState(); taskmanager->SendActiveTasksToClient(client); diff --git a/zone/exp.cpp b/zone/exp.cpp index 074e86d2a..b0db67a40 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); @@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetLevel(uint8 set_level, bool command) { if (GetEXPForLevel(set_level) == 0xFFFFFFFF) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); return; } @@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command) safe_delete(outapp); this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); CalcBonuses(); diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 3e0577212..cb007d574 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; curfp = true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; diff --git a/zone/forage.cpp b/zone/forage.cpp index beb92eb43..a0381f6a2 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index 1c95c44fc..9faf0d8b1 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1098,7 +1098,7 @@ void Group::VerifyGroup() { for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (membername[i][0] == '\0') { #if EQDEBUG >= 7 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif members[i] = nullptr; continue; @@ -1107,7 +1107,7 @@ void Group::VerifyGroup() { Mob *them = entity_list.GetMob(membername[i]); if(them == nullptr && members[i] != nullptr) { //they aren't in zone #if EQDEBUG >= 6 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; members[i] = nullptr; @@ -1116,13 +1116,13 @@ void Group::VerifyGroup() { if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif members[i] = them; continue; } #if EQDEBUG >= 8 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); #endif } } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index 9f2bfe48b..6c4cdc4d2 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) { } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -144,10 +144,10 @@ void Client::SendGuildSpawnAppearance() { if (!IsInAGuild()) { // clear guildtag SendAppearancePacket(AT_GuildID, GUILD_NONE); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); } else { uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); SendAppearancePacket(AT_GuildID, GuildID()); if(GetClientVersion() >= EQClientRoF) { @@ -171,11 +171,11 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size); if(outapp->pBuffer == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -192,7 +192,7 @@ void Client::SendGuildMembers() { outapp->pBuffer = data; data = nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); FastQueuePacket(&outapp); @@ -223,7 +223,7 @@ void Client::RefreshGuildInfo() CharGuildInfo info; if(!guild_mgr.GetCharInfo(CharacterID(), info)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); return; } @@ -335,7 +335,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){ outgj->rank = gj->rank; outgj->zoneid = gj->zoneid; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); FastQueuePacket(&outapp); @@ -409,7 +409,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -429,7 +429,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index f8c7c9ffd..8a566cf43 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -32,7 +32,7 @@ extern WorldServer worldserver; extern volatile bool ZoneLoaded; void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { if(guild_id == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); CharGuildInfo gci; if(!GetCharInfo(charid, gci)) { @@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID) } void ZoneGuildManager::SendGuildDelete(uint32 guild_id) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -261,12 +261,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { switch(pack->opcode) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //reload all the guild details from the database. RefreshGuild(s->guild_id); @@ -295,12 +295,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); Client *c = entity_list.GetClientByCharID(s->char_id); @@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { { if(pack->size != sizeof(ServerGuildRankUpdate_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRankUpdate_Struct)); return; @@ -364,12 +364,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); //clear all the guild tags. entity_list.RefreshAllGuildInfo(s->guild_id); @@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if (!c || !c->IsInAGuild()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); break; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; @@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { VARSTRUCT_DECODE_STRING(Name, Buffer); strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName)); gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); c->QueuePacket(outapp); } safe_delete(outapp); @@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c) if(Iterator == Banks.end()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); return; } @@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Iterator == Banks.end()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); return false; } @@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Slot < 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No space to add item to the guild bank."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No space to add item to the guild bank."); return false; } @@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/horse.cpp b/zone/horse.cpp index 9926cbe8a..b5691ca00 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 6a43b7059..a2ccaaa58 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -215,7 +215,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are augmenting an augmentable item else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -229,7 +229,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -269,7 +269,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; @@ -700,7 +700,7 @@ void Client::SendCursorBuffer() { // Remove item from inventory void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { #if (EQDEBUG >= 5) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); #endif // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. @@ -815,7 +815,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); m_inv.PushCursor(inst); if (client_update) { @@ -831,7 +831,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) // (Also saves changes back to the database: this may be optimized in the future) // client_update: Sends packet to client bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); if (slot_id == MainCursor) return PushItemOnCursor(inst, client_update); @@ -858,7 +858,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); m_inv.PutItem(slot_id, inst); SendLootItemInPacket(&inst, slot_id); @@ -879,7 +879,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI continue; const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); safe_delete(bagitem); } @@ -1313,7 +1313,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1321,7 +1321,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1334,7 +1334,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->to_slot == (uint32)INVALID_INDEX) { if (move_in->from_slot == (uint32)MainCursor) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit ItemInst *inst = m_inv.GetItem(MainCursor); @@ -1348,7 +1348,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; // Item destroyed by client } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit DeleteItemInInventory(move_in->from_slot); return true; // Item deletion @@ -1388,7 +1388,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { ItemInst* src_inst = m_inv.GetItem(src_slot_id); ItemInst* dst_inst = m_inv.GetItem(dst_slot_id); if (src_inst){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); srcitemid = src_inst->GetItem()->ID; //SetTint(dst_slot_id,src_inst->GetColor()); if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize)) @@ -1398,7 +1398,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } if (dst_inst) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); dstitemid = dst_inst->GetItem()->ID; } if (Trader && srcitemid>0){ @@ -1435,7 +1435,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { move_in->from_slot = dst_slot_check; move_in->to_slot = src_slot_check; move_in->number_in_stack = dst_inst->GetCharges(); - if(!SwapItem(move_in)) { Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } + if(!SwapItem(move_in)) { Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } } return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } @@ -1577,7 +1577,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return false; } if (with) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor if (!m_inv[MainCursor]) { Message(13, "Error: Cursor item not located on server!"); @@ -1610,18 +1610,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->number_in_stack > 0) { // Determine if charged items can stack if(src_inst && !src_inst->IsStackable()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); return false; } if (dst_inst) { if(src_inst->GetID() != dst_inst->GetID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); return(false); } if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) { //we have a chance of stacking. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); // Charges can be emptied into dst uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges(); if (usedcharges > move_in->number_in_stack) @@ -1633,15 +1633,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Depleted all charges? if (src_inst->GetCharges() < 1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); database.SaveInventory(CharacterID(),nullptr,src_slot_id); m_inv.DeleteItem(src_slot_id); all_to_stack = true; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); return false; } } @@ -1650,12 +1650,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) { // Move entire stack if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); } else { // Split into two src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack); m_inv.PutItem(dst_slot_id, *inst); safe_delete(inst); @@ -1680,7 +1680,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { SetMaterial(dst_slot_id,src_inst->GetItem()->ID); } if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) { if(src_inst) { @@ -1739,7 +1739,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { // resync the 'from' and 'to' slots on an as-needed basis // Not as effective as the full process, but less intrusive to gameplay -U - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Message(15, "Inventory Desyncronization detected: Resending slot data..."); if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) { @@ -2071,7 +2071,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2080,7 +2080,7 @@ void Client::RemoveNoRent(bool client_update) { for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2089,7 +2089,7 @@ void Client::RemoveNoRent(bool client_update) { if (m_inv[MainPowerSource]) { const ItemInst* inst = m_inv[MainPowerSource]; if (inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent } } @@ -2098,7 +2098,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2107,7 +2107,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots } } @@ -2116,7 +2116,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots } } @@ -2125,7 +2125,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots } } @@ -2134,7 +2134,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots } } @@ -2155,7 +2155,7 @@ void Client::RemoveNoRent(bool client_update) { inst = *iter; // should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U if (!inst->GetItem()->NoRent) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); else m_inv.PushCursor(**iter); @@ -2178,7 +2178,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2193,7 +2193,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2208,7 +2208,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(MainPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, MainPowerSource); } else { @@ -2223,7 +2223,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2238,7 +2238,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2253,7 +2253,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2281,7 +2281,7 @@ void Client::RemoveDuplicateLore(bool client_update) { inst = *iter; // probably needs a valid pointer check -U if (CheckLoreConflict(inst->GetItem())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); safe_delete(*iter); iter = local.erase(iter); } @@ -2300,7 +2300,7 @@ void Client::RemoveDuplicateLore(bool client_update) { m_inv.PushCursor(**iter); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); } safe_delete(*iter); @@ -2322,7 +2322,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, client_update); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2335,7 +2335,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name); const ItemInst* InvItem = nullptr; @@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { InvItem = GetInv()[WeaponSlot]; if(InvItem) { BaseItem = InvItem->GetItem(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon; database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0; } @@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { void Client::RemoveBandolier(const EQApplicationPacket *app) { BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); memset(m_pp.bandoliers[bds->number].name, 0, 32); for(int i = bandolierMainHand; i <= bandolierAmmo; i++) { m_pp.bandoliers[bds->number].items[i].item_id = 0; @@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // any items currently in the weapon slots to inventory. BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); int16 slot; int16 WeaponSlot; ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory @@ -2585,16 +2585,16 @@ void Client::SetBandolier(const EQApplicationPacket *app) { else { // The player doesn't have the required weapon with them. BandolierItems[BandolierSlot] = 0; if (slot == INVALID_INDEX) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { // If there was an item in that weapon slot, put it in the inventory - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(InvItem) { // If there was already an item in that weapon slot that we replaced, find a place to put it if(!MoveItemToInventory(InvItem)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2640,13 +2640,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // put it in the player's inventory. ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name); // If there was an item in that weapon slot, put it in the inventory if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { if(!ItemToReturn) return false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); uint32 ItemID = ItemToReturn->GetItem()->ID; @@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(i), i); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); return true; } @@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); return true; } @@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // Store on the cursor // - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); PushItemOnCursor(*ItemToReturn, UpdateClient); @@ -2865,8 +2865,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (log) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); @@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) { if (depth >= 10) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); return; } @@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea else { e = ""; } if (log) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); if (!silent) requester->Message(1, "%i:%i - inst: %s - parent: %s%s", diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 316019486..ccff63bab 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml drop_chance = zone->random.Real(0.0, 100.0); #if EQDEBUG>=11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); #endif if (thischance == 100.0 || drop_chance < thischance) { @@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge ServerLootItem_Struct* item = new ServerLootItem_Struct; #if EQDEBUG>=11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif EQApplicationPacket* outapp = nullptr; diff --git a/zone/merc.cpp b/zone/merc.cpp index 2cfe647af..a9829677f 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -885,7 +885,7 @@ int32 Merc::CalcMaxMana() break; } default: { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -906,7 +906,7 @@ int32 Merc::CalcMaxMana() } #if EQDEBUG >= 11 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1647,7 +1647,7 @@ void Merc::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -1766,7 +1766,7 @@ bool Merc::AI_EngagedCastCheck() { { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); int8 mercClass = GetClass(); @@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/mob.cpp b/zone/mob.cpp index 873edfc58..6e33d79cd 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1576,7 +1576,7 @@ void Mob::SendIllusionPacket(uint16 in_race, uint8 in_gender, uint8 in_texture, entity_list.QueueClients(this, outapp); safe_delete(outapp); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size); } @@ -3043,7 +3043,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) { if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function if(IsClient()){ Message(0, "Invalid spell proc %u", spell_id); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); } return; } @@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) { if(lifetap_amt && damage > 0){ lifetap_amt = damage * lifetap_amt / 100; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); if (lifetap_amt > 0) HealDamage(lifetap_amt); //Heal self for modified damage amount. diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 7634f14c8..ebd5f6182 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -1404,7 +1404,7 @@ void Mob::AI_Process() { else if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); if(!RuleB(Pathing, Aggro) || !zone->pathing) CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed()); else @@ -1639,7 +1639,7 @@ void NPC::AI_DoMovement() { roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y); if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true)) { @@ -1692,11 +1692,11 @@ void NPC::AI_DoMovement() { else { movetimercompleted=false; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); //if we were under quest control (with no grid), we are done now.. if(cur_wp == -2) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); roamer = false; cur_wp = 0; } @@ -1727,7 +1727,7 @@ void NPC::AI_DoMovement() { { // currently moving if (cur_wp_x == GetX() && cur_wp_y == GetY()) { // are we there yet? then stop - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); SetWaypointPause(); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1773,7 +1773,7 @@ void NPC::AI_DoMovement() { if (movetimercompleted==true) { // time to pause has ended SetGrid( 0 - GetGrid()); // revert to AI control - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1809,7 +1809,7 @@ void NPC::AI_DoMovement() { if (!CP2Moved) { if(moved) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); ClearFeignMemory(); moved=false; SetMoving(false); @@ -1934,7 +1934,7 @@ bool NPC::AI_EngagedCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); // try casting a heal or gate if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) { @@ -1957,7 +1957,7 @@ bool NPC::AI_PursueCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) { //no spell cast, try again soon. AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false); diff --git a/zone/net.cpp b/zone/net.cpp index 0e869c225..4297641dc 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -148,28 +148,28 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading server configuration failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading server configuration failed."); return 1; } const ZoneConfig *Config=ZoneConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); worldserver.SetPassword(Config->SharedKey.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Cannot continue without a database connection."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Cannot continue without a database connection."); return 1; } @@ -186,121 +186,121 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #endif const char *log_ini_file = "./log.ini"; if(!load_log_settings(log_ini_file)) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); database.LoadVariables(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading items FAILED!"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading items FAILED!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading loot FAILED!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading skill caps FAILED!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading base data FAILED!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); database.LoadFactionData(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); database.LoadTributes(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Command loading FAILED"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Command loading FAILED"); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(TaskSystem, EnableTaskSystem)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); taskmanager = new TaskManager; taskmanager->LoadTasks(); } @@ -317,11 +317,11 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); parse->ReloadQuests(); if (!worldserver.Connect()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -332,9 +332,9 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; } @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #ifndef WIN32 - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); #endif Timer quest_timers(100); @@ -365,13 +365,13 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); // log_sys.CloseZoneLogs(); // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); if (!eqsf.Open(Config->ZonePort)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); worldserver.Disconnect(); worldwasconnected = false; @@ -385,7 +385,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqss->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); stream_identifier.AddStream(eqss); //takes the stream } @@ -397,7 +397,7 @@ int main(int argc, char** argv) { //now that we know what patch they are running, start up their client object struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); Client* client = new Client(eqsi); entity_list.AddClient(client); } @@ -522,13 +522,13 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); CheckEQEMuErrorAndPause(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -539,7 +539,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); // safe_delete(worldserver); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); } uint32 NetConnection::GetIP() @@ -628,7 +628,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 2351afafa..ea031a4ed 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Database error, invalid item"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem { if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); } } } diff --git a/zone/object.cpp b/zone/object.cpp index 34d85a33c..604234238 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 425ea9e34..c90e27b9b 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -61,19 +61,19 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) if(Ret->loadPaths(PathFile)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,18 +103,18 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Bad Magic String in .path file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Bad Magic String in .path file."); return false; } fread(&Head, sizeof(Head), 1, PathFile); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", (long)Head.version, (long)Head.PathNodeCount); if(Head.version != 2) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported path file version."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque PathManager::FindRoute(int startID, int endID) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -330,7 +330,7 @@ std::deque PathManager::FindRoute(int startID, int endID) } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); return Route; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::deque noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToStart <0 ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return noderoute; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); // Find the nearest PathNode the end point has LOS to @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToEnd < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); return noderoute; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); if(ClosestPathNodeToStart == ClosestPathNodeToEnd) { @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) return To; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); if(From == PathingLastPosition) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((PathingLoopCount > 5) && !IsRooted()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); if(Route.size() == 0) { @@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // If we are already pathing, and the destination is the same as before ... if(SameDestination) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); // Get the coordinates of the first path node we are going to. NextNode = Route.front(); @@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // We have reached the path node. if(NodeLoc == From) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); NodeReached = true; @@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // target, and we may run past the target if we don't check LOS at this point. int RouteSize = Route.size(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); if((RouteSize == 2) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode); } @@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // we have run all the nodes, all that is left is the direct path from the last node // to the destination - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); return To; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // We get here if we were already pathing, but our destination has now changed. // - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); // Update our record of where we are going to. PathingDestination = To; // Check if we now have LOS etc to the new destination. @@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } } @@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { if(!PathingRouteUpdateTimerShort->Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); } else { if(!PathingRouteUpdateTimerLong->Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); } // We are already pathing, destination changed, no LOS. Find the nearest node to our destination. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. if(DestinationPathNode == -1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); Route.clear(); return To; } @@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // one, we will carry on on our path. if(DestinationPathNode == Route.back()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); @@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Check if we have reached a path node. if(NodeLoc == From) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); NodeReached = true; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // Return the coords of our next path node on the route. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); return To; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); Route.clear(); // We will now fall through to get a new route. @@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); if((SameDestination) && !PathingLOSCheckTimer->Check()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); return To; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); return To; } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); Route = zone->pathing->FindRoute(From, To); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); return To; } if(SameDestination && (Route.front() == PathingLastNodeVisited)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Route.clear(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); PathingLoopCount = 0; @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } if(ClosestPathNodeToStart <0 ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return -1; } return ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); return false; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); if (ABS(NewZ - last_z) > 5.0f) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } if (best_z2 == -999990) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); return false; } else { if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); return false; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); } } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) if(d && !d->IsDoorOpen() ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); d->ForceOpen(ForWho); } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index a60a5288a..881e94f66 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { if (THIS->IsMerc()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); #endif else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { if (THIS->IsMerc()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); #endif else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 373152c29..9e1025393 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,12 +254,12 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); #endif } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index 690ae6434..cbb9cf2f2 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 068817178..d516d6fd1 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -154,7 +154,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -170,7 +170,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::stopalltimers(Mob *mob) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -559,7 +559,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -570,7 +570,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -589,7 +589,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -619,7 +619,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -646,7 +646,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -655,7 +655,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -664,7 +664,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -1652,7 +1652,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); return; } @@ -2074,7 +2074,7 @@ bool QuestManager::istaskenabled(int taskid) { void QuestManager::tasksetselector(int tasksetid) { QuestManagerCurrentQuestVars(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager) initiator->TaskSetSelector(owner, tasksetid); } @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } @@ -2809,7 +2809,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); } } diff --git a/zone/raids.cpp b/zone/raids.cpp index d638f07d5..5ee380233 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 709984976..d3b0cfae8 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -153,13 +153,13 @@ bool Spawn2::Process() { if (timer.Check()) { timer.Disable(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); //first check our spawn condition, if this isnt active //then we reset the timer and try again next time. if(condition_id != SC_AlwaysEnabled && !zone->spawn_conditions.Check(condition_id, condition_min_value)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); Reset(); return(true); } @@ -170,14 +170,14 @@ bool Spawn2::Process() { } if (sg == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } //have the spawn group pick an NPC for us uint32 npcid = sg->GetNPCType(); if (npcid == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); Reset(); //try again later (why?) return(true); } @@ -185,7 +185,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); if (tmp == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); } @@ -194,7 +194,7 @@ bool Spawn2::Process() { { if(!entity_list.LimitCheckName(tmp->name)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); timer.Start(5000); //try again in five seconds. return(true); } @@ -202,7 +202,7 @@ bool Spawn2::Process() { if(tmp->spawn_limit > 0) { if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); timer.Start(5000); //try again in five seconds. return(true); } @@ -233,10 +233,10 @@ bool Spawn2::Process() { if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && sg->min_delay) npc->AI_SetRoambox(sg->roamdist,sg->roambox[0],sg->roambox[1],sg->roambox[2],sg->roambox[3],sg->delay,sg->min_delay); if(zone->InstantGrids()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); LoadGrid(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); } } return true; @@ -261,7 +261,7 @@ void Spawn2::LoadGrid() { //dont set an NPC's grid until its loaded for them. npcthis->SetGrid(grid_); npcthis->AssignWaypoints(grid_); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); } @@ -272,21 +272,21 @@ void Spawn2::LoadGrid() { void Spawn2::Reset() { timer.Start(resetTimer()); npcthis = nullptr; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { if (delay == 0) { timer.Trigger(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } npcthis = nullptr; @@ -328,7 +328,7 @@ void Spawn2::ForceDespawn() cur = despawnTimer(dtimer); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); timer.Start(cur); } @@ -349,7 +349,7 @@ void Spawn2::DeathReset(bool realdeath) if(spawn2_id) { database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), (cur/1000)); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); //store it to database too } } @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -466,12 +466,12 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { if(GetSpawnCondition() != c.condition_id) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); bool old_state = (old_value >= condition_min_value); bool new_state = (c.value >= condition_min_value); if(old_state == new_state) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); return; //no change } @@ -479,50 +479,50 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { switch(c.on_change) { case SpawnCondition::DoNothing: //that was easy. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); break; case SpawnCondition::DoDepop: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; case SpawnCondition::DoRepopIfReady: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); npcthis->Depop(false); //remove the current mob npcthis = nullptr; } if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled. timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); if(timer_remaining <= 0) Repop(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); } break; default: if(c.on_change < SpawnCondition::DoSignalMin) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); return; //unknown onchange action } int signal_id = c.on_change - SpawnCondition::DoSignalMin; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } void Zone::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); LinkedListIterator iterator(spawn2_list); @@ -592,7 +592,7 @@ void SpawnConditionManager::Process() { EQTime::AddMinutes(cevent.period, &cevent.next); std::string t; EQTime::ToString(&cevent.next, t); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); //save the next event time in the DB UpdateDBEvent(cevent); //find the next closest event timer. @@ -611,7 +611,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); return; //unable to find the spawn condition to operate on } @@ -619,7 +619,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { zone->zone_time.getEQTimeOfDay(&tod); if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); return; } @@ -631,26 +631,26 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { switch(event.action) { case SpawnEvent::ActionSet: new_value = event.argument; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); break; case SpawnEvent::ActionAdd: new_value += event.argument; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionSubtract: new_value -= event.argument; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionMultiply: new_value *= event.argument; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; case SpawnEvent::ActionDivide: new_value /= event.argument; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; default: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); return; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -727,7 +727,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: std::string timeAsString; EQTime::ToString(&event.next, timeAsString); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); return true; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -755,7 +755,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in cond.on_change = (SpawnCondition::OnChange) atoi(row[1]); spawn_conditions[cond.condition_id] = cond; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); } //load values @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } @@ -811,7 +811,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in spawn_events.push_back(event); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); } //now we need to catch up on events that happened while we were away @@ -846,7 +846,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in //watch for special case of all 0s, which means to reset next to now if(cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 && cevent.next.minute == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); memcpy(&cevent.next, &tod, sizeof(cevent.next)); //add one period EQTime::AddMinutes(cevent.period, &cevent.next); @@ -857,7 +857,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in bool ran = false; while(EQTime::IsTimeBefore(&tod, &cevent.next)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); //this event has been triggered. //execute the event if(!cevent.strict || StrictCheck) @@ -900,9 +900,9 @@ void SpawnConditionManager::FindNearestEvent() { } } if(next_id == -1) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); } void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update) @@ -914,14 +914,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -930,7 +930,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //set our local value cond.value = new_value; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -941,14 +941,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -959,7 +959,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //save it in the DB too UpdateDBCondition(zone_short, instance_id, condition_id, new_value); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -969,7 +969,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //this is a remote spawn condition, update the DB and send //an update packet to the zone if its up - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); UpdateDBCondition(zone_short, instance_id, condition_id, new_value); @@ -989,7 +989,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance void SpawnConditionManager::ReloadEvent(uint32 event_id) { std::string zone_short_name; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1002,7 +1002,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { //load the event into the old event slot if(!LoadDBEvent(event_id, cevent, zone_short_name)) { //unable to find the event in the database... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } //sync up our nearest event @@ -1015,7 +1015,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { SpawnEvent e; if(!LoadDBEvent(event_id, e, zone_short_name)) { //unable to find the event in the database... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } @@ -1032,7 +1032,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1047,13 +1047,13 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri cevent.enabled = enabled; cevent.strict = strict; if(reset_base) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); //start with the time now zone->zone_time.getEQTimeOfDay(&cevent.next); //advance the next time by our period EQTime::AddMinutes(cevent.period, &cevent.next); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); } //save the event in the DB @@ -1062,7 +1062,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri //sync up our nearest event FindNearestEvent(); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); } //even if we dont change anything, we still found it return; @@ -1081,24 +1081,24 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri SpawnEvent e; std::string zone_short_name; if(!LoadDBEvent(event_id, e, zone_short_name)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); //unable to find the event in the database... return; } if(e.enabled == enabled && !reset_base) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); return; //no changes. } e.enabled = enabled; if(reset_base) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); //start with the time now zone->zone_time.getEQTimeOfDay(&e.next); //advance the next time by our period EQTime::AddMinutes(e.period, &e.next); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); } //save the event in the DB UpdateDBEvent(e); @@ -1123,7 +1123,7 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); return(0); //unable to find the spawn condition } @@ -1138,12 +1138,12 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc zone_short, instance_id, condition_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index e98c80209..98ecffa0f 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa uint32 SpawnGroup::GetNPCType() { #if EQDEBUG >= 10 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); #endif int npcType = 0; int totalchance = 0; @@ -167,7 +167,7 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND zone = '%s'", zone_name); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); return false; } @@ -195,7 +195,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); return false; } @@ -210,7 +210,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "ORDER BY chance", spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); return false; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index a9c58cd5a..f801f7bc4 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -464,7 +464,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) break; } default: - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); return(1000); /* nice long delay for them, the caller depends on this! */ } @@ -683,7 +683,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -695,12 +695,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const ItemInst* Ammo = m_inv[MainAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); return; } @@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const Item_Struct* AmmoItem = Ammo->GetItem(); if(RangeItem->ItemType != ItemTypeBow) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID()); return; } if(AmmoItem->ItemType != ItemTypeArrow) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); //look for ammo in inventory if we only have 1 left... if(Ammo->GetCharges() == 1) { @@ -746,7 +746,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { Ammo = baginst; ammo_slot = m_inv.CalcSlotId(r, i); found = true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); break; } } @@ -761,17 +761,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (aslot != INVALID_INDEX) { ammo_slot = aslot; Ammo = m_inv[aslot]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); } } } float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -799,9 +799,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){ DeleteItemInInventory(ammo_slot, 1, true); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); } CheckIncreaseSkill(SkillArchery, GetTarget(), -15); @@ -873,7 +873,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillArchery); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillArchery, 0, RangeWeapon, Ammo, AmmoSlot, speed); @@ -882,7 +882,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); bool HeadShot = false; uint32 HeadShot_Dmg = TryHeadShot(other, SkillArchery); @@ -923,7 +923,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite MaxDmg += MaxDmg*bonusArcheryDamageModifier / 100; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); bool dobonus = false; if(GetClass() == RANGER && GetLevel() > 50){ @@ -944,7 +944,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite hate *= 2; MaxDmg = mod_archery_bonus_damage(MaxDmg, RangeWeapon); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); } } @@ -1192,7 +1192,7 @@ void NPC::RangedAttack(Mob* other) //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -1361,7 +1361,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -1371,19 +1371,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const ItemInst* RangeWeapon = m_inv[MainRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); if(RangeWeapon->GetCharges() == 1) { //first check ammo @@ -1392,7 +1392,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = MainAmmo; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal); @@ -1400,17 +1400,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //the item wont change, but the instance does, not that it matters ammo_slot = aslot; RangeWeapon = m_inv[aslot]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } } } float range = item->Range + GetRangeDistTargetSizeMod(other); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1489,7 +1489,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillThrowing); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); return; @@ -1497,7 +1497,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); int16 WDmg = 0; @@ -1533,7 +1533,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) other->AvoidDamage(this, TotalDmg, false); //CanRiposte=false - Can not riposte throw attacks. diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index ecffd1921..0f3770394 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -476,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(!target_zone) { #ifdef SPELL_EFFECT_SPAM - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); #endif if(IsClient()) CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); @@ -485,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { #ifdef SPELL_EFFECT_SPAM - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); #endif if(IsClient()) CastToClient()->MovePC(target_zone, x, y, z, heading); @@ -711,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) stun_resist += aabonuses.StunResist; if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; @@ -721,7 +721,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } } break; @@ -1649,7 +1649,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", spell_id, caster->GetName()); CastToCorpse()->CastRezz(spell_id, caster); @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } @@ -3065,7 +3065,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, int mod = caster->GetInstrumentMod(spell_id); mod = ApplySpellEffectiveness(caster, spell_id, mod, true); effect_value = effect_value * mod / 10; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); } effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster); @@ -3127,7 +3127,7 @@ snare has both of them negative, yet their range should work the same: updownsign = 1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", spell_id, formula, base, max, caster_level, updownsign); switch(formula) @@ -3326,7 +3326,7 @@ snare has both of them negative, yet their range should work the same: result = ubase * (caster_level * (formula - 2000) + 1); } else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); } } @@ -3351,7 +3351,7 @@ snare has both of them negative, yet their range should work the same: if (base < 0 && result > 0) result *= -1; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3383,18 +3383,18 @@ void Mob::BuffProcess() IsMezSpell(buffs[buffs_i].spellid) || IsBlindSpell(buffs[buffs_i].spellid)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } } else if (buffs[buffs_i].ticsremaining < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); } } else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)) @@ -3759,7 +3759,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient() && !CastToClient()->IsDead()) CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); if(spells[buffs[slot].spellid].viral_targets > 0) { bool last_virus = true; @@ -4817,7 +4817,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -5156,7 +5156,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } diff --git a/zone/spells.cpp b/zone/spells.cpp index 0587d11ee..7d0718d34 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -147,7 +147,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -166,7 +166,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, (IsAmnesiad() && IsDiscipline(spell_id)) ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -204,7 +204,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, //cannot cast under divine aura if(DivineAura()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -234,7 +234,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -243,7 +243,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, } if (HasActiveSong() && IsBardSong(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client _StopSong(); } @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -349,7 +349,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, const SPDat_Spell_Struct &spell = spells[spell_id]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", spell.name, spell_id, target_id, slot, cast_time, mana_cost, item_slot==0xFFFFFFFF?999:item_slot); casting_spell_id = spell_id; @@ -363,7 +363,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_type = type; SaveSpellLoc(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); // if this spell doesn't require a target, or if it's an optional target // and a target wasn't provided, then it's us; unless TGB is on and this @@ -375,7 +375,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, spell.targettype == ST_Beam || spell.targettype == ST_TargetOptional) && target_id == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); target_id = GetID(); } @@ -392,7 +392,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, // we checked for spells not requiring targets above if(target_id == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, SPELL_NEED_TAR); @@ -430,7 +430,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { mana_cost = 0; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, INSUFFICIENT_MANA); @@ -451,7 +451,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_resist_adjust = resist_adjust; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", spell_id, cast_time, orgcasttime, mana_cost); // cast time is 0, just finish it right now and be done with it @@ -517,7 +517,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); return false; @@ -756,7 +756,7 @@ bool Client::CheckFizzle(uint16 spell_id) float fizzle_roll = zone->random.Real(0, 100); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); if(fizzle_roll > fizzlechance) return(true); @@ -816,7 +816,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) ZeroCastingVars(); // resets all the state keeping stuff - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); if(!spellid) return; @@ -893,7 +893,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? Message_StringID(13, SPELL_RECAST); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -907,7 +907,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { Message_StringID(13, SPELL_RECAST); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -916,7 +916,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!IsValidSpell(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); InterruptSpell(); return; } @@ -927,7 +927,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(delaytimer) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); Message(13, "You are unable to focus."); InterruptSpell(); return; @@ -937,7 +937,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // make sure they aren't somehow casting 2 timed spells at once if (casting_spell_id != spell_id) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); Message_StringID(13,ALREADY_CASTING); InterruptSpell(); return; @@ -952,7 +952,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if (IsBardSong(spell_id)) { if(spells[spell_id].buffduration == 0xFFFF || spells[spell_id].recast_time != 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); } else { bardsong = spell_id; bardsong_slot = slot; @@ -962,7 +962,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, else bardsong_target_id = spell_target->GetID(); bardsong_timer.Start(6000); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); bard_song_mode = true; } } @@ -1041,10 +1041,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); InterruptSpell(); return; } @@ -1060,10 +1060,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(IsClient()) { int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { if(reg_focus > 0) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); Client *c = this->CastToClient(); int component, component_count, inv_slot_id; bool missingreags = false; @@ -1116,11 +1116,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, break; default: // some non-instrument component. Let it go, but record it in the log - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); } if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); if(c->GetGM()) c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { @@ -1143,12 +1143,12 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, const Item_Struct *item = database.GetItem(component); if(item) { c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { char TempItemName[64]; strcpy((char*)&TempItemName, "UNKNOWN"); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); } } } // end bard/not bard ifs @@ -1169,7 +1169,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (component == -1) continue; component_count = spells[spell_id].component_counts[t_count]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); // Components found, Deleting // now we go looking for and deleting the items one by one for(int s = 0; s < component_count; s++) @@ -1234,7 +1234,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { Message_StringID(13, SPELL_RECAST); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -1253,15 +1253,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(fromaug) { charges = -1; } //Don't destroy the parent item if(charges > -1) { // charged item, expend a charge - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); DeleteChargeFromSlot = inventory_slot; } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; @@ -1280,7 +1280,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // we're done casting, now try to apply the spell if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust) ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); InterruptSpell(); return; } @@ -1309,7 +1309,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, this->CastToClient()->CheckSongSkillIncrease(spell_id); this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); } else { @@ -1344,7 +1344,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, delaytimer = true; spellend_timer.Start(400,true); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); } @@ -1391,7 +1391,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce && (IsGrouped() // still self only if not grouped || IsRaidGrouped()) && (HasProjectIllusion())){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); targetType = ST_GroupClientAndPet; } @@ -1474,7 +1474,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce ) { //invalid target - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1487,7 +1487,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3)) { //invalid target - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1501,7 +1501,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (spell_target != GetPet()) || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, body_type); Message_StringID(13, SPELL_NEED_TAR); @@ -1526,7 +1526,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || mob_body != target_bt) { //invalid target - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); if(!spell_target) Message_StringID(13,SPELL_NEED_TAR); else @@ -1544,7 +1544,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1552,14 +1552,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target->IsNPC()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1568,7 +1568,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } @@ -1580,7 +1580,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target || !spell_target->IsPlayerCorpse()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); uint32 message = ONLY_ON_CORPSES; if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; @@ -1596,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = GetPet(); if(!spell_target) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); Message_StringID(13,NO_PET); return false; // can't cast these unless we have a target } @@ -1666,7 +1666,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1703,7 +1703,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1800,14 +1800,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } @@ -1878,7 +1878,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; @@ -1957,7 +1957,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) return(false); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target // spell that's recast every 2500 msec for AEDuration msec. There are @@ -1968,7 +1968,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Mob *beacon_loc = spell_target ? spell_target : this; Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); spell_target = nullptr; ae_center = beacon; CastAction = AECaster; @@ -1977,7 +1977,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // check line of sight to target if it's a detrimental spell if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); Message_StringID(13,CANT_SEE_TARGET); return false; } @@ -2008,13 +2008,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range; if(dist2 > range2) { //target is out of range. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); Message_StringID(13, TARGET_TOO_CLOSE); return(false); } @@ -2043,7 +2043,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS if(spell_target == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } if (isproc) { @@ -2067,11 +2067,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(IsPlayerIllusionSpell(spell_id) && IsClient() && (HasProjectIllusion())){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); SetProjectIllusion(false); } else{ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); } break; } @@ -2235,7 +2235,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // CastSpell already reduced the cost for it if we're a client with focus if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); if (!DoHPToManaCovert(mana_used)) SetMana(GetMana() - mana_used); TryTriggerOnValueAmount(false, true); @@ -2247,7 +2247,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF) { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; @@ -2263,7 +2263,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(reduction) recast -= reduction; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } @@ -2301,7 +2301,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(slot == USE_ITEM_SPELL_SLOT) { //bard songs should never come from items... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); return(false); } @@ -2309,12 +2309,12 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } if(ae_center != nullptr && ae_center->IsBeacon()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2323,18 +2323,18 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(mana_used > 0) { if(mana_used > GetMana()) { //ran out of mana... this calls StopSong() for us - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); return(false); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); SetMana(GetMana() - mana_used); } // check line of sight to target if it's a detrimental spell if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); Message_StringID(13, CANT_SEE_TARGET); return(false); } @@ -2349,7 +2349,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range2 = range * range; if(dist2 > range2) { //target is out of range. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } @@ -2365,10 +2365,10 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case SingleTarget: { if(spell_target == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); spell_target->BardPulse(spell_id, this); break; } @@ -2386,7 +2386,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { { // we can't cast an AE spell without something to center it on if(ae_center == nullptr) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2394,9 +2394,9 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(spell_target) { // this must be an AETarget spell // affect the target too spell_target->BardPulse(spell_id, this); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); } bool affect_caster = !IsNPC(); //NPC AE spells do not affect the NPC caster entity_list.AEBardPulse(this, ae_center, spell_id, affect_caster); @@ -2406,13 +2406,13 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case GroupSpell: { if(spell_target->IsGrouped()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); Group *target_group = entity_list.GetGroupByMob(spell_target); if(target_group) target_group->GroupBardPulse(this, spell_id); } else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); Raid *r = entity_list.GetRaidByClient(spell_target->CastToClient()); if(r){ uint32 gid = r->GetGroup(spell_target->GetName()); @@ -2429,7 +2429,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); BardPulse(spell_id, this); #ifdef GROUP_BUFF_PETS if (GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) @@ -2455,13 +2455,13 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { if(buffs[buffs_i].spellid != spell_id) continue; if(buffs[buffs_i].casterid != caster->GetID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); return; } //extend the spell if it will expire before the next pulse if(buffs[buffs_i].ticsremaining <= 3) { buffs[buffs_i].ticsremaining += 3; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); } //should we send this buff update to the client... seems like it would @@ -2559,7 +2559,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { //we are done... return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); //this spell is not affecting this mob, apply it. caster->SpellOnTarget(spell_id, this); } @@ -2601,7 +2601,7 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste res = mod_buff_duration(res, caster, target, spell_id); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", spell_id, castlevel, formula, duration, res); return(res); @@ -2673,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) return duration ? duration : 3600; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); return 0; } } @@ -2695,15 +2695,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); // Same Spells and dot exemption is set to 1 or spell is Manaburn if (spellid1 == spellid2) { if (sp1.dot_stacking_exempt == 1 && caster1 != caster2) { // same caster can refresh - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); return -1; } else if (spellid1 == 2751) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); return -1; } } @@ -2735,7 +2735,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { if(!IsDetrimentalSpell(spellid1) && !IsDetrimentalSpell(spellid2)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); return (0); } } @@ -2804,16 +2804,16 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value, sp1_value, (sp1_value < overwrite_below_value)?"Overwriting":"Not overwriting"); if(sp1_value < overwrite_below_value) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); return 1; // overwrite spell if its value is less } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value); } @@ -2827,22 +2827,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value, sp2_value, (sp2_value < blocked_below_value)?"Blocked":"Not blocked"); if (sp2_value < blocked_below_value) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); return -1; //blocked } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } } } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", sp1.name, spellid1, sp2.name, spellid2); } @@ -2905,13 +2905,13 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(IsNPC() && caster1 && caster2 && caster1 != caster2) { if(effect1 == SE_CurrentHP && sp1_detrimental && sp2_detrimental) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); continue; } } if(effect1 == SE_CompleteHeal){ //SE_CompleteHeal never stacks or overwrites ever, always block. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); return (-1); } @@ -2923,7 +2923,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(sp_det_mismatch) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); continue; } @@ -2932,7 +2932,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, and the effect is a dot we can go ahead and stack it */ if(effect1 == SE_CurrentHP && spellid1 != spellid2 && sp1_detrimental && sp2_detrimental) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); continue; } @@ -2958,7 +2958,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, sp2_value = 0 - sp2_value; if(sp2_value < sp1_value) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", sp2.name, sp2_value, sp1.name, sp1_value, sp2.name); return -1; // can't stack } @@ -2967,7 +2967,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //we dont return here... a better value on this one effect dosent mean they are //all better... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", sp1.name, sp1_value, sp2.name, sp2_value, sp1.name); will_overwrite = true; } @@ -2976,15 +2976,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //so now we see if this new spell is any better, or if its not related at all if(will_overwrite) { if (values_equal && effect_match && !IsGroupSpell(spellid2) && IsGroupSpell(spellid1)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", sp2.name, spellid2, sp1.name, spellid1); return -1; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); return(1); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); return 0; } @@ -3043,11 +3043,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } if (duration == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); return -2; // no duration? this isn't a buff } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); // first we loop through everything checking that the spell @@ -3077,12 +3077,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid ret = CheckStackConflict(curbuf.spellid, curbuf.casterlevel, spell_id, caster_level, entity_list.GetMobID(curbuf.casterid), caster, buffslot); if (ret == -1) { // stop the spell - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); return -1; } if (ret == 1) { // set a flag to indicate that there will be overwriting - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); // If this is the first buff it would override, use its slot if (!will_overwrite) @@ -3106,7 +3106,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid for (buffslot = 0; buffslot < buff_count; buffslot++) { const Buffs_Struct &curbuf = buffs[buffslot]; if (IsBeneficialSpell(curbuf.spellid)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", spell_id, curbuf.spellid, buffslot); BuffFadeBySlot(buffslot, false); emptyslot = buffslot; @@ -3114,11 +3114,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } } if(emptyslot == -1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); return -1; } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); return -1; } } @@ -3169,7 +3169,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].UpdateClient = true; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); if (IsPet() && GetOwner() && GetOwner()->IsClient()) SendPetBuffsToClient(); @@ -3207,7 +3207,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) { int i, ret, firstfree = -2; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); int buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) @@ -3231,19 +3231,19 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) if(ret == 1) { // should overwrite current slot if(iFailIfOverwrite) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return(-1); } if(firstfree == -2) firstfree = i; } if(ret == -1) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return -1; // stop the spell, can't stack it } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); return firstfree; } @@ -3270,7 +3270,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // well we can't cast a spell on target without a target if(!spelltar) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); Message(13, "SOT: You must have a target for this spell."); return false; } @@ -3298,7 +3298,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r uint16 caster_level = GetCasterLevel(spell_id); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); // Actual cast action - this causes the caster animation and the particles // around the target @@ -3378,7 +3378,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Spells, EnableBlockedBuffs)) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", spell_id, spelltar->GetName()); safe_delete(action_packet); return true; @@ -3386,7 +3386,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBlockedPetBuff(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", spell_id, spelltar->GetName(), spelltar->GetOwner()->GetName()); safe_delete(action_packet); return true; @@ -3395,7 +3395,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // invuln mobs can't be affected by any spells, good or bad if(spelltar->GetInvul() || spelltar->DivineAura()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3406,17 +3406,17 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Pets, UnTargetableSwarmPet)) { if (spelltar->IsNPC()) { if (!spelltar->CastToNPC()->GetSwarmOwner()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } @@ -3525,9 +3525,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spells[spell_id].targettype == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); @@ -3537,7 +3537,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r } else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; @@ -3551,7 +3551,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsImmuneToSpell(spell_id, this)) { //the above call does the message to the client if needed - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3644,7 +3644,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spell_effectiveness == 0 || !IsPartialCapableSpell(spell_id) ) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); @@ -3692,7 +3692,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsAIControlled() && IsDetrimentalSpell(spell_id) && !IsHarmonySpell(spell_id)) { int32 aggro_amount = CheckAggroAmount(spell_id, isproc); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); if(aggro_amount > 0) spelltar->AddToHateList(this, aggro_amount); else{ int32 newhate = spelltar->GetHateAmount(this) + aggro_amount; @@ -3709,7 +3709,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // make sure spelltar is high enough level for the buff if(RuleB(Spells, BuffLevelRestrictions) && !spelltar->CheckSpellLevelRestriction(spell_id)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); @@ -3721,7 +3721,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_type != 1) // AA is handled differently Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); @@ -3825,14 +3825,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r safe_delete(action_packet); safe_delete(message_packet); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); return true; } void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) @@ -4005,7 +4005,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) //this spell like 10 times, this could easily be consolidated //into one loop through with a switch statement. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); if(!IsValidSpell(spell_id)) return true; @@ -4016,7 +4016,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(IsMezSpell(spell_id)) { if(GetSpecialAbility(UNMEZABLE)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); caster->Message_StringID(MT_Shout, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4034,7 +4034,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if((GetLevel() > spells[spell_id].max[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL); return true; } @@ -4043,7 +4043,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // slow and haste spells if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); caster->Message_StringID(MT_Shout, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4059,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4070,13 +4070,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) return true; } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id); if (aggro > 0) { @@ -4090,7 +4090,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) { Message(13, "Your are immune to fear."); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } @@ -4100,7 +4100,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNCHARMABLE)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); caster->Message_StringID(MT_Shout, CANNOT_CHARM); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4113,7 +4113,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); caster->Message(MT_Shout, "You cannot charm yourself."); return true; } @@ -4126,7 +4126,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) assert(effect_index >= 0); if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_CHARM_YET); return true; } @@ -4140,7 +4140,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) ) { if(GetSpecialAbility(UNSNAREABLE)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); caster->Message_StringID(MT_Shout, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4156,7 +4156,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); caster->Message_StringID(MT_Shout, CANT_DRAIN_SELF); return true; } @@ -4166,13 +4166,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); caster->Message_StringID(MT_Shout, CANNOT_SAC_SELF); return true; } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); return false; } @@ -4209,7 +4209,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use if(GetSpecialAbility(IMMUNE_MAGIC)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); return(0); } @@ -4230,7 +4230,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int fear_resist_bonuses = CalcFearResistChance(); if(zone->random.Roll(fear_resist_bonuses)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); return 0; } } @@ -4248,7 +4248,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int resist_bonuses = CalcResistChanceBonus(); if(resist_bonuses && zone->random.Roll(resist_bonuses)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); return 0; } } @@ -4256,7 +4256,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get the resist chance for the target if(resist_type == RESIST_NONE) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); return 100; } @@ -4822,7 +4822,7 @@ void Client::MemSpell(uint16 spell_id, int slot, bool update_client) } m_pp.mem_spells[slot] = spell_id; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); database.SaveCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4837,7 +4837,7 @@ void Client::UnmemSpell(int slot, bool update_client) if(slot > MAX_PP_MEMSPELL || slot < 0) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); m_pp.mem_spells[slot] = 0xFFFFFFFF; database.DeleteCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4870,7 +4870,7 @@ void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client) m_pp.spell_book[slot] = spell_id; database.SaveCharacterSpell(this->CharacterID(), spell_id, slot); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); if(update_client) { @@ -4883,7 +4883,7 @@ void Client::UnscribeSpell(int slot, bool update_client) if(slot >= MAX_PP_SPELLBOOK || slot < 0) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); m_pp.spell_book[slot] = 0xFFFFFFFF; database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[slot], slot); @@ -4914,7 +4914,7 @@ void Client::UntrainDisc(int slot, bool update_client) if(slot >= MAX_PP_DISCIPLINES || slot < 0) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); m_pp.disciplines.values[slot] = 0; database.DeleteCharacterDisc(this->CharacterID(), slot); @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } @@ -5040,7 +5040,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "FindType: type = %d; value = %d; threshold = %d", type, value, threshold); if (value < threshold) @@ -5089,23 +5089,23 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; PermaProcs[i].base_spellID = base_spell_id; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); } else { for (i = 0; i < MAX_PROCS; i++) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; SpellProcs[i].base_spellID = base_spell_id;; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); } return false; } @@ -5116,7 +5116,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].chance = 0; SpellProcs[i].base_spellID = SPELL_UNKNOWN; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); } } return true; @@ -5133,7 +5133,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id DefensiveProcs[i].spellID = spell_id; DefensiveProcs[i].chance = iChance; DefensiveProcs[i].base_spellID = base_spell_id; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5148,7 +5148,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) DefensiveProcs[i].spellID = SPELL_UNKNOWN; DefensiveProcs[i].chance = 0; DefensiveProcs[i].base_spellID = SPELL_UNKNOWN; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); } } return true; @@ -5165,7 +5165,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id) RangedProcs[i].spellID = spell_id; RangedProcs[i].chance = iChance; RangedProcs[i].base_spellID = base_spell_id; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5180,7 +5180,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) RangedProcs[i].spellID = SPELL_UNKNOWN; RangedProcs[i].chance = 0; RangedProcs[i].base_spellID = SPELL_UNKNOWN;; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); } } return true; @@ -5211,7 +5211,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) int Mob::GetCasterLevel(uint16 spell_id) { int level = GetLevel(); level += itembonuses.effective_casting_level + spellbonuses.effective_casting_level + aabonuses.effective_casting_level; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); return(level); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 187c4a42f..56fd8f1e6 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() { int taskID = atoi(row[1]); TaskSets[taskSet].push_back(taskID); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); } return true; @@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() { bool TaskManager::LoadSingleTask(int TaskID) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false; @@ -115,21 +115,21 @@ bool TaskManager::LoadSingleTask(int TaskID) { void TaskManager::ReloadGoalLists() { if(!GoalListManager.LoadLists()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); } bool TaskManager::LoadTasks(int singleTask) { // If TaskID !=0, then just load the task specified. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); std::string query; if(singleTask == 0) { if(!GoalListManager.LoadLists()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); if(!LoadTaskSets()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, " "`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, " @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->SequenceMode = ActivitiesSequential; Tasks[taskID]->LastStep = 0; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward, Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel, Tasks[taskID]->Repeatable ? "Yes" : "No"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]); Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " "GoalMethod: %i, GoalCount: %3i, ZoneID:%3i", Tasks[taskID]->ActivityCount, activityID, taskID, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type, @@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); Tasks[taskID]->ActivityCount++; } @@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { int characterID = c->CharacterID(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { for(int task=0; taskActiveTasks[task].Updated) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) " "VALUES (%i, %i, %i, %i)", characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(!state->ActiveTasks[task].Activity[activityIndex].Updated) continue; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", characterID, task, activityIndex); if(updatedActivityCount==0) @@ -358,11 +358,11 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(updatedActivityCount == 0) continue; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { for(unsigned int i=state->LastCompletedTaskLoaded; iCompletedTasks.size(); i++) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); int taskID = state->CompletedTasks[i].TaskID; if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr)) @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -459,14 +459,14 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTaskCount = 0; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` " "FROM `character_tasks` " "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { ++state->ActiveTaskCount; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); } // Load Activities - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` " "FROM `character_activities` " @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,12 +634,12 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); state->EnabledTasks.push_back(taskID); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); } // Check that there is an entry in the client task state for every activity in each task @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); return true; } @@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { } } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); for(unsigned int i=0; iGetLevel(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, state->EnabledTasks.size()); if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return; @@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if(TaskSets[TaskSetID][0] == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); std::vector::iterator Iterator = TaskSets[TaskSetID].begin(); while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) { @@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) && (TaskListIndex < MAXCHOOSERENTRIES)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex, TaskSets[TaskSetID][TaskSetIndex]); @@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task return; } // Titanium OpCode: 0x5e7c - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); char *Ptr; int PlayerLevel = c->GetLevel(); @@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); int PlayerLevel = c->GetLevel(); @@ -1275,16 +1275,16 @@ int ClientTaskState::GetActiveTaskID(int index) { static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); } bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { @@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first // activity as active if not complete. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode); if(Task->SequenceMode == ActivitiesSequential) { @@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) { if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTasks.push_back(cti); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); return AllActivitiesComplete; } @@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { bool CurrentStepComplete = true; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); // If CurrentStep is -1, this is the first call to this method since loading the // client state. Unlock all activities with a step number of 0 if(ActiveTasks[TaskIndex].CurrentStep == -1) { @@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // If we are only keeping one completed record per task, and the player has done // the same task again, erase the previous completed entry for this task. if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI int Ret = false; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); // If the client has no tasks, there is nothing further to check. @@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(Task->Activity[j].Type != ActivityType) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID); continue; } @@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI continue; } // We found an active task to kill this type of NPC, so increment the done count - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); IncrementDoneCount(c, Task, i, j); Ret = true; } @@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI // If the client has no tasks, there is nothing further to check. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); if(ActiveTaskCount == 0) return; @@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(Task->Activity[j].Type != (int)Type) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", c->GetName(), Type, ItemID); continue; } @@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI continue; } // We found an active task related to this item, so increment the done count - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); IncrementDoneCount(c, Task, i, j, Count); } } @@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { // If the client has no tasks, there is nothing further to check. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityExplore) continue; if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", c->GetName(), ExploreID); continue; } @@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { } // We found an active task to explore this area, so set done count to goal count // (Only a goal count of 1 makes sense for explore activities?) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); @@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i bool Ret = false; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); if(ActiveTaskCount == 0) return false; @@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i (Task->Activity[j].Type != ActivityGiveCash)) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID); continue; } @@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i // Is the activity related to these items ? // if((Task->Activity[j].Type == ActivityGiveCash) && Cash) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); IncrementDoneCount(c, Task, i, j, Cash); Ret = true; } @@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i continue; } // We found an active task related to this item, so increment the done count - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); IncrementDoneCount(c, Task, i, j, 1); Ret = true; } @@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { // If the client has no tasks, there is nothing further to check. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityTouch) continue; if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue; if(Task->Activity[j].ZoneID != ZoneID) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", c->GetName()); continue; } // We found an active task to zone into this zone, so set done count to goal count // (Only a goal count of 1 makes sense for touch activities?) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); } @@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { } void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count; @@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true; // Have we reached the goal count for this activity ? if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount, Task->Activity[ActivityID].GoalCount, ActivityID); @@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); // and by the 'Task Stage Completed' message c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex); // Send the updated task/activity list to the client @@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) { void ClientTaskState::FailTask(Client *c, int TaskID) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); if(ActiveTaskCount == 0) return; for(int i=0; i= Task->ActivityCount) return false; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State); @@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update); } void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0; @@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) { if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1; for(unsigned int i=0; iunknown5 = 0x00000001; tac->unknown5 = 0; // 0 for task complete or failed. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); @@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) if(State->CompletedTasks.size() > 50) FirstTaskToSend = State->CompletedTasks.size() - 50; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend); /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { @@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, @@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, TaskComplete); @@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->SequenceNumber = SequenceNumber; cts->unknown4 = 0x00000002; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); @@ -2932,24 +2932,24 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { int characterID = c->CharacterID(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY; ActiveTaskCount--; @@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { // int FreeSlot = -1; for(int i=0; iProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } @@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() { bool TaskGoalListManager::LoadLists() { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); for(int i=0; i< NumberOfLists; i++) safe_delete_array(TaskGoalLists[i].GoalItemEntries); @@ -3088,12 +3088,12 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } NumberOfLists = results.RowCount(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); TaskGoalLists = new TaskGoalList_Struct[NumberOfLists]; @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3207,7 +3207,7 @@ std::vector TaskGoalListManager::GetListContents(int ListID) { bool TaskGoalListManager::IsInList(int ListID, int Entry) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); int ListIndex = GetListByID(ListID); @@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) { else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry]) LastEntry = MiddleEntry - 1; else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); return true; } @@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() { bool TaskProximityManager::LoadProximities(int zoneID) { TaskProximity proximity; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); TaskProximities.clear(); std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, " @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) { TaskProximity* P = &TaskProximities[i]; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ); if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY || diff --git a/zone/titles.cpp b/zone/titles.cpp index 38c344cc6..68ae958ae 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 572c02521..a83647a83 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { //handle caps if(spec->nofail) { chance = 100; //cannot fail. - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); } else if(over_trivial >= 0) { // At reaching trivial the chance goes to 95% going up an additional // percent for every 40 skillpoints above the trivial. @@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { chance = 95; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); float res = zone->random.Real(0, 99); int aa_chance = 0; @@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); itr = spec->onsuccess.begin(); while(itr != spec->onsuccess.end() && !spec->quest) { @@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(MT_Emote,TRADESKILL_FAILED); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); @@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float NotifyNewTitlesAvailable(); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); } bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,12 +1477,12 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if (results.RowCount() != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index d2873cc66..16c0d7e49 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -86,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (!owner || !owner->IsClient()) { // This should never happen - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); return; } @@ -126,7 +126,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { inst2->SetCharges(stack_size + inst2->GetCharges()); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); if (_stack_size > 0) inst->SetCharges(_stack_size); @@ -143,7 +143,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { SendItemData(inst, trade_slot_id); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); client->DeleteItemInInventory(MainCursor); @@ -296,7 +296,7 @@ void Trade::LogTrade() void Trade::DumpTrade() { Mob* with = With(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) @@ -307,7 +307,7 @@ void Trade::DumpTrade() const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", inst->GetItem()->ID, inst->GetCharges(), i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); @@ -315,7 +315,7 @@ void Trade::DumpTrade() for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", inst->GetItem()->ID, inst->GetCharges(), Inventory::CalcSlotId(i, j)); } @@ -324,7 +324,7 @@ void Trade::DumpTrade() } } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); } #endif @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; if (partial_inst->GetID() != inst->GetID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -458,7 +458,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st bool qs_log = false; if(other) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); this->AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true); @@ -491,7 +491,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -552,17 +552,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; if (partial_inst->GetID() != inst->GetID()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -606,10 +606,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st inst->SetCharges(0); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); if (other->PutItemInInventory(partial_slot, *partial_inst, true)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, (old_charges - inst->GetCharges())); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -635,7 +635,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName(), (old_charges - inst->GetCharges())); inst->SetCharges(old_charges); @@ -710,7 +710,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -718,7 +718,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -772,17 +772,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -1160,7 +1160,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) { const Item_Struct* item = database.GetItem(ItemID); if(!item){ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); return; } @@ -1219,10 +1219,10 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } @@ -1245,7 +1245,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); return nullptr; } @@ -1302,7 +1302,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ } } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", SerialNumber , Quantity, this->GetName()); return 0; @@ -1311,7 +1311,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Customer,uint16 TraderSlot, int SerialNumber) { if(!Customer) return; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); if(Quantity < Charges) { Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber); m_inv.DeleteItem(Slot, Quantity); @@ -1395,7 +1395,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* if(!Stackable) Quantity = (Charges > 0) ? Charges : 1; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); } if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){ this->DeleteItemInInventory(SlotID, Quantity); @@ -1431,7 +1431,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* } } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, Quantity,this->GetName()); } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1510,13 +1510,13 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat const ItemInst* BuyItem = Trader->FindTraderItemBySerialNumber(tbs->ItemID); if(!BuyItem) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); TradeRequestFailed(app); safe_delete(outapp); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", BuyItem->GetItem()->Name, BuyItem->IsStackable(), tbs->Quantity, BuyItem->GetCharges()); // If the item is not stackable, then we can only be buying one of them. if(!BuyItem->IsStackable()) @@ -1534,12 +1534,12 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat outtbs->Quantity = tbs->Quantity; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); @@ -1836,11 +1836,11 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); int Size = 0; uint32 ID = 0; @@ -1887,7 +1887,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint VARSTRUCT_ENCODE_TYPE(uint32, bufptr, ID); } else{ - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0); } Cost = atoi(row[5]); @@ -1981,7 +1981,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(inst->IsStackable()) inst->SetMerchantCount(gis->Charges[i]); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor? @@ -2018,7 +2018,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St if(gis->ItemID[i] == ItemID) { tdis->ItemID = gis->SerialNumber[i]; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); _pkt(TRADING__PACKETS, outapp); @@ -2031,7 +2031,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St return; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); ItemInst* inst = database.CreateItem(item); @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantSlot(gis->SerialNumber[i]); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor?? @@ -2073,7 +2073,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { // TraderPriceUpdate_Struct* tpus = (TraderPriceUpdate_Struct*)app->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", GetName(), tpus->SerialNumber, tpus->NewPrice); // Pull the items this Trader currently has for sale from the trader table. @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); if(!gis) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); return; } @@ -2101,7 +2101,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((gis->ItemID[i] > 0) && (gis->SerialNumber[i] == tpus->SerialNumber)) { // We found the item that the Trader wants to change the price of (or add back up for sale). // - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); IDOfItemToUpdate = gis->ItemID[i]; @@ -2127,7 +2127,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { return ; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); // Find what is in their Trader Satchels GetItems_Struct* newgis=GetTraderItems(); @@ -2140,7 +2140,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((newgis->Items[i] > 0) && (newgis->SerialNumber[i] == tpus->SerialNumber)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], newgis->Charges[i]); IDOfItemToAdd = newgis->Items[i]; @@ -2158,7 +2158,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if(!IDOfItemToAdd || !item) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); @@ -2203,7 +2203,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { gis->SerialNumber[i] = newgis->SerialNumber[i]; gis->ItemCost[i] = tpus->NewPrice; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", GetName(), newgis->Items[i], newgis->SerialNumber[i], newgis->Charges[i], tpus->NewPrice, i); } @@ -2249,7 +2249,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { QueuePacket(app); if(OldPrice == tpus->NewPrice) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); safe_delete(gis); return; } @@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { // This method is called when a potential seller in the /barter window searches for matching buyers // - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); char* escSearchString = new char[strlen(searchString) * 2 + 1]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2515,7 +2515,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Quantity = i; break; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2523,7 +2523,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); if(ItemToTransfer) @@ -2561,7 +2561,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { int16 SellerSlot = m_inv.HasItem(ItemID, 1, invWhereWorn|invWherePersonal|invWhereCursor); if (SellerSlot == INVALID_INDEX) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2569,7 +2569,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2581,7 +2581,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { QuantityMoved += ItemToTransfer->GetCharges(); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2616,7 +2616,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemToTransfer->SetCharges(QuantityToRemoveFromStack); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2855,11 +2855,11 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { bool LoreConflict = CheckLoreConflict(item); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", GetName(), BuySlot, ItemID, item->Name, Quantity, ToggleOnOff, Price, ItemCount, LoreConflict); if((item->NoDrop != 0) && !LoreConflict && (Quantity > 0) && HasMoney(Quantity * Price) && ToggleOnOff && (ItemCount == 0)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); database.AddBuyLine(CharacterID(), BuySlot, ItemID, ItemName, Quantity, Price); QueuePacket(app); } diff --git a/zone/trap.cpp b/zone/trap.cpp index 3f0582c86..6efb00517 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index db3d7ce65..82b1bb4f7 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index a11de0bc8..f574802b6 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -88,7 +88,7 @@ void NPC::StopWandering() roamer=false; CastToNPC()->SetGrid(0); SendPosition(); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); return; } @@ -107,16 +107,16 @@ void NPC::ResumeWandering() cur_wp=save_wp; UpdateWaypoint(cur_wp); // have him head to last destination from here } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); } else if (AIwalking_timer->Enabled()) { // we are at a waypoint paused normally - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); AIwalking_timer->Trigger(); // disable timer to end pause now } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -143,7 +143,7 @@ void NPC::PauseWandering(int pausetime) if (GetGrid() != 0) { DistractedFromGrid = true; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); SendPosition(); if (pausetime<1) { // negative grid number stops him dead in his tracks until ResumeWandering() @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -166,7 +166,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if (GetGrid() < 0) { // currently stopped by a quest command SetGrid( 0 - GetGrid()); // get him moving again - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); } AIwalking_timer->Disable(); // disable timer in case he is paused at a wp if (cur_wp>=0) @@ -174,14 +174,14 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) save_wp=cur_wp; // save the current waypoint cur_wp=-1; // flag this move as quest controlled } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); } else { // not on a grid roamer=true; save_wp=0; cur_wp=-2; // flag as quest controlled w/no grid - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); } if (saveguardspot) { @@ -196,7 +196,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if(guard_heading == -1) guard_heading = this->CalculateHeadingToTarget(mtx, mty); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } cur_wp_x = mtx; @@ -212,7 +212,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) void NPC::UpdateWaypoint(int wp_index) { if(wp_index >= static_cast(Waypoints.size())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); return; } std::vector::iterator cur; @@ -224,7 +224,7 @@ void NPC::UpdateWaypoint(int wp_index) cur_wp_z = cur->z; cur_wp_pause = cur->pause; cur_wp_heading = cur->heading; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); //fix up pathing Z if(zone->HasMap() && RuleB(Map, FixPathingZAtWaypoints)) @@ -430,7 +430,7 @@ void NPC::SetWaypointPause() void NPC::SaveGuardSpot(bool iClearGuardSpot) { if (iClearGuardSpot) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); guard_x = 0; guard_y = 0; guard_z = 0; @@ -443,14 +443,14 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) { guard_heading = heading; if(guard_heading == 0) guard_heading = 0.0001; //hack to make IsGuarding simpler - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } } void NPC::NextGuardPosition() { if (!CalculateNewPosition2(guard_x, guard_y, guard_z, GetMovespeed())) { SetHeading(guard_heading); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); } else if((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z)) { @@ -516,15 +516,15 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords if(z_pos-z != 0) { z_pos = z; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); return true; } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); return false; } else if ((ABS(x_pos - x) < 0.1) && (ABS(y_pos - y) < 0.1)) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); if(IsNPC()) { entity_list.ProcessMove(CastToNPC(), x, y, z); @@ -550,7 +550,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); uint8 NPCFlyMode = 0; @@ -569,7 +569,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -612,7 +612,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b //pRunAnimSpeed = (int8)(speed*NPC_RUNANIM_RATIO); //speed *= NPC_SPEED_MULTIPLIER; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -647,7 +647,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b z_pos = new_z; tar_ndx=22-numsteps; heading = CalculateHeadingToTarget(x, y); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } else { @@ -659,7 +659,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = y; z_pos = z; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); } } @@ -678,7 +678,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; heading = CalculateHeadingToTarget(x, y); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } uint8 NPCFlyMode = 0; @@ -698,7 +698,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -759,7 +759,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec moved=false; } SetRunAnimSpeed(0); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); return true; } @@ -773,7 +773,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec pRunAnimSpeed = (uint8)(speed*NPC_RUNANIM_RATIO); speed *= NPC_SPEED_MULTIPLIER; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -790,7 +790,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = x; y_pos = y; z_pos = z; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); } else { float new_x = x_pos + tar_vx*tar_vector; @@ -803,7 +803,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = new_x; y_pos = new_y; z_pos = new_z; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); } uint8 NPCFlyMode = 0; @@ -823,7 +823,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -951,7 +951,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { x_pos = new_x; y_pos = new_y; z_pos = new_z; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); if(flymode == FlyMode1) return; @@ -967,7 +967,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -998,7 +998,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 1d83cb10c..50dff0073 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,12 +155,12 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); ZoneConfig::SetZonePort(sci->port); break; } case ServerOP_ZAAuthFailed: { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; @@ -386,12 +386,12 @@ void WorldServer::Process() { } } else { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); } } else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); break; } case ServerOP_EmoteMessage: { @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -748,7 +748,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - Log.DebugCategory(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); + Log.DoLog(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); @@ -1381,7 +1381,7 @@ void WorldServer::Process() { if(NewCorpse) NewCorpse->Spawn(); else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); break; } @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret; @@ -2005,14 +2005,14 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) { ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); switch(rts->Command) { case RELOADTASKS: entity_list.SaveAllClientsTaskState(); if(rts->Parameter == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); safe_delete(taskmanager); taskmanager = new TaskManager; taskmanager->LoadTasks(); @@ -2021,7 +2021,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) entity_list.ReloadAllClientsTaskState(); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); taskmanager->LoadTasks(rts->Parameter); entity_list.ReloadAllClientsTaskState(rts->Parameter); } @@ -2030,23 +2030,23 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) case RELOADTASKPROXIMITIES: if(zone) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); taskmanager->LoadProximities(zone->GetZoneID()); } break; case RELOADTASKGOALLISTS: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); taskmanager->ReloadGoalLists(); break; case RELOADTASKSETS: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); taskmanager->LoadTaskSets(); break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); } @@ -2061,7 +2061,7 @@ uint32 WorldServer::NextGroupID() { if(cur_groupid >= last_groupid) { //this is an error... This means that 50 groups were created before //1 packet could make the zone->world->zone trip... so let it error. - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); return(0); } if(cur_groupid > (last_groupid - /*50*/995)) { diff --git a/zone/zone.cpp b/zone/zone.cpp index c901a65b9..f9276f8df 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -90,7 +90,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); zone->merchantvar = log_levels[1]; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); zone->tradevar = log_levels[2]; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); zone->lootvar = log_levels[3]; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); } else { zone->loglevelvar = uint8(atoi(tmp)); //continue supporting only command logging (for now) @@ -144,8 +144,8 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { delete pack; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); @@ -167,11 +167,11 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Objects from DB..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Objects from DB..."); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { @@ -288,7 +288,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name=0; @@ -402,7 +402,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -474,7 +474,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Merchant Lists..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() { std::map >::iterator cur; uint32 npcid = 0; if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); return; } for (auto row = results.begin(); row != results.end(); ++row) { @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); return; } @@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){ } if(MERC_DEBUG > 0) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); } @@ -707,11 +707,11 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); ZoneLoaded = false; zone->ResetAuth(); @@ -725,19 +725,19 @@ void Zone::Shutdown(bool quite) void Zone::LoadZoneDoors(const char* zone, int16 version) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading doors for %s ...", zone); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading doors for %s ...", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "... No doors loaded."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "... No doors loaded."); return; } Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load doors."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load doors."); delete[] dlist; return; } @@ -801,12 +801,12 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); if(graveyard_id() > 0) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); if(GraveYardLoaded) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); Weather_Timer = new Timer(60000); Weather_Timer->Start(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); zone_weather = 0; weather_intensity = 0; blocked_spells = nullptr; @@ -899,56 +899,56 @@ Zone::~Zone() { bool Zone::Init(bool iStaticZone) { SetStaticZone(iStaticZone); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn groups failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn2 points failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading player corpses failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading player corpses failed."); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading traps failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading traps failed."); return false; } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading adventure flavor text..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading adventure flavor text..."); LoadAdventureFlavor(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading World Objects failed. continuing."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1005,10 +1005,10 @@ bool Zone::Init(bool iStaticZone) { } } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading timezone data..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading timezone data..."); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1019,32 +1019,32 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading Zone Static Data..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading Zone Static Data..."); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading traps failed."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading traps failed."); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1060,7 +1060,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Static Data Reloaded."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Static Data Reloaded."); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault) @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1098,7 +1098,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Successfully loaded Zone Config."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Successfully loaded Zone Config."); return true; } @@ -1403,11 +1403,11 @@ void Zone::ChangeWeather() weathertimer = weatherTimerRule*1000; Weather_Timer->Start(weathertimer); } - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); this->weatherSend(); } } @@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) { quest_manager.ClearAllTimers(); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); initgrids_timer.Start(); @@ -1580,8 +1580,8 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien { if(client) client->CheatDetected(MQZoneUnknownDest, x, y, z); // Someone is trying to use /zone - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); } if(closest_dist > max_distance2) @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load blocked spells."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 8a6393391..0f960d8c2 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -523,14 +523,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } loadti->Code = BazaarTrader_ShowItems; for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -548,13 +548,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -574,7 +574,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { return nullptr; if (results.RowCount() == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); return nullptr; } @@ -587,7 +587,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { const Item_Struct *item = database.GetItem(ItemID); if(!item) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); fflush(stdout); return nullptr; } @@ -597,7 +597,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { ItemInst* inst = database.CreateItem(item); if(!inst) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); fflush(stdout); return nullptr; } @@ -619,25 +619,25 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i", Charges, CharID, SerialNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", SerialNumber, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); const Item_Struct *item = database.GetItem(ItemID); @@ -645,12 +645,12 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg return; if(NewPrice == 0) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 char_id){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); return; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { @@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteBuyLines(uint32 CharID) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); return; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); } @@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons CharID, BuySlot, ItemID, ItemName, Quantity, Price); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity) std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); return true; } @@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u /* Save Home Bind Point */ std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } @@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i uint8 blue = (color & 0x000000FF); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); return true; } bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); return true; } bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); auto results = QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); return true; } @@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); } } return true; @@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } @@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla m_epp->expended_aa ); auto results = database.QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); return true; } @@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru pp->currentEbonCrystals, pp->careerEbonCrystals); auto results = database.QueryDatabase(query); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); return true; } @@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur " VALUES (%u, %u, %u)", character_id, aa_id, current_level); auto results = QueryDatabase(rquery); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2696,7 +2696,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Blocked Spells from database..."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Blocked Spells from database..."); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapCharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 052849943..0c8e8de98 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -44,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { zoning = true; if (app->size != sizeof(ZoneChange_Struct)) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); return; } #if EQDEBUG >= 5 - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); DumpPacket(app); #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -193,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { switch(zone_mode) { case EvacToSafeCoords: case ZoneToSafeCoords: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); dest_x = safe_x; dest_y = safe_y; dest_z = safe_z; @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -347,7 +347,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -534,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z heading = m_pp.binds[0].heading; zonesummon_ignorerestrictions = 1; - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); break; case SummonPC: zonesummon_x = x_pos = x; @@ -543,14 +543,14 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; case Rewind: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); zonesummon_x = x_pos = x; zonesummon_y = y_pos = y; zonesummon_z = z_pos = z; SetHeading(heading); break; default: - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z safe_delete(outapp); } - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); //Clear zonesummon variables if we're zoning to our own zone //Client wont generate a zone change packet to the server in this case so //They aren't needed and it keeps behavior on next zone attempt from being undefined. @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DebugCategory(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //this should not happen... - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); return(false); } if(GetLevel() < minlevel) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); return(false); } if(Admin() < minstatus) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); return(false); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { - Log.DebugCategory(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); + Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); return(false); } } From c025765283fbdd1ff02484afc01de9969de2d553 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:00:15 -0600 Subject: [PATCH 178/707] Renamed DoLog to Out as the aggregate logging function for simplicity of use and shortened syntax of Log.Out --- client_files/export/main.cpp | 30 +-- client_files/import/main.cpp | 28 +- common/crash.cpp | 44 +-- common/database.cpp | 34 +-- common/eq_stream.cpp | 242 ++++++++--------- common/eq_stream_factory.cpp | 8 +- common/eq_stream_ident.cpp | 20 +- common/eqemu_logsys.cpp | 6 +- common/eqemu_logsys.h | 4 +- common/eqtime.cpp | 6 +- common/guild_base.cpp | 132 ++++----- common/item.cpp | 2 +- common/misc_functions.h | 2 +- common/patches/rof.cpp | 34 +-- common/patches/rof2.cpp | 34 +-- common/patches/sod.cpp | 22 +- common/patches/sof.cpp | 22 +- common/patches/ss_define.h | 8 +- common/patches/titanium.cpp | 22 +- common/patches/underfoot.cpp | 22 +- common/ptimer.cpp | 14 +- common/rulesys.cpp | 36 +-- common/shareddb.cpp | 106 ++++---- common/spdat.cpp | 2 +- common/struct_strategy.cpp | 4 +- common/tcp_connection.cpp | 4 +- common/tcp_server.cpp | 4 +- common/timeoutmgr.cpp | 6 +- common/worldconn.cpp | 4 +- eqlaunch/eqlaunch.cpp | 18 +- eqlaunch/worldserver.cpp | 18 +- eqlaunch/zone_launch.cpp | 46 ++-- queryserv/database.cpp | 60 ++--- queryserv/lfguild.cpp | 14 +- queryserv/queryserv.cpp | 16 +- queryserv/worldserver.cpp | 6 +- shared_memory/main.cpp | 34 +-- ucs/chatchannel.cpp | 32 +-- ucs/clientlist.cpp | 78 +++--- ucs/database.cpp | 90 +++---- ucs/ucs.cpp | 26 +- ucs/worldserver.cpp | 8 +- world/adventure.cpp | 4 +- world/adventure_manager.cpp | 6 +- world/client.cpp | 168 ++++++------ world/cliententry.cpp | 2 +- world/clientlist.cpp | 12 +- world/console.cpp | 24 +- world/eql_config.cpp | 22 +- world/eqw.cpp | 2 +- world/eqw_http_handler.cpp | 14 +- world/eqw_parser.cpp | 6 +- world/launcher_link.cpp | 24 +- world/launcher_list.cpp | 10 +- world/login_server.cpp | 32 +-- world/login_server_list.cpp | 2 +- world/net.cpp | 116 ++++---- world/queryserv.cpp | 12 +- world/ucs.cpp | 12 +- world/wguild_mgr.cpp | 26 +- world/worlddb.cpp | 18 +- world/zonelist.cpp | 8 +- world/zoneserver.cpp | 88 +++--- zone/aa.cpp | 46 ++-- zone/aggro.cpp | 22 +- zone/attack.cpp | 174 ++++++------ zone/bonuses.cpp | 6 +- zone/bot.cpp | 114 ++++---- zone/botspellsai.cpp | 4 +- zone/client.cpp | 70 ++--- zone/client_mods.cpp | 12 +- zone/client_packet.cpp | 506 +++++++++++++++++------------------ zone/client_process.cpp | 24 +- zone/command.cpp | 60 ++--- zone/corpse.cpp | 8 +- zone/doors.cpp | 16 +- zone/effects.cpp | 2 +- zone/embparser.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embperl.cpp | 10 +- zone/embxs.cpp | 6 +- zone/entity.cpp | 14 +- zone/exp.cpp | 8 +- zone/fearpath.cpp | 4 +- zone/forage.cpp | 6 +- zone/groups.cpp | 36 +-- zone/guild.cpp | 20 +- zone/guild_mgr.cpp | 48 ++-- zone/horse.cpp | 6 +- zone/inventory.cpp | 154 +++++------ zone/loottables.cpp | 4 +- zone/merc.cpp | 16 +- zone/mob.cpp | 6 +- zone/mob_ai.cpp | 20 +- zone/net.cpp | 108 ++++---- zone/npc.cpp | 20 +- zone/object.cpp | 8 +- zone/pathing.cpp | 146 +++++----- zone/perl_client.cpp | 16 +- zone/petitions.cpp | 10 +- zone/pets.cpp | 16 +- zone/questmgr.cpp | 30 +-- zone/raids.cpp | 22 +- zone/spawn2.cpp | 152 +++++------ zone/spawngroup.cpp | 8 +- zone/special_attacks.cpp | 58 ++-- zone/spell_effects.cpp | 32 +-- zone/spells.cpp | 352 ++++++++++++------------ zone/tasks.cpp | 250 ++++++++--------- zone/titles.cpp | 12 +- zone/tradeskills.cpp | 82 +++--- zone/trading.cpp | 122 ++++----- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 108 ++++---- zone/worldserver.cpp | 42 +-- zone/zone.cpp | 148 +++++----- zone/zonedb.cpp | 124 ++++----- zone/zoning.cpp | 46 ++-- 119 files changed, 2653 insertions(+), 2653 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index feec1f440..2b3aa1e4e 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -38,22 +38,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -66,11 +66,11 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells..."); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); return; } @@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); @@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -140,11 +140,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps..."); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); return; } @@ -169,11 +169,11 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data..."); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); return; } @@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 285398ec8..e94eed0c9 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -36,22 +36,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -76,10 +76,10 @@ int GetSpellColumns(SharedDatabase *db) { } void ImportSpells(SharedDatabase *db) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); return; } @@ -142,23 +142,23 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); } } if(spells_imported % 1000 != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Skill Caps..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Skill Caps..."); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); return; } @@ -190,11 +190,11 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Base Data..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Base Data..."); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); return; } diff --git a/common/crash.cpp b/common/crash.cpp index 8b9b48339..283dba9c5 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -25,7 +25,7 @@ public: } } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, buffer); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, buffer); StackWalker::OnOutput(szText); } }; @@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) switch(ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); break; case EXCEPTION_BREAKPOINT: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); break; case EXCEPTION_DATATYPE_MISALIGNMENT: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); break; case EXCEPTION_FLT_DENORMAL_OPERAND: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); break; case EXCEPTION_FLT_INEXACT_RESULT: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); break; case EXCEPTION_FLT_INVALID_OPERATION: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); break; case EXCEPTION_FLT_OVERFLOW: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); break; case EXCEPTION_FLT_STACK_CHECK: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); break; case EXCEPTION_FLT_UNDERFLOW: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); break; case EXCEPTION_ILLEGAL_INSTRUCTION: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); break; case EXCEPTION_IN_PAGE_ERROR: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); break; case EXCEPTION_INT_OVERFLOW: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); break; case EXCEPTION_INVALID_DISPOSITION: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); break; case EXCEPTION_NONCONTINUABLE_EXCEPTION: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); break; case EXCEPTION_PRIV_INSTRUCTION: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); break; case EXCEPTION_SINGLE_STEP: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); break; case EXCEPTION_STACK_OVERFLOW: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Crash, "Unknown Exception"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "Unknown Exception"); break; } diff --git a/common/database.cpp b/common/database.cpp index af21f2bd1..ff05ea6df 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -84,12 +84,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); return false; } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid = GetCharacterID(pp->name); if(!charid) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id"); return false; } @@ -736,10 +736,10 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); #endif } @@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::AddReport(std::string who, std::string against, std::string lines) { @@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines safe_delete_array(escape_str); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { @@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); return; } @@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); } void Database::ClearAllGroups(void) @@ -3255,14 +3255,14 @@ uint32 Database::GetGroupID(const char* name){ if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); return 0; } if (results.RowCount() == 0) { // Commenting this out until logging levels can prevent this from going to console - //Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Character not in a group: %s", name); + //Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Character not in a group: %s", name); return 0; } @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } @@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 99bff02f1..7d10917f4 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) { OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; @@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { EQRawApplicationPacket *ap=nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; @@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processed < p->size) { subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processedsize) { EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); processed+=subpacket_length+1; } else { subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length); processed+=subpacket_length+3; } @@ -178,29 +178,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Packet: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); delete qp; } @@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // Check for an embedded OP_AppCombinded (protocol level 0x19) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -228,29 +228,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Fragment: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); delete qp; } SetNextAckToSend(seq); @@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (oversize_buffer) { memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2); oversize_offset+=p->size-2; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); if (oversize_offset==oversize_length) { if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); //_raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; } else { EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); if (ap) { ap->copyInfo(p); InboundQueuePush(ap); @@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) oversize_buffer=new unsigned char[oversize_length]; memcpy(oversize_buffer,p->pBuffer+6,p->size-6); oversize_offset=p->size-6; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); } } } @@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_KeepAlive: { #ifndef COLLECTOR NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); #endif } break; case OP_Ack: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionRequest: { if(p->Size() < sizeof(SessionRequest)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); break; } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case // streamactive means we identified the opcode for the stream, we cannot re-establish this connection @@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); SetMaxLen(ntohl(Request->MaxLength)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); SetState(ESTABLISHED); #ifndef COLLECTOR Key=0x11223344; @@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionResponse: { if(p->Size() < sizeof(SessionResponse)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); break; } @@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) compressed=(Response->Format&FLAG_COMPRESSED); encoded=(Response->Format&FLAG_ENCODED); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); // Kinda kludgy, but trie for now if (StreamType==UnknownStream) { @@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) EQStreamState state = GetState(); if(state == ESTABLISHED) { //client initiated disconnect? - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); _SendDisconnect(); SetState(CLOSED); } else if(state == CLOSING) { //we were waiting for this anyways, ignore pending messages, send the reply and be closed. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); _SendDisconnect(); SetState(CLOSED); } else { //we are expecting this (or have already gotten it, but dont care either way) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); SetState(CLOSED); } } @@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_OutOfOrderAck: { if(!p->pBuffer || (p->Size() < 4)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } //if the packet they got out of order is between our last acked packet and the last sent packet, then its valid. if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, seq, SequencedBase, SequencedBase+NextSequencedSend); bool retransmit_acked_packets = false; @@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if(!retransmit_acked_packets) { uint16 sqsize = SequencedQueue.size(); uint16 index = seq - SequencedBase; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); if (index < sqsize) { std::deque::iterator sitr; sitr = SequencedQueue.begin(); @@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) NextSequencedSend = 0; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionStatRequest: { if(p->Size() < sizeof(SessionStats)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); break; } #ifndef COLLECTOR SessionStats *Stats=(SessionStats *)p->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, (unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta), (unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta), (unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta)); @@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX) retransmittimeout = RETRANSMIT_TIMEOUT_MAX; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); } } #endif } break; case OP_SessionStatResponse: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); } break; case OP_OutOfSession: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); } break; default: @@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) return; if(OpMgr == nullptr || *OpMgr == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; } @@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) // Convert the EQApplicationPacket to 1 or more EQProtocolPackets if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); @@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); SequencedPush(out); @@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) out->size=chunksize+2; SequencedPush(out); used+=chunksize; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); } delete p; delete[] tmpbuff; @@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p) #else MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); *(uint16 *)(p->pBuffer)=htons(NextOutSeq); SequencedQueue.push_back(p); NextOutSeq++; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) delete p; #else MOutboundQueue.lock(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); NonSequencedQueue.push(p); MOutboundQueue.unlock(); #endif @@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) void EQStream::SendAck(uint16 seq) { uint16 Seq=htons(seq); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); SetLastAckSent(seq); NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16))); } void EQStream::SendOutOfOrderAck(uint16 seq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); uint16 Seq=htons(seq); NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16))); } @@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd) // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " "buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend); NextSequencedSend = 0; retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet @@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // And remove it form the queue p = NonSequencedQueue.front(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); NonSequencedQueue.pop(); } else if (!p->combine(NonSequencedQueue.front())) { // Tryint to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked, so just remove this packet and it's spot in the queue - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); delete NonSequencedQueue.front(); NonSequencedQueue.pop(); } @@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd) if (sitr!=SequencedQueue.end()) { if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging... if(SequencedQueue.empty()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); SeqEmpty=true; continue; } if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) { if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); sitr++; NextSequencedSend++; } else if (!p) { // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } @@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } else { // No more sequenced packets @@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd) // We have a packet still, must have run out of both seq and non-seq, so send it if (p) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); ReadyToSend.push(p); BytesWritten+=p->size; } @@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd) if(SeqEmpty && NonSeqEmpty) { //no more data to send if(CheckState(CLOSING)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); //we are waiting for the queues to empty, now we can do our disconnect. //this packet will not actually go out until the next call to Write(). _SendDisconnect(); @@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses out->size=sizeof(SessionResponse); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no"); NonSequencedPush(out); @@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); NonSequencedPush(out); } @@ -932,7 +932,7 @@ void EQStream::_SendDisconnect() *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); } void EQStream::InboundQueuePush(EQRawApplicationPacket *p) @@ -959,7 +959,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if (emu_op == OP_Unknown) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -986,7 +986,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if(emu_op == OP_Unknown) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -1014,7 +1014,7 @@ void EQStream::InboundQueueClear() { EQApplicationPacket *p=nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); MInboundQueue.lock(); if (!InboundQueue.empty()) { @@ -1057,7 +1057,7 @@ void EQStream::OutboundQueueClear() { EQProtocolPacket *p=nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); MOutboundQueue.lock(); while(!NonSequencedQueue.empty()) { @@ -1079,7 +1079,7 @@ void EQStream::PacketQueueClear() { EQProtocolPacket *p=nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); if(!PacketQueue.empty()) { std::map::iterator itr; @@ -1111,7 +1111,7 @@ uint32 newlength=0; delete p; ProcessQueue(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); _hex(NET__NET_CREATE_HEX, buffer, length); } } @@ -1141,33 +1141,33 @@ std::deque::iterator itr, tmp; MOutboundQueue.lock(); //do a bit of sanity checking. if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } SeqOrder ord = CompareSequence(SequencedBase, seq); if(ord == SeqInOrder) { //they are not acking anything new... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); } else if(ord == SeqPast) { //they are nacking blocks going back before our buffer, wtf? - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); //this is a good ack, we get to ack some blocks. seq++; //we stop at the block right after their ack, counting on the wrap of both numbers. while(SequencedBase != seq) { if(SequencedQueue.empty()) { -Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); +Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); SequencedBase = NextOutSeq; NextSequencedSend = 0; break; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); //clean out the acked packet delete SequencedQueue.front(); SequencedQueue.pop_front(); @@ -1178,10 +1178,10 @@ Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked pa SequencedBase++; } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } @@ -1191,7 +1191,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::SetNextAckToSend(uint32 seq) { MAcks.lock(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); NextAckToSend=seq; MAcks.unlock(); } @@ -1199,7 +1199,7 @@ void EQStream::SetNextAckToSend(uint32 seq) void EQStream::SetLastAckSent(uint32 seq) { MAcks.lock(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); LastAckSent=seq; MAcks.unlock(); } @@ -1212,10 +1212,10 @@ void EQStream::ProcessQueue() EQProtocolPacket *qp=nullptr; while((qp=RemoveQueue(NextInSeq))!=nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } } @@ -1226,21 +1226,21 @@ EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } return qp; } void EQStream::SetStreamType(EQStreamType type) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); StreamType=type; switch (StreamType) { case LoginStream: app_opcode_size=1; compressed=false; encoded=false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); break; case ChatOrMailStream: case ChatStream: @@ -1248,7 +1248,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=1; compressed=false; encoded=true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); break; case ZoneStream: case WorldStream: @@ -1256,7 +1256,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=2; compressed=true; encoded=false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); break; } } @@ -1306,7 +1306,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq) void EQStream::SetState(EQStreamState state) { MState.lock(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); State=state; MState.unlock(); } @@ -1318,29 +1318,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { EQStreamState orig_state = GetState(); if (orig_state == CLOSING && !outgoing_data) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); _SendDisconnect(); SetState(DISCONNECTING); } else if (LastPacket && (now-LastPacket) > timeout) { switch(orig_state) { case CLOSING: //if we time out in the closing state, they are not acking us, just give up - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); _SendDisconnect(); SetState(CLOSED); break; case DISCONNECTING: //we timed out waiting for them to send us the disconnect reply, just give up. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); SetState(CLOSED); break; case CLOSED: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); break; case ESTABLISHED: //we timed out during normal operation. Try to be nice about it. //we will almost certainly time out again waiting for the disconnect reply, but oh well. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); _SendDisconnect(); SetState(DISCONNECTING); break; @@ -1369,11 +1369,11 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, AVERAGE_DELTA_MAX); } } else { @@ -1381,7 +1381,7 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } @@ -1391,12 +1391,12 @@ void EQStream::AdjustRates(uint32 average_delta) void EQStream::Close() { if(HasOutgoingData()) { //there is pending data, wait for it to go out. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); SetState(CLOSING); } else { //otherwise, we are done, we can drop immediately. _SendDisconnect(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); SetState(DISCONNECTING); } } @@ -1424,19 +1424,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. if(p->size == sig->first_length) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else if(sig->first_length == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else { //opcode matched but length did not. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); res = MatchFailed; } } else { //first opcode did not match.. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); res = MatchFailed; } } diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index ce09e380e..114b61c68 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif fs->ReaderLoop(); #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); @@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif fs->WriterLoop(); #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index adba3dddf..9ec7f2c92 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -46,7 +46,7 @@ void EQStreamIdentifier::Process() { //first see if this stream has expired if(r->expire.Check(false)) { //this stream has failed to match any pattern in our timeframe. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); delete r; cur = m_streams.erase(cur); @@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() { } if(r->stream->GetState() != ESTABLISHED) { //the stream closed before it was identified. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); switch(r->stream->GetState()) { case ESTABLISHED: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); break; case CLOSING: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); break; case DISCONNECTING: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); break; case CLOSED: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); break; } r->stream->ReleaseFromUse(); @@ -109,7 +109,7 @@ void EQStreamIdentifier::Process() { case EQStream::MatchSuccessful: { //yay, a match. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further r->stream->SetActive(true); @@ -123,7 +123,7 @@ void EQStreamIdentifier::Process() { } case EQStream::MatchFailed: //do nothing... - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); break; } } @@ -131,7 +131,7 @@ void EQStreamIdentifier::Process() { //if we checked all patches and did not find a match. if(all_ready && !found_one) { //the stream cannot be identified. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index c2559a233..e61ea8a1b 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -91,7 +91,7 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings_loaded = true; } -std::string EQEmuLogSys::FormatDoLogMessageString(uint16 log_category, std::string in_message){ +std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string in_message){ std::string category_string = ""; if (log_category > 0 && LogCategoryName[log_category]){ category_string = StringFormat("[%s] ", LogCategoryName[log_category]); @@ -162,14 +162,14 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m #endif } -void EQEmuLogSys::DoLog(DebugLevel debug_level, uint16 log_category, std::string message, ...) +void EQEmuLogSys::Out(DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; va_start(args, message); std::string output_message = vStringFormat(message.c_str(), args); va_end(args); - std::string output_debug_message = EQEmuLogSys::FormatDoLogMessageString(log_category, output_message); + std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, output_message); EQEmuLogSys::ProcessConsoleMessage(log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 23e737720..3370e704f 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -82,7 +82,7 @@ public: void CloseFileLogs(); void LoadLogSettingsDefaults(); - void DoLog(DebugLevel debug_level, uint16 log_category, std::string message, ...); + void Out(DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); @@ -103,7 +103,7 @@ private: bool zone_general_init = false; std::function on_log_gmsay_hook; - std::string FormatDoLogMessageString(uint16 log_category, std::string in_message); + std::string FormatOutMessageString(uint16 log_category, std::string in_message); void ProcessConsoleMessage(uint16 log_category, const std::string message); void ProcessGMSay(uint16 log_category, std::string message); diff --git a/common/eqtime.cpp b/common/eqtime.cpp index 6d6ab3fb8..a047029df 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename) of.open(filename); if(!of) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); return false; } //Enable for debugging @@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename) in.open(filename); if(!in) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename); return false; } in >> version; in.ignore(80, '\n'); if(version != EQT_VERSION) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); return false; } //in >> eqTime.start_eqtime.day; diff --git a/common/guild_base.cpp b/common/guild_base.cpp index acb275e55..fb742d487 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); return(false); } @@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); continue; } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); return false; } @@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } @@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); return true; } @@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); return(false); } GuildInfo *info = res->second; @@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; @@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); @@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } safe_delete_array(title_esc); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); return true; } uint32 BaseGuildManager::_GetFreeGuildID() { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -337,18 +337,18 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); return index; } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); return GUILD_NONE; } @@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) { //now store the resulting guild setup into the DB. if(!_StoreGuildDB(new_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); return(GUILD_NONE); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); return(new_id); } @@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id); QueryWithLogging(query, "deleting guild bank"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); return(true); } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); return false; } @@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); safe_delete_array(esc); return false; } safe_delete_array(esc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); info->name = name; //update our local record. @@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); return false; } @@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(!DBSetGuildRank(leader, GUILD_LEADER)) return false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); info->leader_char_id = leader; //update our local record. @@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; @@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c safe_delete_array(esc); safe_delete_array(esc_set); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); info->motd = motd; //update our local record. info->motd_setter = setter; //update our local record. @@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); info->url = URL; //update our local record. @@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); info->channel = Channel; //update our local record. @@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); return true; } @@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); return true; } @@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } @@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); return true; @@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { if(m_db == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); return false; } @@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); return true; @@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const { bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const { if(guild_id == GUILD_NONE) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); return(false); //invalid guild } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); return(char_id == res->second->leader_char_id); } @@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { if(status >= 250) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); return(true); //250+ as allowed anything } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); return(false); //invalid guild } bool granted = (res->second->minstatus <= status); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied"); return(granted); @@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const { if(rank > GUILD_MAX_RANK) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid rank } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid guild } bool granted = res->second->ranks[rank].permissions[act]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", res->second->name.c_str(), guild_id, res->second->ranks[rank].name.c_str(), rank, GuildActionNames[act], act, @@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/common/item.cpp b/common/item.cpp index 60ddab14c..42885fe5a 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } if (result == INVALID_INDEX) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/common/misc_functions.h b/common/misc_functions.h index 53ede739a..2fd5b2126 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index bf0ec395b..a56e9a82d 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -52,7 +52,7 @@ namespace RoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -316,7 +316,7 @@ namespace RoF if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -551,7 +551,7 @@ namespace RoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -585,7 +585,7 @@ namespace RoF safe_delete_array(Serialized); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1386,7 +1386,7 @@ namespace RoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2556,7 +2556,7 @@ namespace RoF outapp->WriteUInt8(0); // Unknown - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3321,7 +3321,7 @@ namespace RoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3654,7 +3654,7 @@ namespace RoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3902,7 +3902,7 @@ namespace RoF Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); @@ -4498,7 +4498,7 @@ namespace RoF SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5455,7 +5455,7 @@ namespace RoF RoFSlot.MainSlot = TempSlot; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5496,7 +5496,7 @@ namespace RoF RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5601,7 +5601,7 @@ namespace RoF ServerSlot = INVALID_INDEX; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -5636,7 +5636,7 @@ namespace RoF ServerSlot = TempSlot; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 4ed34e193..4fba21144 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -52,7 +52,7 @@ namespace RoF2 //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF2 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF2 opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -382,7 +382,7 @@ namespace RoF2 if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -617,7 +617,7 @@ namespace RoF2 if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -651,7 +651,7 @@ namespace RoF2 safe_delete_array(Serialized); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1452,7 +1452,7 @@ namespace RoF2 char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType); if (!serialized) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2640,7 +2640,7 @@ namespace RoF2 // Think we need 1 byte of padding at the end outapp->WriteUInt8(0); // Unknown - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3387,7 +3387,7 @@ namespace RoF2 if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3721,7 +3721,7 @@ namespace RoF2 //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3973,7 +3973,7 @@ namespace RoF2 Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); @@ -4569,7 +4569,7 @@ namespace RoF2 SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -5546,7 +5546,7 @@ namespace RoF2 RoF2Slot.MainSlot = TempSlot; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5587,7 +5587,7 @@ namespace RoF2 RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5696,7 +5696,7 @@ namespace RoF2 ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } @@ -5731,7 +5731,7 @@ namespace RoF2 ServerSlot = TempSlot; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 750cac18b..4881750d1 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -50,7 +50,7 @@ namespace SoD //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoD - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoD opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -247,7 +247,7 @@ namespace SoD if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -359,7 +359,7 @@ namespace SoD if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -391,7 +391,7 @@ namespace SoD } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -967,7 +967,7 @@ namespace SoD char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2108,7 +2108,7 @@ namespace SoD if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2363,7 +2363,7 @@ namespace SoD //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3091,7 +3091,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 4b215813e..464c40cb3 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -50,7 +50,7 @@ namespace SoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoF - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -214,7 +214,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -337,7 +337,7 @@ namespace SoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -371,7 +371,7 @@ namespace SoF } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -766,7 +766,7 @@ namespace SoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1707,7 +1707,7 @@ namespace SoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1887,7 +1887,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -2429,7 +2429,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index f96720713..308e56191 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index c46cba392..11adc498d 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -48,7 +48,7 @@ namespace Titanium //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -74,7 +74,7 @@ namespace Titanium - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -89,10 +89,10 @@ namespace Titanium opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -187,7 +187,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -268,7 +268,7 @@ namespace Titanium int itemcount = in->size / sizeof(InternalSerializedItem_Struct); if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; return; } @@ -285,7 +285,7 @@ namespace Titanium safe_delete_array(serialized); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -635,7 +635,7 @@ namespace Titanium char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1157,7 +1157,7 @@ namespace Titanium if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1274,7 +1274,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -1623,7 +1623,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index faa19af67..2d8feba20 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -50,7 +50,7 @@ namespace Underfoot //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace Underfoot - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace Underfoot opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -307,7 +307,7 @@ namespace Underfoot if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -494,7 +494,7 @@ namespace Underfoot if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -526,7 +526,7 @@ namespace Underfoot safe_delete_array(Serialized); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -1190,7 +1190,7 @@ namespace Underfoot char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2374,7 +2374,7 @@ namespace Underfoot if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2624,7 +2624,7 @@ namespace Underfoot //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -3406,7 +3406,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = UnderfootToServerSlot(eq->from_slot); emu->to_slot = UnderfootToServerSlot(eq->to_slot); diff --git a/common/ptimer.cpp b/common/ptimer.cpp index c9fe7f4f6..d5b31e317 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { if (this == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); return(true); } uint32 current_time = get_current_time(); @@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); #endif return false; } diff --git a/common/rulesys.cpp b/common/rulesys.cpp index ef8e0fa4d..e3eac0611 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); return(false); } } @@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas switch(type) { case IntRule: m_RuleIntValues [index] = atoi(rule_value); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); break; case RealRule: m_RuleRealValues[index] = atof(rule_value); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); break; case BoolRule: uint32 val = 0; if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1")) val = 1; m_RuleBoolValues[index] = val; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); break; } @@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas } void RuleManager::ResetRules() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); #define RULE_INT(cat, rule, default_value) \ m_RuleIntValues[ Int__##rule ] = default_value; #define RULE_REAL(cat, rule, default_value) \ @@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & return(true); } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); return(false); } @@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) { m_activeRuleset = _FindOrCreateRuleset(db, ruleset); if(m_activeRuleset == -1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); return; } m_activeName = ruleset; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } int r; @@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { int rsid = GetRulesetID(db, ruleset); if(rsid < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); return(false); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); m_activeRuleset = rsid; m_activeName = ruleset; @@ -282,13 +282,13 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } for(auto row = results.begin(); row != results.end(); ++row) if(!SetRule(row[0], row[1], nullptr, false)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); return true; } @@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } @@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 924e4cfe5..64b94657c 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } @@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); return false; } @@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: %s %i has an invalid item_id %i in inventory slot %i", ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); continue; @@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (put_slot_id != INVALID_INDEX) continue; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", ((is_charid==true)? "charid": "acctid"), id, item_id, slot_id); if (is_charid) @@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); continue; } @@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { else if (slot_id >= 3111 && slot_id <= 3179) { // Admins: please report any occurrences of this error - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); put_slot_id = inv->PushCursor(*inst); } else @@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); } } @@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); } @@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() { items_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(items_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); return false; } @@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ try { hash.insert(item.ID, item); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); break; } } @@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile) } if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile); txtout.assign(" ",1); return txtout; } @@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() { faction_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(faction_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); return false; } @@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) inst = new ItemInst(item, charges); if (inst == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() { mutex.Unlock(); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); return false; } @@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) { const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); return; } @@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } @@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() { mutex.Unlock(); } catch(std::exception& ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); return false; } @@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { cl = atoi(row[1]); if(lvl <= 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); continue; } if(lvl >= max_level) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); continue; } if(cl <= 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); continue; } if(cl > 16) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); continue; } @@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; @@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() { loot_drop_mmf->Size()); mutex.Unlock(); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); return false; } @@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { return &loot_table_hash->at(loottable_id); } } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); } return nullptr; } @@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { return &loot_drop_hash->at(lootdrop_id); } } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); } return nullptr; } diff --git a/common/spdat.cpp b/common/spdat.cpp index a628c8fa7..a6b17e449 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -839,7 +839,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index eb8244d04..6e1eb038a 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -39,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo EQApplicationPacket *p = *in_p; *in_p = nullptr; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); delete p; } void StructStrategy::ErrorDecoder(EQApplicationPacket *p) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); p->SetOpcode(OP_Unknown); } diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 9bf1de258..924fef2f2 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index 8fdf64dd7..b85e78ae5 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); #endif tcps->MLoopRunning.lock(); @@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index 92bf6e32e..3bd4c9942 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() { Timeoutable *it = *cur; if(it->next_check.Check()) { #ifdef TIMEOUT_DEBUG - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Checking timeout on 0x%x\n", it); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Checking timeout on 0x%x\n", it); #endif it->CheckTimeout(); } @@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) { DeleteMember(who); //just in case... prolly not needed. members.push_back(who); #ifdef TIMEOUT_DEBUG - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Adding timeoutable 0x%x\n", who); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Adding timeoutable 0x%x\n", who); #endif } void TimeoutManager::DeleteMember(Timeoutable *who) { #ifdef TIMEOUT_DEBUG - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None,, "Removing timeoutable 0x%x\n", who); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Removing timeoutable 0x%x\n", who); #endif std::vector::iterator cur,end; cur = members.begin(); diff --git a/common/worldconn.cpp b/common/worldconn.cpp index 1947ec0e8..33fc2f7d3 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) { void WorldConnection::OnConnected() { const EQEmuConfig *Config=EQEmuConfig::get(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16); MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); @@ -76,7 +76,7 @@ bool WorldConnection::Connect() { if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { return true; } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); } return false; } diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 47ccbf6a9..4c2f3fdd9 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -47,13 +47,13 @@ int main(int argc, char *argv[]) { launcher_name = argv[1]; } if(launcher_name.length() < 1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); return 1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); if (!EQEmuConfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); return 1; } const EQEmuConfig *Config = EQEmuConfig::get(); @@ -62,16 +62,16 @@ int main(int argc, char *argv[]) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::map zones; WorldServer world(zones, launcher_name.c_str(), Config); if (!world.Connect()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); } std::map::iterator zone, zend; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); // zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1"); @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { void CatchSignal(int sig_num) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); RunLoops = false; } diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index a63ac1022..799cbd4ee 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -74,14 +74,14 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; } case ServerOP_LauncherZoneRequest: { if(pack->size != sizeof(LauncherZoneRequest)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); break; } const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer; @@ -90,9 +90,9 @@ void WorldServer::Process() { switch(ZoneRequestCommands(lzr->command)) { case ZR_Start: { if(m_zones.find(lzr->short_name) != m_zones.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config); m_zones[lzr->short_name] = l; } @@ -101,9 +101,9 @@ void WorldServer::Process() { case ZR_Restart: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); res->second->Restart(); } break; @@ -111,9 +111,9 @@ void WorldServer::Process() { case ZR_Stop: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); res->second->Stop(); } break; @@ -127,7 +127,7 @@ void WorldServer::Process() { } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); break; } } diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index 2e40a94d1..d9e92b8cd 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -72,7 +72,7 @@ void ZoneLaunch::Start() { //spec is consumed, even on failure m_ref = ProcLauncher::get()->Launch(spec); if(m_ref == ProcLauncher::ProcError) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); m_timer.Start(m_config->RestartWait); return; } @@ -84,17 +84,17 @@ void ZoneLaunch::Start() { SendStatus(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); } void ZoneLaunch::Restart() { switch(m_state) { case StateRestartPending: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); break; case StateStartPending: //we havent started yet, do nothing - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); break; case StateStarted: //process is running along, kill it off.. @@ -102,20 +102,20 @@ void ZoneLaunch::Restart() { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, true)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateRestartPending; break; case StateStopPending: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); break; case StateStopped: //process is already stopped... nothing to do.. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -124,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) { switch(m_state) { case StateStartPending: //we havent started yet, transition directly to stopped. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); m_state = StateStopped; break; case StateStarted: @@ -134,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, graceful)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateStopPending; break; case StateStopped: //process is already stopped... nothing to do.. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -164,17 +164,17 @@ bool ZoneLaunch::Process() { m_timer.Disable(); //actually start up the program - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); Start(); //now update the shared timer to reflect the proper start interval. if(s_running == 1) { //we are the first zone started. wait that interval. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); s_startTimer.Start(m_config->InitialBootWait); } else { //just some follow on zone, use that interval. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); s_startTimer.Start(m_config->ZoneBootInterval); } @@ -187,7 +187,7 @@ bool ZoneLaunch::Process() { //waiting for notification that our child has died.. if(m_timer.Check()) { //we have timed out, try to kill the child again - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Restart(); } break; @@ -197,12 +197,12 @@ bool ZoneLaunch::Process() { //we have timed out, try to kill the child again m_killFails++; if(m_killFails > 5) { //should get this number from somewhere.. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); m_state = StateStopped; s_running--; SendStatus(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Stop(false); } } @@ -221,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche switch(m_state) { case StateStartPending: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateStarted: //something happened to our happy process... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateRestartPending: //it finally died, start it on up again - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); m_state = StateStartPending; break; case StateStopPending: //it finally died, transition to close. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); m_state = StateStopped; break; case StateStopped: //we already thought it was stopped... dont care... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); break; } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 292fb7bf2..5041eb410 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -69,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, safe_delete_array(escapedMessage); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } @@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->char2_money.silver, QS->char2_money.copper, QS->char2_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->npc_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(members == 0) @@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ lastIndex, QS->Chars[i].char_id); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->char_id, QS->stack_size, QS->char_count, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->char_count, QS->postaction); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->char_money.copper, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } } @@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { std::string query(queryBuffer); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); } safe_delete(pack); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index e2ef1dd6c..e802f493f 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -40,7 +40,7 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -242,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -257,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -288,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -305,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -335,7 +335,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } @@ -348,7 +348,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 76dfc7b5a..79003a2bd 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -65,16 +65,16 @@ int main() { */ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!database.Connect( @@ -83,22 +83,22 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } /* Initialize Logging */ if (!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); return 1; } diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index f4aca7f06..1e6013696 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -53,7 +53,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -66,7 +66,7 @@ void WorldServer::Process() ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { case 0: { break; @@ -148,7 +148,7 @@ void WorldServer::Process() break; } default: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); break; } break; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 38c4640b5..8fbd296e7 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -40,22 +40,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -114,61 +114,61 @@ int main(int argc, char **argv) { } if(load_all || load_items) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading items..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading items..."); try { LoadItems(&database); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_factions) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading factions..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading factions..."); try { LoadFactions(&database); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_loot) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading loot..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading loot..."); try { LoadLoot(&database); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_skill_caps) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading skill caps..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading skill caps..."); try { LoadSkillCaps(&database); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_spells) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spells..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spells..."); try { LoadSpells(&database); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } if(load_all || load_bd) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading base data..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading base data..."); try { LoadBaseData(&database); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); return 1; } } diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index c1d797f26..0ee80510f 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -42,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -149,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) { void ChatChannelList::RemoveChannel(ChatChannel *Channel) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); LinkedListIterator iterator(ChatChannels); @@ -170,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) { void ChatChannelList::RemoveAllChannels() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); LinkedListIterator iterator(ChatChannels); @@ -228,7 +228,7 @@ void ChatChannel::AddClient(Client *c) { if(IsClientInChannel(c)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); return; } @@ -237,7 +237,7 @@ void ChatChannel::AddClient(Client *c) { int AccountStatus = c->GetAccountStatus(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); LinkedListIterator iterator(ClientsInChannel); @@ -262,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) { if(!c) return false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); bool HideMe = c->GetHideMe(); @@ -299,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) { if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0)) return false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000); } @@ -397,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); ChannelClient->SendChannelMessage(Name, Message, Sender); } @@ -479,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client return nullptr; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); ChatChannel *RequiredChannel = FindChannel(NormalisedName); @@ -555,7 +555,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); @@ -572,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) { Invitees.push_back(Invitee); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); } } @@ -587,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) { Invitees.erase(Iterator); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); return; } @@ -613,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) { Moderators.push_back(Moderator); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); } } @@ -628,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) { Moderators.erase(Iterator); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); return; } @@ -654,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) { Voiced.push_back(inVoiced); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); } } @@ -669,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) { Voiced.erase(Iterator); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); return; } diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 0ad2b6157..4aaa4c748 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -236,7 +236,7 @@ std::vector ParseRecipients(std::string RecipientString) { static void ProcessMailTo(Client *c, std::string MailMessage) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); std::vector Recipients; @@ -305,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -400,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) { static void ProcessCommandBuddy(Client *c, std::string Buddy) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); c->GeneralChannelMessage("Buddy list modified"); uint8 SubAction = 1; @@ -430,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { static void ProcessCommandIgnore(Client *c, std::string Ignoree) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); c->GeneralChannelMessage("Ignore list modified"); uint8 SubAction = 0; @@ -481,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) { exit(1); if (chatsf->Open()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); exit(1); } @@ -560,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) { if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName()) && (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); struct in_addr in; in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -586,7 +586,7 @@ void Clientlist::Process() { in.s_addr = eqs->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); eqs->SetOpcodeManager(&ChatOpMgr); @@ -606,7 +606,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -646,7 +646,7 @@ void Clientlist::Process() { if(strlen(PacketBuffer) != 9) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -667,11 +667,11 @@ void Clientlist::Process() { else CharacterName = MailBoxString.substr(LastPeriod + 1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; @@ -703,7 +703,7 @@ void Clientlist::Process() { default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); break; } } @@ -716,7 +716,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()), KeyValid, (*Iterator)->GetForceDisconnect()); @@ -860,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) break; case CommandSetMessageStatus: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); ProcessSetMessageStatus(Parameters); break; @@ -885,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) default: c->SendHelp(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); } } @@ -896,7 +896,7 @@ void Clientlist::CloseAllConnections() { for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); (*Iterator)->CloseConnection(); } @@ -905,7 +905,7 @@ void Clientlist::CloseAllConnections() { void Client::AddCharacter(int CharID, const char *CharacterName, int Level) { if(!CharacterName) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); CharacterEntry NewCharacter; NewCharacter.CharID = CharID; NewCharacter.Name = CharacterName; @@ -971,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { for(int i = 0; i < MAX_JOINED_CHANNELS; i++) if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; } } @@ -1012,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) { } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); int NumberOfChannels = ChannelCount(); @@ -1113,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) { void Client::LeaveChannels(std::string ChannelNameList) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); std::string::size_type CurrentPos = 0; @@ -1292,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message) std::string ChannelName = Message.substr(1, MessageStart-1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1435,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if(RuleB(Chat, EnableAntiSpam)) @@ -1647,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) { else Message = "Password change on channel " + ChannelName; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1702,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1790,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Invitee); @@ -1918,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Moderator); @@ -1999,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Voicee); @@ -2087,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Kickee); @@ -2196,32 +2196,32 @@ void Client::SetConnectionType(char c) { case 'S': { TypeOfConnection = ConnectionTypeCombined; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); break; } case 'U': { TypeOfConnection = ConnectionTypeCombined; UnderfootOrLater = true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); break; } case 'M': { TypeOfConnection = ConnectionTypeMail; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); break; } case 'C': { TypeOfConnection = ConnectionTypeChat; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); break; } default: { TypeOfConnection = ConnectionTypeUnknown; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); } } } @@ -2299,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin void Client::ChangeMailBox(int NewMailBox) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); SetMailBox(NewMailBox); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); auto outapp = new EQApplicationPacket(OP_MailboxChange, 2); @@ -2377,13 +2377,13 @@ std::string Client::MailBoxName() { if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return ""; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index 0c1bdee65..ee09dc7c2 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -74,14 +74,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) { client->GetAccountID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); if(results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); return; } @@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) { client->SetKarma(atoi(row[2])); client->SetRevoked((atoi(row[3])==1?true:false)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); } int Database::FindAccount(const char *characterName, Client *client) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); client->ClearCharacters(); @@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) { characterName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); return -1; } if (results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); return -1; } @@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) { int accountID = atoi(row[1]); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` " "WHERE `account_id` = %i AND `name` != '%s'", @@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri characterName.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); return false; } @@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri else sprintf(combinedKey, "%s", MailKey.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); return !strcmp(row[0], combinedKey); } @@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } safe_delete(safeCharName); if (results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); return -1; } @@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ bool Database::LoadChatChannels() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -267,25 +267,25 @@ bool Database::LoadChatChannels() { void Database::SetChannelPassword(std::string channelName, std::string password) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::SetChannelOwner(std::string channelName, std::string owner) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) { int unknownField3 = 1; int characterID = FindCharacter(client->MailBoxName().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) { int characterID = FindCharacter(client->MailBoxName().c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) { auto row = results.begin(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]); @@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub characterID = FindCharacter(characterName.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); if(characterID <= 0) return false; @@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); Client *client = CL->IsCharacterOnline(characterName); @@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub void Database::SetMessageStatus(int messageNumber, int status) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); if(status == 0) { std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber); @@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::ExpireMail() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } auto row = results.begin(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { @@ -524,9 +524,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); if(results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -536,9 +536,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); if(results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread @@ -547,9 +547,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); if(results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } @@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); } @@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends if(atoi(row[0]) == 0) { ignorees.push_back(name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); continue; } friends.push_back(name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); } } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 22f285f25..c51d1e0dd 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -78,11 +78,11 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); return 1; } @@ -90,13 +90,13 @@ int main() { Config = ucsconfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); WorldShortName = Config->ShortName; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -104,22 +104,22 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -127,7 +127,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -138,11 +138,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); return 1; } diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index dc327cb48..2d05d753d 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -52,7 +52,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -67,7 +67,7 @@ void WorldServer::Process() while((pack = tcpc.PopPacket())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { @@ -88,7 +88,7 @@ void WorldServer::Process() std::string Message = Buffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); Client *c = CL->FindCharacter(From); @@ -99,7 +99,7 @@ void WorldServer::Process() if(!c) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); break; } diff --git a/world/adventure.cpp b/world/adventure.cpp index 14a7a141b..fa41e3c09 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); @@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 3fbcf96bb..9c65620bf 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/world/client.cpp b/world/client.cpp index 268c0153c..2b3b8dde2 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -136,7 +136,7 @@ void Client::SendEnterWorld(std::string name) eqs->Close(); return; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); } } @@ -378,7 +378,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if (strlen(password) <= 1) { // TODO: Find out how to tell the client wrong username/password - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); return false; } @@ -408,31 +408,31 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password))) #else if (loginserverlist.Connected() == false && !pZoning) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); return false; } if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password)))) #endif { if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); if(!minilogin) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); return false; } cle->SetOnline(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); if(minilogin){ WorldConfig::DisableStats(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); } const WorldConfig *Config=WorldConfig::get(); @@ -465,7 +465,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { } else { // TODO: Find out how to tell the client wrong username/password - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); return false; } @@ -479,7 +479,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); return false; } @@ -487,7 +487,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) uchar race = app->pBuffer[64]; uchar clas = app->pBuffer[68]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); EQApplicationPacket *outapp; outapp = new EQApplicationPacket; @@ -648,11 +648,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app) bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); return false; } else if (app->size != sizeof(CharCreate_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); DumpPacket(app); // the previous behavior was essentially returning true here // but that seems a bit odd to me. @@ -679,14 +679,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); eqs->Close(); return true; } if(GetAdmin() < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); eqs->Close(); return true; } @@ -702,14 +702,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { uint32 tmpaccid = 0; charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID); if (charid == 0 || tmpaccid != GetAccountID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); eqs->Close(); return true; } // Make sure this account owns this character if (tmpaccid != GetAccountID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); eqs->Close(); return true; } @@ -737,7 +737,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { zoneID = database.MoveCharacterToBind(charid,4); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able."); eqs->Close(); return true; @@ -770,7 +770,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character."); eqs->Close(); return true; @@ -780,7 +780,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (zoneID == 0 || !database.GetZoneName(zoneID)) { // This is to save people in an invalid zone, once it's removed from the DB database.MoveCharacterToZone(charid, "arena"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); } if(instanceID > 0) @@ -894,7 +894,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) { uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer); if(char_acct_id == GetAccountID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); database.DeleteCharacter((char *)app->pBuffer); SendCharInfo(); } @@ -915,25 +915,25 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { EmuOpcode opcode = app->GetOpcode(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); _pkt(WORLD__CLIENT_TRACE,app); if (!eqs->CheckState(ESTABLISHED)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); return false; } // Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) { if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); eqs->Close(); } } if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) { // Got a packet other than OP_SendLoginInfo when not logged in - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); return false; } else if (opcode == OP_AckPacket) { @@ -1005,7 +1005,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); _pkt(WORLD__CLIENT_ERR,app); return true; } @@ -1024,7 +1024,7 @@ bool Client::Process() { to.sin_addr.s_addr = ip; if (autobootup_timeout.Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); ZoneUnavail(); } if(connect.Check()){ @@ -1058,7 +1058,7 @@ bool Client::Process() { loginserverlist.SendPacket(pack); safe_delete(pack); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); return false; } @@ -1107,17 +1107,17 @@ void Client::EnterWorld(bool TryBootup) { } else { if (TryBootup) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); autobootup_timeout.Start(); pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID); if (pwaitingforbootup == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); ZoneUnavail(); } return; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); ZoneUnavail(); return; } @@ -1126,12 +1126,12 @@ void Client::EnterWorld(bool TryBootup) { cle->SetChar(charid, char_name); database.UpdateLiveChar(char_name, GetAccountID()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); // database.SetAuthentication(account_id, char_name, zone_name, ip); if (seencharsel) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); ZoneUnavail(); return; } @@ -1169,9 +1169,9 @@ void Client::Clearance(int8 response) { if (zs == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); } ZoneUnavail(); @@ -1181,20 +1181,20 @@ void Client::Clearance(int8 response) EQApplicationPacket* outapp; if (zs->GetCAddress() == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); ZoneUnavail(); return; } if (zoneID == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } const char* zonename = database.GetZoneName(zoneID); if (zonename == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } @@ -1225,7 +1225,7 @@ void Client::Clearance(int8 response) } strcpy(zsi->ip, zs_addr); zsi->port =zs->GetCPort(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); QueuePacket(outapp); safe_delete(outapp); @@ -1256,7 +1256,7 @@ bool Client::GenPassKey(char* key) { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); _pkt(WORLD__CLIENT_TRACE, app); ack_req = true; // It's broke right now, dont delete this line till fix it. =P @@ -1355,27 +1355,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA, stats_sum); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); /* Validate the char creation struct */ if (ClientVersionBit & BIT_SoFAndLater) { if (!CheckCharCreateInfoSoF(cc)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } else { if (!CheckCharCreateInfoTitanium(cc)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } @@ -1437,21 +1437,21 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) /* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */ if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); pp.zone_id = RuleI(World, SoFStartZoneID); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); } else { /* if there's a startzone variable put them in there */ if (database.GetVariable("startzone", startzone, 50)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); pp.zone_id = database.GetZoneID(startzone); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); } else { /* otherwise use normal starting zone logic */ bool ValidStartZone = false; if (ClientVersionBit & BIT_TitaniumAndEarlier) @@ -1490,11 +1490,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) pp.binds[0].z = pp.z; pp.binds[0].heading = pp.heading; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z); /* Starting Items inventory */ @@ -1503,10 +1503,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) // now we give the pp and the inv we made to StoreCharacter // to see if we can store it if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); return false; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); return true; } @@ -1516,7 +1516,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) if (!cc) return false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); RaceClassCombos class_combo; bool found = false; @@ -1533,7 +1533,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); return false; } @@ -1550,7 +1550,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); return false; } @@ -1563,37 +1563,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) allocation.DefaultPointAllocation[6]; if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); return false; } if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); return false; } if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); return false; } if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); return false; } if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); return false; } if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); return false; } if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); return false; } @@ -1606,7 +1606,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) current_stats += cc->WIS - allocation.BaseStats[5]; current_stats += cc->CHA - allocation.BaseStats[6]; if (current_stats > max_stats) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); return false; } @@ -1687,7 +1687,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) if (!cc) return false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); classtemp = cc->class_ - 1; racetemp = cc->race - 1; @@ -1700,16 +1700,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // if out of range looking it up in the table would crash stuff // so we return from these if (classtemp >= PLAYER_CLASS_COUNT) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); return false; } if (racetemp >= _TABLE_RACES) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); return false; } if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs? - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); // we return from this one, since if it's an invalid combination our table // doesn't have meaningful values for the stats return false; @@ -1737,43 +1737,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // that are messed up not just the first hit if (bTOTAL + stat_points != cTOTAL) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); Charerrors++; } if (cc->STR > bSTR + stat_points || cc->STR < bSTR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); Charerrors++; } if (cc->STA > bSTA + stat_points || cc->STA < bSTA) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); Charerrors++; } if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); Charerrors++; } if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); Charerrors++; } if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); Charerrors++; } if (cc->INT > bINT + stat_points || cc->INT < bINT) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); Charerrors++; } if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); Charerrors++; } /*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of) I am NOT writing those tables - kathgar*/ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); return Charerrors == 0; } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index ceb147fa3..976ab113c 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) { int16 tmpStatus = WorldConfig::get()->DefaultStatus; paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID()); if (!paccountid) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); return false; } strn0cpy(paccountname, plsname, sizeof(paccountname)); diff --git a/world/clientlist.cpp b/world/clientlist.cpp index c3cbc7a7c..6ab4f9d78 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -56,7 +56,7 @@ void ClientList::Process() { if (!iterator.GetData()->Process()) { struct in_addr in; in.s_addr = iterator.GetData()->GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); //the client destructor should take care of this. // iterator.GetData()->Free(); iterator.RemoveCurrent(); @@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID) if(!from) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); return; } @@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S safe_delete(output); } catch(...){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); return; } } @@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon safe_delete(pack2); } catch(...){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); return; } } @@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) { iterator.Reset(); while(iterator.MoreElements()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); if (iterator.GetData()->GetAccountID() == account_id) { Client* tmp = iterator.GetData(); return tmp; @@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) { iterator.Reset(); while(iterator.MoreElements()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); if (iterator.GetData()->GetCharName() == charname) { Client* tmp = iterator.GetData(); return tmp; diff --git a/world/console.cpp b/world/console.cpp index 6b51deb34..bb15f724b 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -88,7 +88,7 @@ void Console::Die() { state = CONSOLE_STATE_CLOSED; struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); tcpc->Disconnect(); } @@ -219,7 +219,7 @@ bool Console::Process() { if (!tcpc->Connected()) { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); return false; } //if we have not gotten the special markers after this timer, send login prompt @@ -234,7 +234,7 @@ bool Console::Process() { SendMessage(1, "Timeout, disconnecting..."); struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); return false; } @@ -243,29 +243,29 @@ bool Console::Process() { in.s_addr = GetIP(); if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) { auto zs = new ZoneServer(tcpc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); zoneserver_list.Add(zs); numzones++; tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); launcher_list.Add(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); UCSLink.SetConnection(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); QSLink.SetConnection(tcpc); tcpc = 0; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); } return false; } @@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) { state = CONSOLE_STATE_CLOSED; return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); SendMessage(1, 0); SendMessage(2, "Login accepted."); state = CONSOLE_STATE_CONNECTED; @@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) { break; } case CONSOLE_STATE_CONNECTED: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); Seperator sep(command); if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) { SendMessage(1, " whoami"); @@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) { tmpname[0] = '*'; strcpy(&tmpname[1], paccountname); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0)); } } @@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) { #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); } else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) { if (strcasecmp(sep.arg[1], "list") == 0) { diff --git a/world/eql_config.cpp b/world/eql_config.cpp index c2088b56d..13f095575 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() { std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); else { auto row = results.begin(); m_dynamics = atoi(row[0]); @@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() { query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); return; } @@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } @@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } @@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); return false; } @@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/eqw.cpp b/world/eqw.cpp index 2cc6262df..0137bfe8e 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -269,7 +269,7 @@ void EQW::LSReconnect() { pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index fbe6ea000..c1afc41e8 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const { int16 status = 0; uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status); if(acctid == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); return(false); } if(status < httpLoginStatus) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); return(false); } @@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP } void EQWHTTPServer::Stop() { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); m_running = false; Close(); } bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { if(m_running) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); return(false); } //load up our nice mime types if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); return(false); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); } //fire up the server thread char errbuf[TCPServer_ErrorBufferSize]; if(!Open(port, errbuf)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); return(false); } diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index 4c80ac7e7..f0970b1fe 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -65,7 +65,7 @@ EQWParser::EQWParser() { my_perl = perl_alloc(); _empty_sv = newSV(0); if(!my_perl) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); else DoInit(); } @@ -182,10 +182,10 @@ void EQWParser::DoInit() { #ifdef EMBPERL_PLUGIN - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); std::string err; if(!eval_file("world", "worldui.pl", err)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); } eval_pv( diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 300d94b3f..6ac7c6326 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -79,7 +79,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -90,7 +90,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -100,7 +100,7 @@ bool LauncherLink::Process() { } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -114,25 +114,25 @@ bool LauncherLink::Process() { break; } case ServerOP_ZAAuth: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); break; } case ServerOP_LauncherConnectInfo: { const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer; if(HasName()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); break; } m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); if(config == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); std::vector result; //database.GetLauncherZones(it->name, result); @@ -146,7 +146,7 @@ bool LauncherLink::Process() { zs.port = cur->port; zs.up = false; zs.starts = 0; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); m_states[cur->name] = zs; } @@ -162,17 +162,17 @@ bool LauncherLink::Process() { std::map::iterator res; res = m_states.find(it->short_name); if(res == m_states.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); break; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); res->second.up = it->running; res->second.starts = it->start_count; break; } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) { zs.port = port; zs.up = false; zs.starts = 0; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); m_states[short_name] = zs; StartZone(short_name); diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 4b2af8169..0e258d78c 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -60,7 +60,7 @@ void LauncherList::Process() { //printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); cur = m_pendingLaunchers.erase(cur); delete l; } else if(l->HasName()) { @@ -72,10 +72,10 @@ void LauncherList::Process() { std::map::iterator res; res = m_launchers.find(name); if(res != m_launchers.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); delete res->second; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); //put the launcher in the list. m_launchers[name] = l; } else { @@ -91,7 +91,7 @@ void LauncherList::Process() { //printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); curl = m_launchers.erase(curl); delete l; } else { @@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { void LauncherList::Add(EmuTCPConnection *conn) { auto it = new LauncherLink(nextID++, conn); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); m_pendingLaunchers.push_back(it); } diff --git a/world/login_server.cpp b/world/login_server.cpp index 688a50a4b..84a4b4ebb 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -96,7 +96,7 @@ bool LoginServer::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { @@ -160,12 +160,12 @@ bool LoginServer::Process() { case ServerOP_LSFatalError: { #ifndef IGNORE_LS_FATAL_ERROR WorldConfig::DisableLoginserver(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); #else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); #endif if (pack->size > 1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); } break; } @@ -177,18 +177,18 @@ bool LoginServer::Process() { case ServerOP_LSRemoteAddr: { if (!Config->WorldAddress.length()) { WorldConfig::SetWorldAddress((char *)pack->pBuffer); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); } break; } case ServerOP_LSAccountUpdate: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); CanAccountUpdate = true; break; } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -202,10 +202,10 @@ bool LoginServer::Process() { bool LoginServer::InitLoginServer() { if(Connected() == false) { if(ConnectReady()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); Connect(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", LoginServerAddress,LoginServerPort); } } @@ -216,29 +216,29 @@ bool LoginServer::Connect() { char tmp[25]; if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){ minilogin = true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); } else minilogin = false; if (minilogin && WorldConfig::get()->WorldAddress.length()==0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); return false; } char errbuf[TCPConnection_ErrorBufferSize]; if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); return false; } if (LoginServerIP == 0 || LoginServerPort == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); return false; } if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); if (minilogin) SendInfo(); else @@ -248,7 +248,7 @@ bool LoginServer::Connect() { return true; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); return false; } } @@ -324,7 +324,7 @@ void LoginServer::SendStatus() { void LoginServer::SendAccountUpdate(ServerPacket* pack) { ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; if(CanUpdate()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); strn0cpy(s->worldaccount, LoginAccount, 30); strn0cpy(s->worldpassword, LoginPassword, 30); SendPacket(pack); diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index 305c79b23..bcdd67aa3 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) { bool LoginServerList::SendAccountUpdate(ServerPacket* pack) { LinkedListIterator iterator(list); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); iterator.Reset(); while(iterator.MoreElements()){ if(iterator.GetData()->CanUpdate()) { diff --git a/world/net.cpp b/world/net.cpp index 1d96c6d54..89544cca6 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -126,36 +126,36 @@ int main(int argc, char** argv) { } // Load server configuration - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); return 1; } #endif @@ -164,7 +164,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -172,19 +172,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -280,56 +280,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); database.LoadVariables(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); database.LoadZoneNames(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); database.ClearGroup(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); if (!database.LoadItems()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -338,45 +338,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -404,7 +404,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -417,19 +417,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -492,16 +492,16 @@ int main(int argc, char** argv) { } Sleep(20); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); console_list.KillAll(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); tcps.Close(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); eqsf.Close(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); CheckEQEMuErrorAndPause(); @@ -509,9 +509,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); RunLoops = false; } diff --git a/world/queryserv.cpp b/world/queryserv.cpp index d15f7d48a..3291933e8 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); Stream->Disconnect(); } @@ -57,7 +57,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -69,7 +69,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -79,7 +79,7 @@ bool QueryServConnection::Process() } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -97,7 +97,7 @@ bool QueryServConnection::Process() } case ServerOP_ZAAuth: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); break; } case ServerOP_QueryServGeneric: @@ -114,7 +114,7 @@ bool QueryServConnection::Process() } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/ucs.cpp b/world/ucs.cpp index 22a1ecdf6..178a97c1a 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); Stream->Disconnect(); } @@ -52,7 +52,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -64,7 +64,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -74,7 +74,7 @@ bool UCSConnection::Process() } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -92,12 +92,12 @@ bool UCSConnection::Process() } case ServerOP_ZAAuth: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); break; } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index e0621ef8d..a6ff8947b 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -34,7 +34,7 @@ WorldGuildManager guild_mgr; void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, } void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui } void WorldGuildManager::SendGuildDelete(uint32 guild_id) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!RefreshGuild(s->guild_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); //can we do anything? } @@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); //preform the local update client_list.UpdateClientGuild(s->char_id, s->guild_id); @@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!LocalDeleteGuild(s->guild_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); //can we do anything? } @@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildMemberUpdate: { if(pack->size != sizeof(ServerGuildMemberUpdate_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); return; } @@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { } default: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); break; } } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 6ec2df6a6..311ade1e7 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,11 +298,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector &rl) { const std::string query = "SELECT name FROM launcher"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); return; } @@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) { MailKeyString, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); } @@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level) std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index 38485fb59..3045e4c6e 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -79,7 +79,7 @@ void ZSList::KillAll() { void ZSList::Process() { if(shutdowntimer && shutdowntimer->Check()){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); auto pack2 = new ServerPacket; pack2->opcode = ServerOP_ShutdownAll; pack2->size=0; @@ -99,10 +99,10 @@ void ZSList::Process() { ZoneServer* zs = iterator.GetData(); struct in_addr in; in.s_addr = zs->GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); zs->LSShutDownUpdate(zs->GetZoneID()); if (holdzones){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); if(!zs->IsStaticZone()) RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID()); else @@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip s->port = port; s->zoneid = zoneid; if(zoneid != 0) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); tmp[z]->SendPacket(pack); delete pack; safe_delete_array(tmp); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 3d4376aeb..bf46627d4 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -77,7 +77,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { char* longname; if (iZoneID) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, iStaticZone ? " (Static)" : ""); zoneID = iZoneID; @@ -188,7 +188,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -199,7 +199,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -209,7 +209,7 @@ bool ZoneServer::Process() { } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } } @@ -541,10 +541,10 @@ bool ZoneServer::Process() { RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer; if (zoneserver_list.SendPacket(pack)){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); } break; } @@ -589,10 +589,10 @@ bool ZoneServer::Process() { ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer; sci->port = clientport; SendPacket(&p); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); } else { clientport=sci->port; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); } } @@ -602,7 +602,7 @@ bool ZoneServer::Process() { const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer; launcher_name = ln->launcher_name; launched_name = ln->zone_name; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); break; } case ServerOP_ShutdownAll: { @@ -685,12 +685,12 @@ bool ZoneServer::Process() { if(WorldConfig::get()->UpdateStats) client = client_list.FindCharacter(ztz->name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", ztz->name, ztz->current_zone_id, ztz->requested_zone_id); /* This is a request from the egress zone */ if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) { ztz->response = 0; @@ -708,20 +708,20 @@ bool ZoneServer::Process() { /* Zone was already running*/ if(ingress_server) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); ztz->response = 1; } /* Boot the Zone*/ else { int server_id; if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); // bootup successful, ready to rock ztz->response = 1; ingress_server = zoneserver_list.FindByID(server_id); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); // bootup failed, send back error code 0 ztz->response = 0; } @@ -736,7 +736,7 @@ bool ZoneServer::Process() { /* Response from Ingress server, route back to egress */ else{ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); ZoneServer *egress_server = nullptr; if(ztz->current_instance_id > 0) { egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id); @@ -754,7 +754,7 @@ bool ZoneServer::Process() { } case ServerOP_ClientList: { if (pack->size != sizeof(ServerClientList_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); break; } client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer); @@ -763,7 +763,7 @@ bool ZoneServer::Process() { case ServerOP_ClientListKA: { ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer; if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); break; } client_list.CLEKeepAlive(sclka->numupdates, sclka->wid); @@ -868,7 +868,7 @@ bool ZoneServer::Process() { } case ServerOP_GMGoto: { if (pack->size != sizeof(ServerGMGoto_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); break; } ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer; @@ -888,7 +888,7 @@ bool ZoneServer::Process() { } case ServerOP_Lock: { if (pack->size != sizeof(ServerLock_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); break; } ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer; @@ -913,7 +913,7 @@ bool ZoneServer::Process() { } case ServerOP_Motd: { if (pack->size != sizeof(ServerMotd_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); break; } ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer; @@ -924,7 +924,7 @@ bool ZoneServer::Process() { } case ServerOP_Uptime: { if (pack->size != sizeof(ServerUptime_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); break; } ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer; @@ -943,7 +943,7 @@ bool ZoneServer::Process() { break; } case ServerOP_GetWorldTime: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); auto pack = new ServerPacket; pack->opcode = ServerOP_SyncWorldTime; @@ -958,17 +958,17 @@ bool ZoneServer::Process() { break; } case ServerOP_SetWorldTime: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str()); zoneserver_list.SendTimeSync(); break; } case ServerOP_IPLookup: { if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); break; } ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer; @@ -980,7 +980,7 @@ bool ZoneServer::Process() { } case ServerOP_LockZone: { if (pack->size < sizeof(ServerLockZone_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); break; } ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer; @@ -1025,10 +1025,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if (zs->SendPacket(pack)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } } break; @@ -1047,10 +1047,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(cle->instance()); if(zs) { if(zs->SendPacket(pack)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); } } else @@ -1067,10 +1067,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } } @@ -1079,10 +1079,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(cle->zone()); if(zs) { if(zs->SendPacket(pack)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); } } else { @@ -1098,10 +1098,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } } @@ -1119,10 +1119,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1138,10 +1138,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } else @@ -1149,10 +1149,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1254,7 +1254,7 @@ bool ZoneServer::Process() { case ServerOP_LSAccountUpdate: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); loginserverlist.SendAccountUpdate(pack); break; } @@ -1309,7 +1309,7 @@ bool ZoneServer::Process() { } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/zone/aa.cpp b/zone/aa.cpp index 207f944b4..54d2831c3 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); return; } @@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -951,7 +951,7 @@ void Client::SendAAStats() { void Client::BuyAA(AA_Action* action) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); //find the AA information from the database SendAA_Struct* aa2 = zone->FindAA(action->ability); @@ -963,7 +963,7 @@ void Client::BuyAA(AA_Action* action) a = action->ability - i; if(a <= 0) break; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); aa2 = zone->FindAA(a); if(aa2 != nullptr) break; @@ -980,7 +980,7 @@ void Client::BuyAA(AA_Action* action) uint32 cur_level = GetAA(aa2->id); if((aa2->id + cur_level) != action->ability) { //got invalid AA - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); return; } @@ -1011,7 +1011,7 @@ void Client::BuyAA(AA_Action* action) if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); m_pp.aapoints -= real_cost; @@ -1429,10 +1429,10 @@ SendAA_Struct* Zone::FindAA(uint32 id) { } void Zone::LoadAAs() { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AAs!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AAs!"); aas = nullptr; return; } @@ -1447,11 +1447,11 @@ void Zone::LoadAAs() { } //load AA Effects into aa_effects - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA Effects..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA Effects..."); if (database.LoadAAEffects2()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AA Effects!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); return false; } @@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/aggro.cpp b/zone/aggro.cpp index cbd051e1a..678cbd3a8 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,17 +342,17 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); return( mod_will_aggro(mob, this) ); } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); return(false); } @@ -466,7 +466,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { //Father Nitwit: make sure we can see them. if(mob->CheckLosFN(sender)) { #if (EQDEBUG>=5) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); #endif mob->AddToHateList(attacker, 1, 0, false); @@ -693,7 +693,7 @@ type', in which case, the answer is yes. } while( reverse++ == 0 ); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); return false; } @@ -833,7 +833,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) } while( reverse++ == 0 ); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); return false; } @@ -945,7 +945,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; #if LOSDEBUG>=5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); #endif return zone->zonemap->CheckLoS(myloc, oloc); } diff --git a/zone/attack.cpp b/zone/attack.cpp index 81862872e..5610a5f8f 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -57,7 +57,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); switch (item->ItemType) { @@ -187,7 +187,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC() && !attacker->IsPet()) chancetohit += RuleR(Combat, NPCBonusHitChance); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); bool pvpmode = false; if(IsClient() && other->IsClient()) @@ -208,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate the level difference - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); double level_difference = attacker_level - defender_level; double range = defender->GetLevel(); @@ -236,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); if(attacker->IsClient()) { chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse))); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); } if(defender->IsClient()) { chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); } //I dont think this is 100% correct, but at least it does something... if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->spellbonuses.MeleeSkillCheck; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->itembonuses.MeleeSkillCheck; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } //Avoidance Bonuses on defender decreases baseline hit chance by percent. @@ -308,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate final chance to hit chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker); @@ -327,7 +327,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); // @@ -336,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c float tohit_roll = zone->random.Real(0, 100); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); return(tohit_roll <= chancetohit); } @@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) { damage = -3; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac damage -= (myac * zone->random.Int(0, acrandom) / 10000); } if (damage<1) damage=1; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); } } @@ -1128,14 +1128,14 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } if(!GetTarget()) SetTarget(other); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( @@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b || (GetHP() < 0) || (!IsAttackAllowed(other)) ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); return false; // Only bards can attack while casting } if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b damage = mod_client_damage(damage, skillinuse, Hand, weapon, other); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); int hit_chance_bonus = 0; @@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it other->AvoidDamage(this, damage); @@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(damage > 0) CommonOutgoingHitSuccess(other, damage, skillinuse); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att } int exploss = 0; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); /* #1: Send death packet to everyone @@ -1692,7 +1692,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); RemoveFromHateList(other); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); } return false; } @@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); return false; } @@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); damage = (min_dmg+eleBane); } if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } @@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } if(other->IsClient() && other->CastToClient()->IsSitting()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); damage = (max_dmg+eleBane); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); @@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool hate += opts->hate_flat; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list other->AddToHateList(this, hate); @@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(damage > 0) { CommonOutgoingHitSuccess(other, damage, skillinuse); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list if(damage > 0) other->AddToHateList(this, hate); @@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); if(other->IsClient() && IsPet() && GetOwner()->IsClient()) { //pets do half damage to clients in pvp @@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //cant riposte a riposte if (bRiposte && damage == -3) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); return false; } @@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); parse->EventNPC(EVENT_ATTACK, this, other, "", 0); } attacked_timer.Start(CombatEventTimer_expire); @@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; if(killerMob) { @@ -2028,7 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if (IsEngaged()) { zone->DelAggroMob(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); } SetHP(0); SetPet(0); @@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { if(DS == 0 && rev_ds == 0) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); //invert DS... spells yield negative values for a true damage shield if(DS < 0) { @@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; if(rev_ds < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? } @@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage) int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; if(damage_to_reduce >= buffs[slot].melee_rune) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); damage -= damage_to_reduce; @@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage) if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); if (spellbonuses.MitigateMeleeRune[3]) @@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune); damage -= buffs[slot].magic_rune; if(!TryFadeEffect(slot)) @@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); if (spellbonuses.MitigateSpellRune[3]) @@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == SkillAbjuration); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); if (GetInvul() || DivineAura()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } @@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int healed = damage; healed = attacker->GetActSpellHealing(spell_id, healed); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); attacker->HealDamage(healed); //we used to do a message to the client, but its gone now. @@ -3506,7 +3506,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse()) { if (!pet->IsHeld()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1); pet->SetTarget(attacker); Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); @@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //see if any runes want to reduce this damage if(spell_id == SPELL_UNKNOWN) { damage = ReduceDamage(damage); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); damage = ReduceAllDamage(damage); TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); } else { @@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //fade mez if we are mezzed if (IsMezzed() && attacker) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); @@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int stun_resist = itembonuses.StunResist + spellbonuses.StunResist; int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); if (IsClient()) { stun_resist += aabonuses.StunResist; frontal_stun_resist += aabonuses.FrontalStunResist; @@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (((GetBaseRace() == OGRE && IsClient()) || (frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); } else { // Normal stun resist check. if (stun_resist && zone->random.Roll(stun_resist)) { if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds } } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); } } @@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //increment chances of interrupting if(IsCasting()) { //shouldnt interrupt on regular spell damage attacked_count++; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); } } @@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) ProcChance += ProcChance * ProcBonus / 100.0f; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h ProcBonus += static_cast(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f; ProcChance = ProcChance + (ProcChance * ProcBonus); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3887,7 +3887,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3918,17 +3918,17 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } if (!IsAttackAllowed(on)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); return; } if (DivineAura()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); return; } @@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on static_cast(weapon->ProcRate)) / 100.0f; if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really. if (weapon->Proc.Level > ourlevel) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); if (IsPet()) { @@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on Message_StringID(13, PROC_TOOLOW); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100); ExecWeaponProc(inst, weapon->Proc.Effect, on); @@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, // Perma procs (AAs) if (PermaProcs[i].spellID != SPELL_UNKNOWN) { if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus? - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d procing spell %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); ExecWeaponProc(nullptr, PermaProcs[i].spellID, on); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Permanent proc %d failed to proc %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); } @@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (SpellProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(SpellProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d procing spell %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell proc %d failed to proc %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); } @@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (RangedProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(RangedProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d procing spell %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged proc %d failed to proc %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); } @@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Mob::DoRiposte(Mob* defender) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) { //Live AA - Double Riposte if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); if (HasDied()) return; } @@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) { DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); if (defender->GetClass() == MONK) defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); @@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); damage += (damage*dmgbonusmod/10000); } } @@ -4467,7 +4467,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } @@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { if (!TryFadeEffect(spellbonuses.Root[1])) { BuffFadeBySlot(spellbonuses.Root[1]); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); return true; } } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); return false; } @@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible() { //break invis when you attack if(invisible) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index 4806c2241..a9d077bcf 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -77,9 +77,9 @@ void Client::CalcBonuses() CalcSpellBonuses(&spellbonuses); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); CalcAABonuses(&aabonuses); //we're not quite ready for this - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); RecalcWeight(); @@ -634,7 +634,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) diff --git a/zone/bot.cpp b/zone/bot.cpp index ed9b9e1f3..7d77d8bc3 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); return; } @@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadStance()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveStance()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); } @@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) { if(!RangeWeapon || !Ammo) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); if(!IsAttackAllowed(other) || IsCasting() || @@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) { //break invis when you attack if(invisible) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -3362,7 +3362,7 @@ void Bot::AI_Process() { else if(!IsRooted()) { if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed()); SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY())); return; @@ -3689,7 +3689,7 @@ void Bot::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -3972,7 +3972,7 @@ void Bot::PetAIProcess() { { botPet->SetRunAnimSpeed(0); if(!botPet->IsRooted()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed()); return; } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); parse->EventNPC(EVENT_ATTACK, this, from, "", 0); } @@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ // if spell is lifetap add hp to the caster if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) { int healed = GetActSpellHealing(spell_id, damage); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } @@ -6017,14 +6017,14 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } if(!GetTarget() || GetTarget() != other) SetTarget(other); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || other == nullptr || @@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName()); if(other) { RemoveFromHateList(other); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); } return false; } if(DivineAura()) {//cant attack while invulnerable - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); return false; } @@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(berserk && (GetClass() == BERSERKER)){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b else damage = zone->random.Int(min_hit, max_hit); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel()); if(opts) { @@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(other, skillinuse, Hand)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); damage = 0; other->AddToHateList(this, 0); } else { //we hit, try to avoid it @@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b ApplyMeleeDamageBonus(skillinuse, damage); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); TryCriticalHit(other, skillinuse, damage, opts); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); // now add done damage to the hate list //other->AddToHateList(this, hate); } else other->AddToHateList(this, 0); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //break invis when you attack if(invisible) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -7335,7 +7335,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); } } //Check for spell skill limits. @@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { ProcChance += ProcChance*ProcBonus / 100.0f; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) { damage = -3; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) uint16 levelreq = aabonuses.FinishingBlowLvl[0]; if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse); return true; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); return false; } } @@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Bot::DoRiposte(Mob* defender) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); if (!defender) return; @@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) { defender->GetItemBonuses().GiveDoubleRiposte[0]; if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); } @@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f); float DefenderChance = (float)zone->random.Real(0.00f, 1.00f); if(AttackerChance > DefenderChance) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); // WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW //entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName()); @@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { Result = true; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); } } } @@ -8441,7 +8441,7 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { return; } - // Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); + // Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER); @@ -8548,7 +8548,7 @@ int32 Bot::CalcMaxMana() { } default: { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(GetClass() != BARD) { if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t //cannot cast under deivne aura if(DivineAura()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t } if (HasActiveSong()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client //_StopSong(); bardsong = 0; @@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(caster->IsBot()) { if(spells[spell_id].targettype == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); return true; } } @@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3) ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); return true; } } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); } } @@ -15454,7 +15454,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 0cf6d36a6..8f8e977a2 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -950,7 +950,7 @@ bool Bot::AI_PursueCastCheck() { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) { if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) { @@ -1055,7 +1055,7 @@ bool Bot::AI_EngagedCastCheck() { BotStanceType botStance = GetBotStance(); bool mayGetAggro = HasOrMayGetAggro(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); if(botClass == CLERIC) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { diff --git a/zone/client.cpp b/zone/client.cpp index fe5c2758e..8bf63010e 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -340,7 +340,7 @@ Client::~Client() { ToggleBuyerMode(false); if(conn_state != ClientConnectFinished) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); ReportConnectingState(); } @@ -438,31 +438,31 @@ void Client::SendLogoutPackets() { void Client::ReportConnectingState() { switch(conn_state) { case NoPacketsReceived: //havent gotten anything - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); break; case ReceivedZoneEntry: //got the first packet, loading up PP - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); break; case PlayerProfileLoaded: //our DB work is done, sending it - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); break; case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); break; case NewZoneRequested: //received and sent new zone request - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); break; case ClientSpawnRequested: //client sent ReqClientSpawn - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); break; case ZoneContentsSent: //objects, doors, zone points - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); break; case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); break; case ClientConnectFinished: //client finally moved to finished state, were done here - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); break; }; } @@ -650,7 +650,7 @@ bool Client::SendAllPackets() { if(eqs) eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); - Log.DoLog(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); + Log.Out(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); } return true; } @@ -698,7 +698,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s char message[4096]; strn0cpy(message, orig_message, sizeof(message)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); if (targetname == nullptr) { targetname = (!GetTarget()) ? "" : GetTarget()->GetName(); @@ -1506,7 +1506,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - Log.DoLog(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); + Log.Out(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); @@ -1911,7 +1911,7 @@ void Client::ReadBook(BookRequest_Struct *book) { if (booktxt2[0] != '\0') { #if EQDEBUG >= 6 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); #endif EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct)); @@ -2105,7 +2105,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ SaveCurrency(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); } void Client::EVENT_ITEM_ScriptStopReturn(){ @@ -2145,7 +2145,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat SaveCurrency(); #if (EQDEBUG>=5) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); #endif } @@ -2235,13 +2235,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha if(zone->random.Real(0, 99) < Chance) { SetSkill(skillid, GetRawSkill(skillid) + 1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); return true; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); } return false; } @@ -2262,10 +2262,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) { if(zone->random.Real(0,100) < Chance) { // if they make the roll IncreaseLanguageSkill(langid); // increase the language skill by 1 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); } else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); } } @@ -2364,7 +2364,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 Save(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " "Too many specializations skills were above 50.", GetCleanName()); } @@ -4544,14 +4544,14 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetClass() != LDON_TREASURE) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", GetName(), target->GetName(), target->GetName()); return; } if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); Message(13, "Treasure chest out of range."); return; @@ -5294,7 +5294,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5362,7 +5362,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5389,7 +5389,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5397,7 +5397,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6211,7 +6211,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6225,7 +6225,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -8149,7 +8149,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); #endif } else @@ -8166,7 +8166,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); #endif } } @@ -8289,11 +8289,11 @@ std::string Client::TextLink::GenerateLink() if ((m_Link.length() == 0) || (m_Link.length() > 250)) { m_Error = true; m_Link = ""; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length()); #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); #endif } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index aa12b2299..ff7c44010 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; @@ -935,7 +935,7 @@ int32 Client::CalcMaxMana() break; } default: { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -956,7 +956,7 @@ int32 Client::CalcMaxMana() } #if EQDEBUG >= 11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1046,14 +1046,14 @@ int32 Client::CalcBaseMana() break; } default: { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_m = 0; break; } } #if EQDEBUG >= 11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); #endif return max_m; } @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 614b4257e..188ada287 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -401,7 +401,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) if(is_log_enabled(CLIENT__NET_IN_TRACE)) { char buffer[64]; app->build_header_dump(buffer); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); } EmuOpcode opcode = app->GetOpcode(); @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -460,7 +460,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); char buffer[64]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); if (Log.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ app->build_header_dump(buffer); if (app->size < 1000) @@ -483,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_LINKDEAD: break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); break; } @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. if (!CanBeInZone()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); GoToSafeCoords(database.GetZoneID("arena"), 0); return; } @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message: %s", error->message); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1317,14 +1317,14 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) ClientVersionBit = 0; bool siv = m_inv.SetInventoryVersion(ClientVersion); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); /* Antighost code tmp var is so the search doesnt find this object */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetAuth() returned false kicking client"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1340,7 +1340,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) struct in_addr ghost_addr; ghost_addr.s_addr = eqs->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", client->AccountID(), client->AccountName(), client->GetName(), inet_ntoa(ghost_addr)); client->Save(); client->Disconnect(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1899,7 +1899,7 @@ void Client::Handle_0x0193(const EQApplicationPacket *app) void Client::Handle_OP_AAAction(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); if (app->size != sizeof(AA_Action)){ printf("Error! OP_AAAction size didnt match!\n"); @@ -1908,7 +1908,7 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) AA_Action* action = (AA_Action*)app->pBuffer; if (action->action == aaActionActivate) {//AA Hotkey - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); ActivateAA((aaID)action->ability); } else if (action->action == aaActionBuy) { @@ -1940,7 +1940,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) { if (app->size != sizeof(AcceptNewTask_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", sizeof(AcceptNewTask_Struct), app->size); DumpPacket(app); return; @@ -1955,7 +1955,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2010,7 +2010,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2190,7 +2190,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2280,7 +2280,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Sell_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", app->size, sizeof(Adventure_Sell_Struct)); DumpPacket(app); return; @@ -2412,7 +2412,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2938,7 +2938,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2957,7 +2957,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -2971,7 +2971,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (!IsPoison) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " "after casting, or is not a poison!", ApplyPoisonData->inventorySlot); Message(0, "Error: item not found for inventory slot #%i or is not a poison", ApplyPoisonData->inventorySlot); @@ -2994,7 +2994,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); } } @@ -3009,7 +3009,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); return; } @@ -3039,7 +3039,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); return; } QueuePacket(app); @@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) if (app->size != sizeof(AugmentInfo_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); DumpPacket(app); return; @@ -3071,7 +3071,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3228,7 +3228,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3295,7 +3295,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) { if (app->size != sizeof(bool)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); DumpPacket(app); return; } @@ -3311,7 +3311,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) // Although there are three different structs for OP_Bandolier, they are all the same size. // if (app->size != sizeof(BandolierCreate_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", sizeof(BandolierCreate_Struct), app->size); DumpPacket(app); return; @@ -3330,7 +3330,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) SetBandolier(app); break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); } } @@ -3339,7 +3339,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) { if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); DumpPacket(app); return; } @@ -3424,7 +3424,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) if (app->size < 4) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); DumpPacket(app); return; } @@ -3572,7 +3572,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) default: Message(13, "Unrecognised Barter action."); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); } } @@ -3580,7 +3580,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3635,8 +3635,8 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3721,16 +3721,16 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } return; @@ -3743,7 +3743,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -3838,7 +3838,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3859,14 +3859,14 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*)app->pBuffer; uint32 spid = sbf->spellid; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and @@ -3941,7 +3941,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTask_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", sizeof(CancelTask_Struct), app->size); DumpPacket(app); return; @@ -3955,7 +3955,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4006,16 +4006,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) targetring_z = castspell->z_pos; #ifdef _EQDEBUG - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); #endif - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; @@ -4047,7 +4047,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) //discipline, using the item spell slot if (castspell->inventoryslot == INVALID_INDEX) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); InterruptSpell(castspell->spell_id); } return; @@ -4190,7 +4190,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app) if (app->size != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); DumpPacket(app); @@ -4212,7 +4212,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app) if (app->size != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", app->size); DumpPacket(app); @@ -4234,7 +4234,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4259,7 +4259,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4310,7 +4310,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4323,11 +4323,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4344,8 +4344,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message:%s", error->message); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message:%s", error->message); return; } @@ -4366,7 +4366,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4718,7 +4718,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4812,7 +4812,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4872,7 +4872,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4909,7 +4909,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -4921,7 +4921,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4942,7 +4942,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5098,7 +5098,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5136,7 +5136,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app) if (app->size != sizeof(DelegateAbility_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", sizeof(DelegateAbility_Struct), app->size); DumpPacket(app); @@ -5311,7 +5311,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", sizeof(DoGroupLeadershipAbility_Struct), app->size); DumpPacket(app); @@ -5363,7 +5363,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) } default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", dglas->Ability, dglas->Parameter); break; } @@ -5445,7 +5445,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5536,7 +5536,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5591,7 +5591,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5832,7 +5832,7 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); SendGuildMOTD(true); @@ -5845,7 +5845,7 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); SendGuildList(); } @@ -5858,7 +5858,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5910,7 +5910,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5927,7 +5927,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainEnd_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); DumpPacket(app); return; } @@ -5943,7 +5943,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6008,7 +6008,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6058,7 +6058,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6125,7 +6125,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6135,7 +6135,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) return; } Client* client = entity_list.GetClientByName(gmn->oldname); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(13, "%s not found for name change. Operation failed!", gmn->oldname); @@ -6177,7 +6177,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) if (app->size < sizeof(GMSearchCorpse_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", app->size, sizeof(GMSearchCorpse_Struct)); DumpPacket(app); return; @@ -6300,7 +6300,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainee_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); DumpPacket(app); return; } @@ -6311,7 +6311,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) { if (app->size != sizeof(GMSkillChange_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); DumpPacket(app); return; } @@ -6379,7 +6379,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6396,7 +6396,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6440,12 +6440,12 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; @@ -6587,7 +6587,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6607,7 +6607,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6656,7 +6656,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6725,7 +6725,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) if (g->IsLeader(this)) g->ChangeLeader(NewLeader); else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6734,7 +6734,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6770,7 +6770,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6816,7 +6816,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(GroupUpdate_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", app->size, sizeof(GroupUpdate_Struct)); DumpPacket(app); return; @@ -6835,7 +6835,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) if (group->IsLeader(this)) group->ChangeLeader(newleader); else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6844,7 +6844,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) default: { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); DumpPacket(app); return; } @@ -6864,7 +6864,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -6889,7 +6889,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if ((Action != GuildBankDeposit) && (Action != GuildBankViewItem) && (Action != GuildBankWithdraw)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); GuildBankAck(); @@ -7050,7 +7050,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsGuildBanker() && !GuildBanks->AllowedToWithdraw(GuildID(), gbwis->Area, gbwis->SlotID, GetName())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); GuildBankAck(); @@ -7121,7 +7121,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "Unexpected GuildBank action."); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } } } @@ -7192,7 +7192,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) @@ -7214,12 +7214,12 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.DeleteGuild(GuildID())) Message(0, "Guild delete failed."); else { @@ -7230,10 +7230,10 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); if (app->size != sizeof(GuildDemoteStruct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); return; } @@ -7263,7 +7263,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) uint8 rank = gci.rank - 1; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", demote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7281,7 +7281,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7322,7 +7322,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) //we could send this to the member and prompt them to see if they want to //be demoted (I guess), but I dont see a point in that. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7341,7 +7341,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7353,7 +7353,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); client->QueuePacket(app); } @@ -7376,7 +7376,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7386,7 +7386,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); client->SetPendingGuildInvitation(true); client->QueuePacket(app); @@ -7409,7 +7409,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); SetPendingGuildInvitation(false); @@ -7445,7 +7445,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) else if (!worldserver.Connected()) Message(0, "Error: World server disconnected"); else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", gj->guildeqid, gj->response, gj->inviter, gj->newmember); //we dont really care a lot about what this packet means, as long as @@ -7459,7 +7459,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) if (gj->guildeqid == GuildID()) { //only need to change rank. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), gj->response, guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7471,7 +7471,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", GetName(), CharacterID(), guild_mgr.GetGuildName(gj->guildeqid), gj->guildeqid, gj->response); @@ -7500,10 +7500,10 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); if (app->size < 2) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); return; } @@ -7522,7 +7522,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) Client* newleader = entity_list.GetClientByName(gml->target); if (newleader) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID(), newleader->GetName(), newleader->CharacterID()); @@ -7543,9 +7543,9 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); if (app->size != sizeof(GuildManageBanker_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); return; } GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer; @@ -7620,16 +7620,16 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); return; } void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); if (app->size != sizeof(GuildPromoteStruct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); return; } @@ -7658,7 +7658,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", promote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7675,7 +7675,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); if (app->size < sizeof(GuildUpdate_PublicNote)) { // client calls for a motd on login even if they arent in a guild @@ -7694,7 +7694,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", gpn->target, gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID(), gpn->note); @@ -7711,7 +7711,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7741,7 +7741,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = client->CharacterID(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7757,7 +7757,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = gci.char_id; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", gci.char_name.c_str(), gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7782,7 +7782,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) { if (app->size != sizeof(GuildStatus_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", sizeof(GuildStatus_Struct), app->size); DumpPacket(app); @@ -7839,7 +7839,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) { if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", sizeof(GuildUpdateURLAndChannel_Struct), app->size); DumpPacket(app); @@ -7867,7 +7867,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) void Client::Handle_OP_GuildWar(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); return; } @@ -7943,7 +7943,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app) // if (app->size != sizeof(HideCorpse_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", sizeof(HideCorpse_Struct), app->size); DumpPacket(app); @@ -7972,7 +7972,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8002,7 +8002,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8057,7 +8057,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8071,7 +8071,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8108,7 +8108,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8208,7 +8208,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8223,7 +8223,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8421,7 +8421,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8449,7 +8449,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (slot_id < 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); return; } @@ -8492,7 +8492,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check { @@ -8530,7 +8530,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); } else if (inst->IsType(ItemClassCommon)) { @@ -8603,7 +8603,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } else { @@ -8619,7 +8619,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) else if (item->ItemType == ItemTypeAlcohol) { #if EQDEBUG >= 1 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } } } @@ -8787,7 +8787,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) { if (app->size != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -8874,7 +8874,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9034,7 +9034,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9071,7 +9071,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9096,7 +9096,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); SendLogoutPackets(); @@ -9150,7 +9150,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9327,7 +9327,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) if (app->size != sizeof(MercenaryCommand_Struct)) { Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; } @@ -9384,7 +9384,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); DumpPacket(app); @@ -9519,7 +9519,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app if (app->size != 0) { Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9539,7 +9539,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9564,7 +9564,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID) if (app->size != sizeof(MercenaryMerchantRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); DumpPacket(app); @@ -9636,7 +9636,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) if (app->size != sizeof(SuspendMercenary_Struct)) { Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; } @@ -9660,7 +9660,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9698,7 +9698,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9714,7 +9714,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9797,7 +9797,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9829,7 +9829,7 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9856,7 +9856,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9869,7 +9869,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10332,7 +10332,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10376,7 +10376,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10446,7 +10446,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10516,7 +10516,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) { if (app->size != sizeof(PopupResponse_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", sizeof(PopupResponse_Struct), app->size); DumpPacket(app); return; @@ -10551,7 +10551,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) { if (app->size != sizeof(MovePotionToBelt_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", sizeof(MovePotionToBelt_Struct), app->size); DumpPacket(app); return; @@ -10559,7 +10559,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); return; } @@ -10582,7 +10582,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -10672,7 +10672,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a // if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); DumpPacket(app); @@ -10699,7 +10699,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) // if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", sizeof(PVPLeaderBoardRequest_Struct), app->size); DumpPacket(app); @@ -10720,7 +10720,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11305,7 +11305,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11334,7 +11334,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11350,7 +11350,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11364,7 +11364,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11378,14 +11378,14 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); // results show that object_type is combiner type // some_id = 0 if world combiner, item number otherwise @@ -11437,7 +11437,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11446,7 +11446,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) rss->query[55] = '\0'; //just to be sure. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); // make where clause segment for container(s) char containers[30]; @@ -11506,7 +11506,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -11669,7 +11669,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) // if (app->size != 4) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", 4, app->size); DumpPacket(app); return; @@ -11697,7 +11697,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); @@ -11720,14 +11720,14 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) { if (app->size != sizeof(Sacrifice_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); DumpPacket(app); return; } Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11765,13 +11765,13 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11848,7 +11848,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); if (app->size != sizeof(GuildMOTD_Struct)) { // client calls for a motd on login even if they arent in a guild @@ -11866,7 +11866,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) GuildMOTD_Struct* gmotd = (GuildMOTD_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", guild_mgr.GetGuildName(GuildID()), GuildID(), GetName(), gmotd->motd); if (!guild_mgr.SetGuildMOTD(GuildID(), gmotd->motd, GetName())) { @@ -11884,7 +11884,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11918,7 +11918,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); return; } @@ -11969,7 +11969,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) { if (app->size != sizeof(SetTitle_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); DumpPacket(app); return; } @@ -11993,7 +11993,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12090,7 +12090,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12098,7 +12098,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) t1.start(); Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); DumpPacket(app); #endif @@ -12258,7 +12258,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12348,7 +12348,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12504,7 +12504,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12797,7 +12797,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12834,7 +12834,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) { if (app->size != sizeof(Surname_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); return; } @@ -12924,7 +12924,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13149,7 +13149,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TaskHistoryRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", sizeof(TaskHistoryRequest_Struct), app->size); DumpPacket(app); return; @@ -13202,7 +13202,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); return; } @@ -13216,7 +13216,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13369,7 +13369,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13417,7 +13417,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (c) c->WithCustomer(0); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); break; } @@ -13426,7 +13426,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) break; } default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); break; } } @@ -13512,10 +13512,10 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13524,8 +13524,8 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) HandleTraderPriceUpdate(app); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13550,11 +13550,11 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) BuyTraderItem(tbs, Trader, app); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); } return; @@ -13563,7 +13563,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13599,7 +13599,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13628,7 +13628,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (app->size != sizeof(TraderClick_Struct)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); return; } @@ -13642,7 +13642,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (Customer) outtcs->Approval = Customer->WithCustomer(GetID()); else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" " returned a nullptr pointer"); return; } @@ -13670,7 +13670,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13691,7 +13691,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if (app->size != sizeof(Translocate_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); DumpPacket(app); return; } @@ -13739,7 +13739,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates an item... @@ -13758,7 +13758,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13768,7 +13768,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates money @@ -13787,7 +13787,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13797,7 +13797,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); _pkt(TRIBUTE__IN, app); return; @@ -13805,11 +13805,11 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13819,12 +13819,12 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); @@ -13836,7 +13836,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } @@ -13876,7 +13876,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app) if (app->size != sizeof(VoiceMacroIn_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", sizeof(VoiceMacroIn_Struct), app->size); DumpPacket(app); @@ -13927,7 +13927,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app) { if (app->size != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); DumpPacket(app); return; } @@ -13939,7 +13939,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) { if (app->size < 12) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); DumpPacket(app); return; } @@ -14162,7 +14162,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) } default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 834c4882d..27a8587c0 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -799,7 +799,7 @@ void Client::OnDisconnect(bool hard_disconnect) { Mob *Other = trade->With(); if(Other) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); FinishTrade(this); if(Other->IsClient()) @@ -836,7 +836,7 @@ void Client::BulkSendInventoryItems() { if(inst) { bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -1037,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { // Account for merchant lists with gaps. if (ml.slot >= i) { if (ml.slot > i) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); i = ml.slot + 1; } } @@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ Client* c = entity_list.GetClientByID(CustomerID); if(!c) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); CustomerID = NewCustomer; return 1; } @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) { if(app->size != sizeof(MemorizeSpell_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); DumpPacket(app); return; } @@ -1723,12 +1723,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id; if(!CanHaveSkill(skill)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); return; } if(MaxSkill(skill) == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); return; } @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/command.cpp b/zone/command.cpp index 551da4d9e..32a910842 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -443,13 +443,13 @@ int command_init(void) { if ((itr=command_settings.find(cur->first))!=command_settings.end()) { cur->second->access = itr->second; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); } else { #ifdef COMMANDS_WARNINGS if(cur->second->access == 0) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); #endif } } @@ -494,7 +494,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -568,12 +568,12 @@ int command_realdispatch(Client *c, const char *message) #ifdef COMMANDS_LOGGING if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } #endif if(cur->function == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command @@ -1292,7 +1292,7 @@ void command_viewpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1317,7 +1317,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1343,7 +1343,7 @@ void command_delpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); } @@ -1566,7 +1566,7 @@ void command_permaclass(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); t->Kick(); @@ -1588,7 +1588,7 @@ void command_permarace(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's race - zone to take effect",t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); t->SetBaseGender(tmp); @@ -1612,7 +1612,7 @@ void command_permagender(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's gender - zone to take effect",t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); t->SendIllusionPacket(atoi(sep->arg[1])); @@ -1954,7 +1954,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Spawning database spawn"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Spawning database spawn"); uint16 cond = 0; int16 cond_min = 0; if(sep->IsNumber(4)) { @@ -2274,7 +2274,7 @@ void command_setlanguage(Client *c, const Seperator *sep) } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); uint8 langid = (uint8)atoi(sep->arg[1]); uint8 value = (uint8)atoi(sep->arg[2]); c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value ); @@ -2299,7 +2299,7 @@ void command_setskill(Client *c, const Seperator *sep) c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); int skill_num = atoi(sep->arg[1]); uint16 skill_value = atoi(sep->arg[2]); if(skill_num < HIGHEST_SKILL) @@ -2319,7 +2319,7 @@ void command_setskillall(Client *c, const Seperator *sep) } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); uint16 level = atoi(sep->arg[1]); for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) { c->GetTarget()->CastToClient()->SetSkill(skill_num, level); @@ -3114,7 +3114,7 @@ void command_listpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); if (results.RowCount() == 0) return; @@ -3771,7 +3771,7 @@ void command_lastname(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); @@ -4545,10 +4545,10 @@ void command_guild(Client *c, const Seperator *sep) } if(guild_id == GUILD_NONE) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id); } @@ -4597,7 +4597,7 @@ void command_guild(Client *c, const Seperator *sep) return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) @@ -4639,7 +4639,7 @@ void command_guild(Client *c, const Seperator *sep) uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) @@ -4678,7 +4678,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) @@ -4712,7 +4712,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) @@ -4763,7 +4763,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) @@ -4869,7 +4869,7 @@ void command_manaburn(Client *c, const Seperator *sep) target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/); c->Message(4,"You unleash an enormous blast of magical energies."); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); } } else @@ -5221,7 +5221,7 @@ void command_scribespells(Client *c, const Seperator *sep) t->Message(0, "Scribing spells to spellbook."); if(t != c) c->Message(0, "Scribing spells for %s.", t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot)) { @@ -5278,7 +5278,7 @@ void command_scribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) { book_slot = t->GetNextAvailableSpellBookSlot(); @@ -5325,7 +5325,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); @@ -7862,7 +7862,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->Message(0, "Training disciplines"); if(t != c) c->Message(0, "Training disciplines for %s.", t->GetName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++) { @@ -10394,7 +10394,7 @@ void command_logtest(Client *c, const Seperator *sep){ if (sep->IsNumber(1)){ uint32 i = 0; for (i = 0; i < atoi(sep->arg[1]); i++){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } } \ No newline at end of file diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 121feb2c1..a3e116ae2 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -842,7 +842,7 @@ bool Corpse::Process() { spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); corpse_db_id = 0; } @@ -872,10 +872,10 @@ bool Corpse::Process() { Save(); player_corpse_depop = true; corpse_db_id = 0; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); return true; } } @@ -1083,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); client->Message(0, "Inaccessable Corpse Item: %s", item->Name); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index 2d8e4daf6..de2feed63 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -145,9 +145,9 @@ bool Doors::Process() void Doors::HandleClick(Client* sender, uint8 trigger) { //door debugging info dump - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct)); MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer; @@ -303,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); #if EQDEBUG>=5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); #endif if(GetLockpick() <= modskill) @@ -560,13 +560,13 @@ void Doors::ToggleState(Mob *sender) } void Doors::DumpDoor(){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", dest_zone, dest_x, dest_y, dest_z, dest_heading); } @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Doors from database..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Doors from database..."); // Door tmpDoor; diff --git a/zone/effects.cpp b/zone/effects.cpp index 3c0b1ccfd..5671460ec 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 4a9cb0716..7692151c2 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 88fa72121..35856db8b 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_quest does not take any arguments."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embperl.cpp b/zone/embperl.cpp index b7ec2b6b2..0a33a2d4a 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -140,12 +140,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "perl error: %s", err); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "perl error: %s", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Tying perl output to eqemu logs"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -170,14 +170,14 @@ void Embperl::DoInit() { ,FALSE ); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Loading perlemb plugins."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Loading perlemb plugins."); try { eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE); } catch(const char *err) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Warning - plugin.pl: %s", err); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Warning - plugin.pl: %s", err); } try { @@ -195,7 +195,7 @@ void Embperl::DoInit() { } catch(const char *err) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Perl warning: %s", err); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Perl warning: %s", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 8c35b7817..e3ad58229 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_qc does not take any arguments."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. @@ -100,7 +100,7 @@ XS(XS_EQEmuIO_PRINT) int len = 0; for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); len = 0; pos = i+1; } else { @@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); } } diff --git a/zone/entity.cpp b/zone/entity.cpp index 068b91f3a..86d2423e4 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a group."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a raid."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); @@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID) // If we have been passed a TaskID, only reload the client state if they have // that Task active. if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); client->RemoveClientTaskState(); client->LoadClientTaskState(); taskmanager->SendActiveTasksToClient(client); diff --git a/zone/exp.cpp b/zone/exp.cpp index b0db67a40..66cb7855b 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); @@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetLevel(uint8 set_level, bool command) { if (GetEXPForLevel(set_level) == 0xFFFFFFFF) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); return; } @@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command) safe_delete(outapp); this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); CalcBonuses(); diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index cb007d574..2729203ce 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; curfp = true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; diff --git a/zone/forage.cpp b/zone/forage.cpp index a0381f6a2..bb4e6643e 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index 9faf0d8b1..6e146f104 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1098,7 +1098,7 @@ void Group::VerifyGroup() { for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (membername[i][0] == '\0') { #if EQDEBUG >= 7 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif members[i] = nullptr; continue; @@ -1107,7 +1107,7 @@ void Group::VerifyGroup() { Mob *them = entity_list.GetMob(membername[i]); if(them == nullptr && members[i] != nullptr) { //they aren't in zone #if EQDEBUG >= 6 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; members[i] = nullptr; @@ -1116,13 +1116,13 @@ void Group::VerifyGroup() { if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif members[i] = them; continue; } #if EQDEBUG >= 8 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); #endif } } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index 6c4cdc4d2..e1ce7b654 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) { } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -144,10 +144,10 @@ void Client::SendGuildSpawnAppearance() { if (!IsInAGuild()) { // clear guildtag SendAppearancePacket(AT_GuildID, GUILD_NONE); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); } else { uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); SendAppearancePacket(AT_GuildID, GuildID()); if(GetClientVersion() >= EQClientRoF) { @@ -171,11 +171,11 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size); if(outapp->pBuffer == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -192,7 +192,7 @@ void Client::SendGuildMembers() { outapp->pBuffer = data; data = nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); FastQueuePacket(&outapp); @@ -223,7 +223,7 @@ void Client::RefreshGuildInfo() CharGuildInfo info; if(!guild_mgr.GetCharInfo(CharacterID(), info)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); return; } @@ -335,7 +335,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){ outgj->rank = gj->rank; outgj->zoneid = gj->zoneid; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); FastQueuePacket(&outapp); @@ -409,7 +409,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -429,7 +429,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 8a566cf43..76f2e3f8a 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -32,7 +32,7 @@ extern WorldServer worldserver; extern volatile bool ZoneLoaded; void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { if(guild_id == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); CharGuildInfo gci; if(!GetCharInfo(charid, gci)) { @@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID) } void ZoneGuildManager::SendGuildDelete(uint32 guild_id) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -261,12 +261,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { switch(pack->opcode) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //reload all the guild details from the database. RefreshGuild(s->guild_id); @@ -295,12 +295,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); Client *c = entity_list.GetClientByCharID(s->char_id); @@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { { if(pack->size != sizeof(ServerGuildRankUpdate_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRankUpdate_Struct)); return; @@ -364,12 +364,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); //clear all the guild tags. entity_list.RefreshAllGuildInfo(s->guild_id); @@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if (!c || !c->IsInAGuild()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); break; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; @@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { VARSTRUCT_DECODE_STRING(Name, Buffer); strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName)); gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); c->QueuePacket(outapp); } safe_delete(outapp); @@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c) if(Iterator == Banks.end()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); return; } @@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Iterator == Banks.end()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); return false; } @@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Slot < 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No space to add item to the guild bank."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No space to add item to the guild bank."); return false; } @@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/horse.cpp b/zone/horse.cpp index b5691ca00..e5241f528 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index a2ccaaa58..71a9da32a 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -215,7 +215,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are augmenting an augmentable item else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -229,7 +229,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -269,7 +269,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; @@ -700,7 +700,7 @@ void Client::SendCursorBuffer() { // Remove item from inventory void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { #if (EQDEBUG >= 5) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); #endif // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. @@ -815,7 +815,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); m_inv.PushCursor(inst); if (client_update) { @@ -831,7 +831,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) // (Also saves changes back to the database: this may be optimized in the future) // client_update: Sends packet to client bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); if (slot_id == MainCursor) return PushItemOnCursor(inst, client_update); @@ -858,7 +858,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); m_inv.PutItem(slot_id, inst); SendLootItemInPacket(&inst, slot_id); @@ -879,7 +879,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI continue; const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); safe_delete(bagitem); } @@ -1313,7 +1313,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1321,7 +1321,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1334,7 +1334,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->to_slot == (uint32)INVALID_INDEX) { if (move_in->from_slot == (uint32)MainCursor) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit ItemInst *inst = m_inv.GetItem(MainCursor); @@ -1348,7 +1348,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; // Item destroyed by client } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit DeleteItemInInventory(move_in->from_slot); return true; // Item deletion @@ -1388,7 +1388,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { ItemInst* src_inst = m_inv.GetItem(src_slot_id); ItemInst* dst_inst = m_inv.GetItem(dst_slot_id); if (src_inst){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); srcitemid = src_inst->GetItem()->ID; //SetTint(dst_slot_id,src_inst->GetColor()); if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize)) @@ -1398,7 +1398,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } if (dst_inst) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); dstitemid = dst_inst->GetItem()->ID; } if (Trader && srcitemid>0){ @@ -1435,7 +1435,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { move_in->from_slot = dst_slot_check; move_in->to_slot = src_slot_check; move_in->number_in_stack = dst_inst->GetCharges(); - if(!SwapItem(move_in)) { Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } + if(!SwapItem(move_in)) { Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } } return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } @@ -1577,7 +1577,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return false; } if (with) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor if (!m_inv[MainCursor]) { Message(13, "Error: Cursor item not located on server!"); @@ -1610,18 +1610,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->number_in_stack > 0) { // Determine if charged items can stack if(src_inst && !src_inst->IsStackable()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); return false; } if (dst_inst) { if(src_inst->GetID() != dst_inst->GetID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); return(false); } if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) { //we have a chance of stacking. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); // Charges can be emptied into dst uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges(); if (usedcharges > move_in->number_in_stack) @@ -1633,15 +1633,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Depleted all charges? if (src_inst->GetCharges() < 1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); database.SaveInventory(CharacterID(),nullptr,src_slot_id); m_inv.DeleteItem(src_slot_id); all_to_stack = true; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); return false; } } @@ -1650,12 +1650,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) { // Move entire stack if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); } else { // Split into two src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack); m_inv.PutItem(dst_slot_id, *inst); safe_delete(inst); @@ -1680,7 +1680,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { SetMaterial(dst_slot_id,src_inst->GetItem()->ID); } if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) { if(src_inst) { @@ -1739,7 +1739,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { // resync the 'from' and 'to' slots on an as-needed basis // Not as effective as the full process, but less intrusive to gameplay -U - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Message(15, "Inventory Desyncronization detected: Resending slot data..."); if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) { @@ -2071,7 +2071,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2080,7 +2080,7 @@ void Client::RemoveNoRent(bool client_update) { for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2089,7 +2089,7 @@ void Client::RemoveNoRent(bool client_update) { if (m_inv[MainPowerSource]) { const ItemInst* inst = m_inv[MainPowerSource]; if (inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent } } @@ -2098,7 +2098,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2107,7 +2107,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots } } @@ -2116,7 +2116,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots } } @@ -2125,7 +2125,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots } } @@ -2134,7 +2134,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots } } @@ -2155,7 +2155,7 @@ void Client::RemoveNoRent(bool client_update) { inst = *iter; // should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U if (!inst->GetItem()->NoRent) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); else m_inv.PushCursor(**iter); @@ -2178,7 +2178,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2193,7 +2193,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2208,7 +2208,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(MainPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, MainPowerSource); } else { @@ -2223,7 +2223,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2238,7 +2238,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2253,7 +2253,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2281,7 +2281,7 @@ void Client::RemoveDuplicateLore(bool client_update) { inst = *iter; // probably needs a valid pointer check -U if (CheckLoreConflict(inst->GetItem())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); safe_delete(*iter); iter = local.erase(iter); } @@ -2300,7 +2300,7 @@ void Client::RemoveDuplicateLore(bool client_update) { m_inv.PushCursor(**iter); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); } safe_delete(*iter); @@ -2322,7 +2322,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, client_update); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2335,7 +2335,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name); const ItemInst* InvItem = nullptr; @@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { InvItem = GetInv()[WeaponSlot]; if(InvItem) { BaseItem = InvItem->GetItem(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon; database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0; } @@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { void Client::RemoveBandolier(const EQApplicationPacket *app) { BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); memset(m_pp.bandoliers[bds->number].name, 0, 32); for(int i = bandolierMainHand; i <= bandolierAmmo; i++) { m_pp.bandoliers[bds->number].items[i].item_id = 0; @@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // any items currently in the weapon slots to inventory. BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); int16 slot; int16 WeaponSlot; ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory @@ -2585,16 +2585,16 @@ void Client::SetBandolier(const EQApplicationPacket *app) { else { // The player doesn't have the required weapon with them. BandolierItems[BandolierSlot] = 0; if (slot == INVALID_INDEX) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { // If there was an item in that weapon slot, put it in the inventory - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(InvItem) { // If there was already an item in that weapon slot that we replaced, find a place to put it if(!MoveItemToInventory(InvItem)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2640,13 +2640,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // put it in the player's inventory. ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name); // If there was an item in that weapon slot, put it in the inventory if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { if(!ItemToReturn) return false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); uint32 ItemID = ItemToReturn->GetItem()->ID; @@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(i), i); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); return true; } @@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); return true; } @@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // Store on the cursor // - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); PushItemOnCursor(*ItemToReturn, UpdateClient); @@ -2865,8 +2865,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (log) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); @@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) { if (depth >= 10) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); return; } @@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea else { e = ""; } if (log) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); if (!silent) requester->Message(1, "%i:%i - inst: %s - parent: %s%s", diff --git a/zone/loottables.cpp b/zone/loottables.cpp index ccff63bab..96ef83c88 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml drop_chance = zone->random.Real(0.0, 100.0); #if EQDEBUG>=11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); #endif if (thischance == 100.0 || drop_chance < thischance) { @@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge ServerLootItem_Struct* item = new ServerLootItem_Struct; #if EQDEBUG>=11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif EQApplicationPacket* outapp = nullptr; diff --git a/zone/merc.cpp b/zone/merc.cpp index a9829677f..ee846c49e 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -885,7 +885,7 @@ int32 Merc::CalcMaxMana() break; } default: { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -906,7 +906,7 @@ int32 Merc::CalcMaxMana() } #if EQDEBUG >= 11 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1647,7 +1647,7 @@ void Merc::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -1766,7 +1766,7 @@ bool Merc::AI_EngagedCastCheck() { { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); int8 mercClass = GetClass(); @@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/mob.cpp b/zone/mob.cpp index 6e33d79cd..8f594c80a 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1576,7 +1576,7 @@ void Mob::SendIllusionPacket(uint16 in_race, uint8 in_gender, uint8 in_texture, entity_list.QueueClients(this, outapp); safe_delete(outapp); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size); } @@ -3043,7 +3043,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) { if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function if(IsClient()){ Message(0, "Invalid spell proc %u", spell_id); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); } return; } @@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) { if(lifetap_amt && damage > 0){ lifetap_amt = damage * lifetap_amt / 100; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); if (lifetap_amt > 0) HealDamage(lifetap_amt); //Heal self for modified damage amount. diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index ebd5f6182..dd637525c 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -1404,7 +1404,7 @@ void Mob::AI_Process() { else if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); if(!RuleB(Pathing, Aggro) || !zone->pathing) CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed()); else @@ -1639,7 +1639,7 @@ void NPC::AI_DoMovement() { roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y); if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true)) { @@ -1692,11 +1692,11 @@ void NPC::AI_DoMovement() { else { movetimercompleted=false; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); //if we were under quest control (with no grid), we are done now.. if(cur_wp == -2) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); roamer = false; cur_wp = 0; } @@ -1727,7 +1727,7 @@ void NPC::AI_DoMovement() { { // currently moving if (cur_wp_x == GetX() && cur_wp_y == GetY()) { // are we there yet? then stop - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); SetWaypointPause(); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1773,7 +1773,7 @@ void NPC::AI_DoMovement() { if (movetimercompleted==true) { // time to pause has ended SetGrid( 0 - GetGrid()); // revert to AI control - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1809,7 +1809,7 @@ void NPC::AI_DoMovement() { if (!CP2Moved) { if(moved) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); ClearFeignMemory(); moved=false; SetMoving(false); @@ -1934,7 +1934,7 @@ bool NPC::AI_EngagedCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); // try casting a heal or gate if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) { @@ -1957,7 +1957,7 @@ bool NPC::AI_PursueCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) { //no spell cast, try again soon. AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false); diff --git a/zone/net.cpp b/zone/net.cpp index 4297641dc..b1a372a8c 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -148,28 +148,28 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading server configuration failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading server configuration failed."); return 1; } const ZoneConfig *Config=ZoneConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); worldserver.SetPassword(Config->SharedKey.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Cannot continue without a database connection."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Cannot continue without a database connection."); return 1; } @@ -186,121 +186,121 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); return 1; } #endif const char *log_ini_file = "./log.ini"; if(!load_log_settings(log_ini_file)) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); database.LoadVariables(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); if (!database.LoadItems()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading items FAILED!"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading items FAILED!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading loot FAILED!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading skill caps FAILED!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading base data FAILED!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); database.LoadFactionData(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); database.LoadTributes(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Command loading FAILED"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Command loading FAILED"); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(TaskSystem, EnableTaskSystem)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); taskmanager = new TaskManager; taskmanager->LoadTasks(); } @@ -317,11 +317,11 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); parse->ReloadQuests(); if (!worldserver.Connect()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -332,9 +332,9 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; } @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #ifndef WIN32 - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); #endif Timer quest_timers(100); @@ -365,13 +365,13 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); // log_sys.CloseZoneLogs(); // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); if (!eqsf.Open(Config->ZonePort)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); worldserver.Disconnect(); worldwasconnected = false; @@ -385,7 +385,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqss->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); stream_identifier.AddStream(eqss); //takes the stream } @@ -397,7 +397,7 @@ int main(int argc, char** argv) { //now that we know what patch they are running, start up their client object struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); Client* client = new Client(eqsi); entity_list.AddClient(client); } @@ -522,13 +522,13 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); CheckEQEMuErrorAndPause(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -539,7 +539,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); // safe_delete(worldserver); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); } uint32 NetConnection::GetIP() @@ -628,7 +628,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index ea031a4ed..013136a50 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Database error, invalid item"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem { if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); } } } diff --git a/zone/object.cpp b/zone/object.cpp index 604234238..5624ec24a 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index c90e27b9b..c8546279b 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -61,19 +61,19 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) if(Ret->loadPaths(PathFile)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,18 +103,18 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Bad Magic String in .path file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Bad Magic String in .path file."); return false; } fread(&Head, sizeof(Head), 1, PathFile); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", (long)Head.version, (long)Head.PathNodeCount); if(Head.version != 2) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported path file version."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque PathManager::FindRoute(int startID, int endID) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -330,7 +330,7 @@ std::deque PathManager::FindRoute(int startID, int endID) } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); return Route; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::deque noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToStart <0 ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return noderoute; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); // Find the nearest PathNode the end point has LOS to @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToEnd < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); return noderoute; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); if(ClosestPathNodeToStart == ClosestPathNodeToEnd) { @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) return To; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); if(From == PathingLastPosition) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((PathingLoopCount > 5) && !IsRooted()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); if(Route.size() == 0) { @@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // If we are already pathing, and the destination is the same as before ... if(SameDestination) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); // Get the coordinates of the first path node we are going to. NextNode = Route.front(); @@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // We have reached the path node. if(NodeLoc == From) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); NodeReached = true; @@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // target, and we may run past the target if we don't check LOS at this point. int RouteSize = Route.size(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); if((RouteSize == 2) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode); } @@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // we have run all the nodes, all that is left is the direct path from the last node // to the destination - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); return To; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } else @@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // We get here if we were already pathing, but our destination has now changed. // - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); // Update our record of where we are going to. PathingDestination = To; // Check if we now have LOS etc to the new destination. @@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); } } } @@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { if(!PathingRouteUpdateTimerShort->Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); } else { if(!PathingRouteUpdateTimerLong->Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); } // We are already pathing, destination changed, no LOS. Find the nearest node to our destination. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. if(DestinationPathNode == -1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); Route.clear(); return To; } @@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // one, we will carry on on our path. if(DestinationPathNode == Route.back()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); @@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Check if we have reached a path node. if(NodeLoc == From) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); NodeReached = true; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // Return the coords of our next path node on the route. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); return To; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); Route.clear(); // We will now fall through to get a new route. @@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); if((SameDestination) && !PathingLOSCheckTimer->Check()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); return To; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); return To; } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); Route = zone->pathing->FindRoute(From, To); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); return To; } if(SameDestination && (Route.front() == PathingLastNodeVisited)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Route.clear(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); PathingLoopCount = 0; @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } if(ClosestPathNodeToStart <0 ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); return -1; } return ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); return false; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); if (ABS(NewZ - last_z) > 5.0f) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } if (best_z2 == -999990) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); return false; } else { if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); return false; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); } } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) if(d && !d->IsDoorOpen() ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); d->ForceOpen(ForWho); } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 881e94f66..621895c3b 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { if (THIS->IsMerc()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); #endif else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { if (THIS->IsMerc()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); #endif else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 9e1025393..9ee477de0 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,12 +254,12 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); #endif } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index cbb9cf2f2..b8d25c2b6 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index d516d6fd1..83f497352 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -154,7 +154,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -170,7 +170,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::stopalltimers(Mob *mob) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -559,7 +559,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -570,7 +570,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -589,7 +589,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -619,7 +619,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -646,7 +646,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -655,7 +655,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -664,7 +664,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -1652,7 +1652,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); return; } @@ -2074,7 +2074,7 @@ bool QuestManager::istaskenabled(int taskid) { void QuestManager::tasksetselector(int tasksetid) { QuestManagerCurrentQuestVars(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager) initiator->TaskSetSelector(owner, tasksetid); } @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } @@ -2809,7 +2809,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 5ee380233..804392ae1 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index d3b0cfae8..928414f2c 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -153,13 +153,13 @@ bool Spawn2::Process() { if (timer.Check()) { timer.Disable(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); //first check our spawn condition, if this isnt active //then we reset the timer and try again next time. if(condition_id != SC_AlwaysEnabled && !zone->spawn_conditions.Check(condition_id, condition_min_value)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); Reset(); return(true); } @@ -170,14 +170,14 @@ bool Spawn2::Process() { } if (sg == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } //have the spawn group pick an NPC for us uint32 npcid = sg->GetNPCType(); if (npcid == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); Reset(); //try again later (why?) return(true); } @@ -185,7 +185,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); if (tmp == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); } @@ -194,7 +194,7 @@ bool Spawn2::Process() { { if(!entity_list.LimitCheckName(tmp->name)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); timer.Start(5000); //try again in five seconds. return(true); } @@ -202,7 +202,7 @@ bool Spawn2::Process() { if(tmp->spawn_limit > 0) { if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); timer.Start(5000); //try again in five seconds. return(true); } @@ -233,10 +233,10 @@ bool Spawn2::Process() { if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && sg->min_delay) npc->AI_SetRoambox(sg->roamdist,sg->roambox[0],sg->roambox[1],sg->roambox[2],sg->roambox[3],sg->delay,sg->min_delay); if(zone->InstantGrids()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); LoadGrid(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); } } return true; @@ -261,7 +261,7 @@ void Spawn2::LoadGrid() { //dont set an NPC's grid until its loaded for them. npcthis->SetGrid(grid_); npcthis->AssignWaypoints(grid_); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); } @@ -272,21 +272,21 @@ void Spawn2::LoadGrid() { void Spawn2::Reset() { timer.Start(resetTimer()); npcthis = nullptr; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { if (delay == 0) { timer.Trigger(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } npcthis = nullptr; @@ -328,7 +328,7 @@ void Spawn2::ForceDespawn() cur = despawnTimer(dtimer); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); timer.Start(cur); } @@ -349,7 +349,7 @@ void Spawn2::DeathReset(bool realdeath) if(spawn2_id) { database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), (cur/1000)); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); //store it to database too } } @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -466,12 +466,12 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { if(GetSpawnCondition() != c.condition_id) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); bool old_state = (old_value >= condition_min_value); bool new_state = (c.value >= condition_min_value); if(old_state == new_state) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); return; //no change } @@ -479,50 +479,50 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { switch(c.on_change) { case SpawnCondition::DoNothing: //that was easy. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); break; case SpawnCondition::DoDepop: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; case SpawnCondition::DoRepopIfReady: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); npcthis->Depop(false); //remove the current mob npcthis = nullptr; } if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled. timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); if(timer_remaining <= 0) Repop(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); } break; default: if(c.on_change < SpawnCondition::DoSignalMin) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); return; //unknown onchange action } int signal_id = c.on_change - SpawnCondition::DoSignalMin; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } void Zone::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); LinkedListIterator iterator(spawn2_list); @@ -592,7 +592,7 @@ void SpawnConditionManager::Process() { EQTime::AddMinutes(cevent.period, &cevent.next); std::string t; EQTime::ToString(&cevent.next, t); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); //save the next event time in the DB UpdateDBEvent(cevent); //find the next closest event timer. @@ -611,7 +611,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); return; //unable to find the spawn condition to operate on } @@ -619,7 +619,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { zone->zone_time.getEQTimeOfDay(&tod); if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); return; } @@ -631,26 +631,26 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { switch(event.action) { case SpawnEvent::ActionSet: new_value = event.argument; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); break; case SpawnEvent::ActionAdd: new_value += event.argument; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionSubtract: new_value -= event.argument; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionMultiply: new_value *= event.argument; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; case SpawnEvent::ActionDivide: new_value /= event.argument; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; default: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); return; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -727,7 +727,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: std::string timeAsString; EQTime::ToString(&event.next, timeAsString); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); return true; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -755,7 +755,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in cond.on_change = (SpawnCondition::OnChange) atoi(row[1]); spawn_conditions[cond.condition_id] = cond; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); } //load values @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } @@ -811,7 +811,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in spawn_events.push_back(event); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); } //now we need to catch up on events that happened while we were away @@ -846,7 +846,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in //watch for special case of all 0s, which means to reset next to now if(cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 && cevent.next.minute == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); memcpy(&cevent.next, &tod, sizeof(cevent.next)); //add one period EQTime::AddMinutes(cevent.period, &cevent.next); @@ -857,7 +857,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in bool ran = false; while(EQTime::IsTimeBefore(&tod, &cevent.next)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); //this event has been triggered. //execute the event if(!cevent.strict || StrictCheck) @@ -900,9 +900,9 @@ void SpawnConditionManager::FindNearestEvent() { } } if(next_id == -1) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); } void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update) @@ -914,14 +914,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -930,7 +930,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //set our local value cond.value = new_value; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -941,14 +941,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -959,7 +959,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //save it in the DB too UpdateDBCondition(zone_short, instance_id, condition_id, new_value); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -969,7 +969,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //this is a remote spawn condition, update the DB and send //an update packet to the zone if its up - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); UpdateDBCondition(zone_short, instance_id, condition_id, new_value); @@ -989,7 +989,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance void SpawnConditionManager::ReloadEvent(uint32 event_id) { std::string zone_short_name; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1002,7 +1002,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { //load the event into the old event slot if(!LoadDBEvent(event_id, cevent, zone_short_name)) { //unable to find the event in the database... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } //sync up our nearest event @@ -1015,7 +1015,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { SpawnEvent e; if(!LoadDBEvent(event_id, e, zone_short_name)) { //unable to find the event in the database... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); return; } @@ -1032,7 +1032,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1047,13 +1047,13 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri cevent.enabled = enabled; cevent.strict = strict; if(reset_base) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); //start with the time now zone->zone_time.getEQTimeOfDay(&cevent.next); //advance the next time by our period EQTime::AddMinutes(cevent.period, &cevent.next); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); } //save the event in the DB @@ -1062,7 +1062,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri //sync up our nearest event FindNearestEvent(); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); } //even if we dont change anything, we still found it return; @@ -1081,24 +1081,24 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri SpawnEvent e; std::string zone_short_name; if(!LoadDBEvent(event_id, e, zone_short_name)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); //unable to find the event in the database... return; } if(e.enabled == enabled && !reset_base) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); return; //no changes. } e.enabled = enabled; if(reset_base) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); //start with the time now zone->zone_time.getEQTimeOfDay(&e.next); //advance the next time by our period EQTime::AddMinutes(e.period, &e.next); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); } //save the event in the DB UpdateDBEvent(e); @@ -1123,7 +1123,7 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); return(0); //unable to find the spawn condition } @@ -1138,12 +1138,12 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc zone_short, instance_id, condition_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index 98ecffa0f..577e5b998 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa uint32 SpawnGroup::GetNPCType() { #if EQDEBUG >= 10 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); #endif int npcType = 0; int totalchance = 0; @@ -167,7 +167,7 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND zone = '%s'", zone_name); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); return false; } @@ -195,7 +195,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); return false; } @@ -210,7 +210,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "ORDER BY chance", spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); return false; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index f801f7bc4..47ae29ec2 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -464,7 +464,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) break; } default: - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); return(1000); /* nice long delay for them, the caller depends on this! */ } @@ -683,7 +683,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -695,12 +695,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const ItemInst* Ammo = m_inv[MainAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); return; } @@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const Item_Struct* AmmoItem = Ammo->GetItem(); if(RangeItem->ItemType != ItemTypeBow) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID()); return; } if(AmmoItem->ItemType != ItemTypeArrow) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); //look for ammo in inventory if we only have 1 left... if(Ammo->GetCharges() == 1) { @@ -746,7 +746,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { Ammo = baginst; ammo_slot = m_inv.CalcSlotId(r, i); found = true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); break; } } @@ -761,17 +761,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (aslot != INVALID_INDEX) { ammo_slot = aslot; Ammo = m_inv[aslot]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); } } } float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -799,9 +799,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){ DeleteItemInInventory(ammo_slot, 1, true); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); } CheckIncreaseSkill(SkillArchery, GetTarget(), -15); @@ -873,7 +873,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillArchery); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillArchery, 0, RangeWeapon, Ammo, AmmoSlot, speed); @@ -882,7 +882,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); bool HeadShot = false; uint32 HeadShot_Dmg = TryHeadShot(other, SkillArchery); @@ -923,7 +923,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite MaxDmg += MaxDmg*bonusArcheryDamageModifier / 100; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); bool dobonus = false; if(GetClass() == RANGER && GetLevel() > 50){ @@ -944,7 +944,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite hate *= 2; MaxDmg = mod_archery_bonus_damage(MaxDmg, RangeWeapon); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); } } @@ -1192,7 +1192,7 @@ void NPC::RangedAttack(Mob* other) //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -1361,7 +1361,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -1371,19 +1371,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const ItemInst* RangeWeapon = m_inv[MainRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); if(RangeWeapon->GetCharges() == 1) { //first check ammo @@ -1392,7 +1392,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = MainAmmo; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal); @@ -1400,17 +1400,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //the item wont change, but the instance does, not that it matters ammo_slot = aslot; RangeWeapon = m_inv[aslot]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } } } float range = item->Range + GetRangeDistTargetSizeMod(other); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1489,7 +1489,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillThrowing); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); return; @@ -1497,7 +1497,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); int16 WDmg = 0; @@ -1533,7 +1533,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) other->AvoidDamage(this, TotalDmg, false); //CanRiposte=false - Can not riposte throw attacks. diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 0f3770394..1962ec416 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -476,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(!target_zone) { #ifdef SPELL_EFFECT_SPAM - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); #endif if(IsClient()) CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); @@ -485,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { #ifdef SPELL_EFFECT_SPAM - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); #endif if(IsClient()) CastToClient()->MovePC(target_zone, x, y, z, heading); @@ -711,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) stun_resist += aabonuses.StunResist; if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; @@ -721,7 +721,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } } break; @@ -1649,7 +1649,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", spell_id, caster->GetName()); CastToCorpse()->CastRezz(spell_id, caster); @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } @@ -3065,7 +3065,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, int mod = caster->GetInstrumentMod(spell_id); mod = ApplySpellEffectiveness(caster, spell_id, mod, true); effect_value = effect_value * mod / 10; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); } effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster); @@ -3127,7 +3127,7 @@ snare has both of them negative, yet their range should work the same: updownsign = 1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", spell_id, formula, base, max, caster_level, updownsign); switch(formula) @@ -3326,7 +3326,7 @@ snare has both of them negative, yet their range should work the same: result = ubase * (caster_level * (formula - 2000) + 1); } else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); } } @@ -3351,7 +3351,7 @@ snare has both of them negative, yet their range should work the same: if (base < 0 && result > 0) result *= -1; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3383,18 +3383,18 @@ void Mob::BuffProcess() IsMezSpell(buffs[buffs_i].spellid) || IsBlindSpell(buffs[buffs_i].spellid)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } } else if (buffs[buffs_i].ticsremaining < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); } } else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)) @@ -3759,7 +3759,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient() && !CastToClient()->IsDead()) CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); if(spells[buffs[slot].spellid].viral_targets > 0) { bool last_virus = true; @@ -4817,7 +4817,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -5156,7 +5156,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } diff --git a/zone/spells.cpp b/zone/spells.cpp index 7d0718d34..570d6ea0e 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -147,7 +147,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -166,7 +166,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, (IsAmnesiad() && IsDiscipline(spell_id)) ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -204,7 +204,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, //cannot cast under divine aura if(DivineAura()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -234,7 +234,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -243,7 +243,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, } if (HasActiveSong() && IsBardSong(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client _StopSong(); } @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -349,7 +349,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, const SPDat_Spell_Struct &spell = spells[spell_id]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", spell.name, spell_id, target_id, slot, cast_time, mana_cost, item_slot==0xFFFFFFFF?999:item_slot); casting_spell_id = spell_id; @@ -363,7 +363,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_type = type; SaveSpellLoc(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); // if this spell doesn't require a target, or if it's an optional target // and a target wasn't provided, then it's us; unless TGB is on and this @@ -375,7 +375,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, spell.targettype == ST_Beam || spell.targettype == ST_TargetOptional) && target_id == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); target_id = GetID(); } @@ -392,7 +392,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, // we checked for spells not requiring targets above if(target_id == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, SPELL_NEED_TAR); @@ -430,7 +430,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { mana_cost = 0; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, INSUFFICIENT_MANA); @@ -451,7 +451,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_resist_adjust = resist_adjust; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", spell_id, cast_time, orgcasttime, mana_cost); // cast time is 0, just finish it right now and be done with it @@ -517,7 +517,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); return false; @@ -756,7 +756,7 @@ bool Client::CheckFizzle(uint16 spell_id) float fizzle_roll = zone->random.Real(0, 100); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); if(fizzle_roll > fizzlechance) return(true); @@ -816,7 +816,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) ZeroCastingVars(); // resets all the state keeping stuff - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); if(!spellid) return; @@ -893,7 +893,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? Message_StringID(13, SPELL_RECAST); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -907,7 +907,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { Message_StringID(13, SPELL_RECAST); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -916,7 +916,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!IsValidSpell(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); InterruptSpell(); return; } @@ -927,7 +927,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(delaytimer) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); Message(13, "You are unable to focus."); InterruptSpell(); return; @@ -937,7 +937,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // make sure they aren't somehow casting 2 timed spells at once if (casting_spell_id != spell_id) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); Message_StringID(13,ALREADY_CASTING); InterruptSpell(); return; @@ -952,7 +952,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if (IsBardSong(spell_id)) { if(spells[spell_id].buffduration == 0xFFFF || spells[spell_id].recast_time != 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); } else { bardsong = spell_id; bardsong_slot = slot; @@ -962,7 +962,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, else bardsong_target_id = spell_target->GetID(); bardsong_timer.Start(6000); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); bard_song_mode = true; } } @@ -1041,10 +1041,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); InterruptSpell(); return; } @@ -1060,10 +1060,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(IsClient()) { int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { if(reg_focus > 0) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); Client *c = this->CastToClient(); int component, component_count, inv_slot_id; bool missingreags = false; @@ -1116,11 +1116,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, break; default: // some non-instrument component. Let it go, but record it in the log - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); } if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); if(c->GetGM()) c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { @@ -1143,12 +1143,12 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, const Item_Struct *item = database.GetItem(component); if(item) { c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { char TempItemName[64]; strcpy((char*)&TempItemName, "UNKNOWN"); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); } } } // end bard/not bard ifs @@ -1169,7 +1169,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (component == -1) continue; component_count = spells[spell_id].component_counts[t_count]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); // Components found, Deleting // now we go looking for and deleting the items one by one for(int s = 0; s < component_count; s++) @@ -1234,7 +1234,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { Message_StringID(13, SPELL_RECAST); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -1253,15 +1253,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(fromaug) { charges = -1; } //Don't destroy the parent item if(charges > -1) { // charged item, expend a charge - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); DeleteChargeFromSlot = inventory_slot; } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; @@ -1280,7 +1280,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // we're done casting, now try to apply the spell if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust) ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); InterruptSpell(); return; } @@ -1309,7 +1309,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, this->CastToClient()->CheckSongSkillIncrease(spell_id); this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); } else { @@ -1344,7 +1344,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, delaytimer = true; spellend_timer.Start(400,true); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); } @@ -1391,7 +1391,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce && (IsGrouped() // still self only if not grouped || IsRaidGrouped()) && (HasProjectIllusion())){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); targetType = ST_GroupClientAndPet; } @@ -1474,7 +1474,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce ) { //invalid target - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1487,7 +1487,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3)) { //invalid target - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1501,7 +1501,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (spell_target != GetPet()) || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, body_type); Message_StringID(13, SPELL_NEED_TAR); @@ -1526,7 +1526,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || mob_body != target_bt) { //invalid target - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); if(!spell_target) Message_StringID(13,SPELL_NEED_TAR); else @@ -1544,7 +1544,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1552,14 +1552,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target->IsNPC()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1568,7 +1568,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } @@ -1580,7 +1580,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target || !spell_target->IsPlayerCorpse()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); uint32 message = ONLY_ON_CORPSES; if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; @@ -1596,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = GetPet(); if(!spell_target) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); Message_StringID(13,NO_PET); return false; // can't cast these unless we have a target } @@ -1666,7 +1666,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1703,7 +1703,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1800,14 +1800,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } @@ -1878,7 +1878,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; @@ -1957,7 +1957,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) return(false); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target // spell that's recast every 2500 msec for AEDuration msec. There are @@ -1968,7 +1968,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Mob *beacon_loc = spell_target ? spell_target : this; Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); spell_target = nullptr; ae_center = beacon; CastAction = AECaster; @@ -1977,7 +1977,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // check line of sight to target if it's a detrimental spell if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); Message_StringID(13,CANT_SEE_TARGET); return false; } @@ -2008,13 +2008,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range; if(dist2 > range2) { //target is out of range. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); Message_StringID(13, TARGET_TOO_CLOSE); return(false); } @@ -2043,7 +2043,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS if(spell_target == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } if (isproc) { @@ -2067,11 +2067,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(IsPlayerIllusionSpell(spell_id) && IsClient() && (HasProjectIllusion())){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); SetProjectIllusion(false); } else{ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); } break; } @@ -2235,7 +2235,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // CastSpell already reduced the cost for it if we're a client with focus if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); if (!DoHPToManaCovert(mana_used)) SetMana(GetMana() - mana_used); TryTriggerOnValueAmount(false, true); @@ -2247,7 +2247,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF) { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; @@ -2263,7 +2263,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(reduction) recast -= reduction; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } @@ -2301,7 +2301,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(slot == USE_ITEM_SPELL_SLOT) { //bard songs should never come from items... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); return(false); } @@ -2309,12 +2309,12 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } if(ae_center != nullptr && ae_center->IsBeacon()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2323,18 +2323,18 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(mana_used > 0) { if(mana_used > GetMana()) { //ran out of mana... this calls StopSong() for us - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); return(false); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); SetMana(GetMana() - mana_used); } // check line of sight to target if it's a detrimental spell if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); Message_StringID(13, CANT_SEE_TARGET); return(false); } @@ -2349,7 +2349,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range2 = range * range; if(dist2 > range2) { //target is out of range. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } @@ -2365,10 +2365,10 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case SingleTarget: { if(spell_target == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); spell_target->BardPulse(spell_id, this); break; } @@ -2386,7 +2386,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { { // we can't cast an AE spell without something to center it on if(ae_center == nullptr) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2394,9 +2394,9 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(spell_target) { // this must be an AETarget spell // affect the target too spell_target->BardPulse(spell_id, this); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); } bool affect_caster = !IsNPC(); //NPC AE spells do not affect the NPC caster entity_list.AEBardPulse(this, ae_center, spell_id, affect_caster); @@ -2406,13 +2406,13 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case GroupSpell: { if(spell_target->IsGrouped()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); Group *target_group = entity_list.GetGroupByMob(spell_target); if(target_group) target_group->GroupBardPulse(this, spell_id); } else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); Raid *r = entity_list.GetRaidByClient(spell_target->CastToClient()); if(r){ uint32 gid = r->GetGroup(spell_target->GetName()); @@ -2429,7 +2429,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); BardPulse(spell_id, this); #ifdef GROUP_BUFF_PETS if (GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) @@ -2455,13 +2455,13 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { if(buffs[buffs_i].spellid != spell_id) continue; if(buffs[buffs_i].casterid != caster->GetID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); return; } //extend the spell if it will expire before the next pulse if(buffs[buffs_i].ticsremaining <= 3) { buffs[buffs_i].ticsremaining += 3; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); } //should we send this buff update to the client... seems like it would @@ -2559,7 +2559,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { //we are done... return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); //this spell is not affecting this mob, apply it. caster->SpellOnTarget(spell_id, this); } @@ -2601,7 +2601,7 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste res = mod_buff_duration(res, caster, target, spell_id); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", spell_id, castlevel, formula, duration, res); return(res); @@ -2673,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) return duration ? duration : 3600; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); return 0; } } @@ -2695,15 +2695,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); // Same Spells and dot exemption is set to 1 or spell is Manaburn if (spellid1 == spellid2) { if (sp1.dot_stacking_exempt == 1 && caster1 != caster2) { // same caster can refresh - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); return -1; } else if (spellid1 == 2751) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); return -1; } } @@ -2735,7 +2735,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { if(!IsDetrimentalSpell(spellid1) && !IsDetrimentalSpell(spellid2)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); return (0); } } @@ -2804,16 +2804,16 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value, sp1_value, (sp1_value < overwrite_below_value)?"Overwriting":"Not overwriting"); if(sp1_value < overwrite_below_value) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); return 1; // overwrite spell if its value is less } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value); } @@ -2827,22 +2827,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value, sp2_value, (sp2_value < blocked_below_value)?"Blocked":"Not blocked"); if (sp2_value < blocked_below_value) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); return -1; //blocked } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } } } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", sp1.name, spellid1, sp2.name, spellid2); } @@ -2905,13 +2905,13 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(IsNPC() && caster1 && caster2 && caster1 != caster2) { if(effect1 == SE_CurrentHP && sp1_detrimental && sp2_detrimental) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); continue; } } if(effect1 == SE_CompleteHeal){ //SE_CompleteHeal never stacks or overwrites ever, always block. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); return (-1); } @@ -2923,7 +2923,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(sp_det_mismatch) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); continue; } @@ -2932,7 +2932,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, and the effect is a dot we can go ahead and stack it */ if(effect1 == SE_CurrentHP && spellid1 != spellid2 && sp1_detrimental && sp2_detrimental) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); continue; } @@ -2958,7 +2958,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, sp2_value = 0 - sp2_value; if(sp2_value < sp1_value) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", sp2.name, sp2_value, sp1.name, sp1_value, sp2.name); return -1; // can't stack } @@ -2967,7 +2967,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //we dont return here... a better value on this one effect dosent mean they are //all better... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", sp1.name, sp1_value, sp2.name, sp2_value, sp1.name); will_overwrite = true; } @@ -2976,15 +2976,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //so now we see if this new spell is any better, or if its not related at all if(will_overwrite) { if (values_equal && effect_match && !IsGroupSpell(spellid2) && IsGroupSpell(spellid1)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", sp2.name, spellid2, sp1.name, spellid1); return -1; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); return(1); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); return 0; } @@ -3043,11 +3043,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } if (duration == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); return -2; // no duration? this isn't a buff } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); // first we loop through everything checking that the spell @@ -3077,12 +3077,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid ret = CheckStackConflict(curbuf.spellid, curbuf.casterlevel, spell_id, caster_level, entity_list.GetMobID(curbuf.casterid), caster, buffslot); if (ret == -1) { // stop the spell - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); return -1; } if (ret == 1) { // set a flag to indicate that there will be overwriting - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); // If this is the first buff it would override, use its slot if (!will_overwrite) @@ -3106,7 +3106,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid for (buffslot = 0; buffslot < buff_count; buffslot++) { const Buffs_Struct &curbuf = buffs[buffslot]; if (IsBeneficialSpell(curbuf.spellid)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", spell_id, curbuf.spellid, buffslot); BuffFadeBySlot(buffslot, false); emptyslot = buffslot; @@ -3114,11 +3114,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } } if(emptyslot == -1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); return -1; } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); return -1; } } @@ -3169,7 +3169,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].UpdateClient = true; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); if (IsPet() && GetOwner() && GetOwner()->IsClient()) SendPetBuffsToClient(); @@ -3207,7 +3207,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) { int i, ret, firstfree = -2; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); int buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) @@ -3231,19 +3231,19 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) if(ret == 1) { // should overwrite current slot if(iFailIfOverwrite) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return(-1); } if(firstfree == -2) firstfree = i; } if(ret == -1) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return -1; // stop the spell, can't stack it } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); return firstfree; } @@ -3270,7 +3270,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // well we can't cast a spell on target without a target if(!spelltar) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); Message(13, "SOT: You must have a target for this spell."); return false; } @@ -3298,7 +3298,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r uint16 caster_level = GetCasterLevel(spell_id); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); // Actual cast action - this causes the caster animation and the particles // around the target @@ -3378,7 +3378,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Spells, EnableBlockedBuffs)) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", spell_id, spelltar->GetName()); safe_delete(action_packet); return true; @@ -3386,7 +3386,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBlockedPetBuff(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", spell_id, spelltar->GetName(), spelltar->GetOwner()->GetName()); safe_delete(action_packet); return true; @@ -3395,7 +3395,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // invuln mobs can't be affected by any spells, good or bad if(spelltar->GetInvul() || spelltar->DivineAura()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3406,17 +3406,17 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Pets, UnTargetableSwarmPet)) { if (spelltar->IsNPC()) { if (!spelltar->CastToNPC()->GetSwarmOwner()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } @@ -3525,9 +3525,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spells[spell_id].targettype == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); @@ -3537,7 +3537,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r } else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; @@ -3551,7 +3551,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsImmuneToSpell(spell_id, this)) { //the above call does the message to the client if needed - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3644,7 +3644,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spell_effectiveness == 0 || !IsPartialCapableSpell(spell_id) ) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); @@ -3692,7 +3692,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsAIControlled() && IsDetrimentalSpell(spell_id) && !IsHarmonySpell(spell_id)) { int32 aggro_amount = CheckAggroAmount(spell_id, isproc); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); if(aggro_amount > 0) spelltar->AddToHateList(this, aggro_amount); else{ int32 newhate = spelltar->GetHateAmount(this) + aggro_amount; @@ -3709,7 +3709,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // make sure spelltar is high enough level for the buff if(RuleB(Spells, BuffLevelRestrictions) && !spelltar->CheckSpellLevelRestriction(spell_id)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); @@ -3721,7 +3721,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_type != 1) // AA is handled differently Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); @@ -3825,14 +3825,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r safe_delete(action_packet); safe_delete(message_packet); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); return true; } void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) @@ -4005,7 +4005,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) //this spell like 10 times, this could easily be consolidated //into one loop through with a switch statement. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); if(!IsValidSpell(spell_id)) return true; @@ -4016,7 +4016,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(IsMezSpell(spell_id)) { if(GetSpecialAbility(UNMEZABLE)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); caster->Message_StringID(MT_Shout, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4034,7 +4034,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if((GetLevel() > spells[spell_id].max[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL); return true; } @@ -4043,7 +4043,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // slow and haste spells if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); caster->Message_StringID(MT_Shout, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4059,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4070,13 +4070,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) return true; } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id); if (aggro > 0) { @@ -4090,7 +4090,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) { Message(13, "Your are immune to fear."); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } @@ -4100,7 +4100,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNCHARMABLE)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); caster->Message_StringID(MT_Shout, CANNOT_CHARM); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4113,7 +4113,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); caster->Message(MT_Shout, "You cannot charm yourself."); return true; } @@ -4126,7 +4126,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) assert(effect_index >= 0); if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_CHARM_YET); return true; } @@ -4140,7 +4140,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) ) { if(GetSpecialAbility(UNSNAREABLE)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); caster->Message_StringID(MT_Shout, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4156,7 +4156,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); caster->Message_StringID(MT_Shout, CANT_DRAIN_SELF); return true; } @@ -4166,13 +4166,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); caster->Message_StringID(MT_Shout, CANNOT_SAC_SELF); return true; } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); return false; } @@ -4209,7 +4209,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use if(GetSpecialAbility(IMMUNE_MAGIC)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); return(0); } @@ -4230,7 +4230,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int fear_resist_bonuses = CalcFearResistChance(); if(zone->random.Roll(fear_resist_bonuses)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); return 0; } } @@ -4248,7 +4248,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int resist_bonuses = CalcResistChanceBonus(); if(resist_bonuses && zone->random.Roll(resist_bonuses)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); return 0; } } @@ -4256,7 +4256,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get the resist chance for the target if(resist_type == RESIST_NONE) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); return 100; } @@ -4822,7 +4822,7 @@ void Client::MemSpell(uint16 spell_id, int slot, bool update_client) } m_pp.mem_spells[slot] = spell_id; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); database.SaveCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4837,7 +4837,7 @@ void Client::UnmemSpell(int slot, bool update_client) if(slot > MAX_PP_MEMSPELL || slot < 0) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); m_pp.mem_spells[slot] = 0xFFFFFFFF; database.DeleteCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4870,7 +4870,7 @@ void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client) m_pp.spell_book[slot] = spell_id; database.SaveCharacterSpell(this->CharacterID(), spell_id, slot); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); if(update_client) { @@ -4883,7 +4883,7 @@ void Client::UnscribeSpell(int slot, bool update_client) if(slot >= MAX_PP_SPELLBOOK || slot < 0) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); m_pp.spell_book[slot] = 0xFFFFFFFF; database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[slot], slot); @@ -4914,7 +4914,7 @@ void Client::UntrainDisc(int slot, bool update_client) if(slot >= MAX_PP_DISCIPLINES || slot < 0) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); m_pp.disciplines.values[slot] = 0; database.DeleteCharacterDisc(this->CharacterID(), slot); @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } @@ -5040,7 +5040,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "FindType: type = %d; value = %d; threshold = %d", type, value, threshold); if (value < threshold) @@ -5089,23 +5089,23 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; PermaProcs[i].base_spellID = base_spell_id; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); } else { for (i = 0; i < MAX_PROCS; i++) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; SpellProcs[i].base_spellID = base_spell_id;; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); } return false; } @@ -5116,7 +5116,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].chance = 0; SpellProcs[i].base_spellID = SPELL_UNKNOWN; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); } } return true; @@ -5133,7 +5133,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id DefensiveProcs[i].spellID = spell_id; DefensiveProcs[i].chance = iChance; DefensiveProcs[i].base_spellID = base_spell_id; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5148,7 +5148,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) DefensiveProcs[i].spellID = SPELL_UNKNOWN; DefensiveProcs[i].chance = 0; DefensiveProcs[i].base_spellID = SPELL_UNKNOWN; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); } } return true; @@ -5165,7 +5165,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id) RangedProcs[i].spellID = spell_id; RangedProcs[i].chance = iChance; RangedProcs[i].base_spellID = base_spell_id; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5180,7 +5180,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) RangedProcs[i].spellID = SPELL_UNKNOWN; RangedProcs[i].chance = 0; RangedProcs[i].base_spellID = SPELL_UNKNOWN;; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); } } return true; @@ -5211,7 +5211,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) int Mob::GetCasterLevel(uint16 spell_id) { int level = GetLevel(); level += itembonuses.effective_casting_level + spellbonuses.effective_casting_level + aabonuses.effective_casting_level; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); return(level); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 56fd8f1e6..97000189b 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() { int taskID = atoi(row[1]); TaskSets[taskSet].push_back(taskID); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); } return true; @@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() { bool TaskManager::LoadSingleTask(int TaskID) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false; @@ -115,21 +115,21 @@ bool TaskManager::LoadSingleTask(int TaskID) { void TaskManager::ReloadGoalLists() { if(!GoalListManager.LoadLists()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); } bool TaskManager::LoadTasks(int singleTask) { // If TaskID !=0, then just load the task specified. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); std::string query; if(singleTask == 0) { if(!GoalListManager.LoadLists()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); if(!LoadTaskSets()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, " "`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, " @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->SequenceMode = ActivitiesSequential; Tasks[taskID]->LastStep = 0; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward, Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel, Tasks[taskID]->Repeatable ? "Yes" : "No"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]); Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " "GoalMethod: %i, GoalCount: %3i, ZoneID:%3i", Tasks[taskID]->ActivityCount, activityID, taskID, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type, @@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); Tasks[taskID]->ActivityCount++; } @@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { int characterID = c->CharacterID(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { for(int task=0; taskActiveTasks[task].Updated) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) " "VALUES (%i, %i, %i, %i)", characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(!state->ActiveTasks[task].Activity[activityIndex].Updated) continue; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", characterID, task, activityIndex); if(updatedActivityCount==0) @@ -358,11 +358,11 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(updatedActivityCount == 0) continue; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { for(unsigned int i=state->LastCompletedTaskLoaded; iCompletedTasks.size(); i++) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); int taskID = state->CompletedTasks[i].TaskID; if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr)) @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -459,14 +459,14 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTaskCount = 0; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` " "FROM `character_tasks` " "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { ++state->ActiveTaskCount; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); } // Load Activities - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` " "FROM `character_activities` " @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,12 +634,12 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); state->EnabledTasks.push_back(taskID); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); } // Check that there is an entry in the client task state for every activity in each task @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); return true; } @@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { } } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); for(unsigned int i=0; iGetLevel(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, state->EnabledTasks.size()); if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return; @@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if(TaskSets[TaskSetID][0] == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); std::vector::iterator Iterator = TaskSets[TaskSetID].begin(); while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) { @@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) && (TaskListIndex < MAXCHOOSERENTRIES)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex, TaskSets[TaskSetID][TaskSetIndex]); @@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task return; } // Titanium OpCode: 0x5e7c - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); char *Ptr; int PlayerLevel = c->GetLevel(); @@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); int PlayerLevel = c->GetLevel(); @@ -1275,16 +1275,16 @@ int ClientTaskState::GetActiveTaskID(int index) { static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); } bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { @@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first // activity as active if not complete. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode); if(Task->SequenceMode == ActivitiesSequential) { @@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) { if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTasks.push_back(cti); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); return AllActivitiesComplete; } @@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { bool CurrentStepComplete = true; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); // If CurrentStep is -1, this is the first call to this method since loading the // client state. Unlock all activities with a step number of 0 if(ActiveTasks[TaskIndex].CurrentStep == -1) { @@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // If we are only keeping one completed record per task, and the player has done // the same task again, erase the previous completed entry for this task. if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI int Ret = false; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); // If the client has no tasks, there is nothing further to check. @@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(Task->Activity[j].Type != ActivityType) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID); continue; } @@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI continue; } // We found an active task to kill this type of NPC, so increment the done count - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); IncrementDoneCount(c, Task, i, j); Ret = true; } @@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI // If the client has no tasks, there is nothing further to check. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); if(ActiveTaskCount == 0) return; @@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(Task->Activity[j].Type != (int)Type) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", c->GetName(), Type, ItemID); continue; } @@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI continue; } // We found an active task related to this item, so increment the done count - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); IncrementDoneCount(c, Task, i, j, Count); } } @@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { // If the client has no tasks, there is nothing further to check. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityExplore) continue; if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", c->GetName(), ExploreID); continue; } @@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { } // We found an active task to explore this area, so set done count to goal count // (Only a goal count of 1 makes sense for explore activities?) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); @@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i bool Ret = false; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); if(ActiveTaskCount == 0) return false; @@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i (Task->Activity[j].Type != ActivityGiveCash)) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID); continue; } @@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i // Is the activity related to these items ? // if((Task->Activity[j].Type == ActivityGiveCash) && Cash) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); IncrementDoneCount(c, Task, i, j, Cash); Ret = true; } @@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i continue; } // We found an active task related to this item, so increment the done count - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); IncrementDoneCount(c, Task, i, j, 1); Ret = true; } @@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { // If the client has no tasks, there is nothing further to check. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityTouch) continue; if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue; if(Task->Activity[j].ZoneID != ZoneID) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", c->GetName()); continue; } // We found an active task to zone into this zone, so set done count to goal count // (Only a goal count of 1 makes sense for touch activities?) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); } @@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { } void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count; @@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true; // Have we reached the goal count for this activity ? if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount, Task->Activity[ActivityID].GoalCount, ActivityID); @@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); // and by the 'Task Stage Completed' message c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex); // Send the updated task/activity list to the client @@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) { void ClientTaskState::FailTask(Client *c, int TaskID) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); if(ActiveTaskCount == 0) return; for(int i=0; i= Task->ActivityCount) return false; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State); @@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update); } void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0; @@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) { if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1; for(unsigned int i=0; iunknown5 = 0x00000001; tac->unknown5 = 0; // 0 for task complete or failed. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); @@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) if(State->CompletedTasks.size() > 50) FirstTaskToSend = State->CompletedTasks.size() - 50; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend); /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { @@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, @@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, TaskComplete); @@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->SequenceNumber = SequenceNumber; cts->unknown4 = 0x00000002; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); @@ -2932,24 +2932,24 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { int characterID = c->CharacterID(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY; ActiveTaskCount--; @@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { // int FreeSlot = -1; for(int i=0; iProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } @@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() { bool TaskGoalListManager::LoadLists() { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); for(int i=0; i< NumberOfLists; i++) safe_delete_array(TaskGoalLists[i].GoalItemEntries); @@ -3088,12 +3088,12 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } NumberOfLists = results.RowCount(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); TaskGoalLists = new TaskGoalList_Struct[NumberOfLists]; @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3207,7 +3207,7 @@ std::vector TaskGoalListManager::GetListContents(int ListID) { bool TaskGoalListManager::IsInList(int ListID, int Entry) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); int ListIndex = GetListByID(ListID); @@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) { else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry]) LastEntry = MiddleEntry - 1; else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); return true; } @@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() { bool TaskProximityManager::LoadProximities(int zoneID) { TaskProximity proximity; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); TaskProximities.clear(); std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, " @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) { TaskProximity* P = &TaskProximities[i]; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ); if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY || diff --git a/zone/titles.cpp b/zone/titles.cpp index 68ae958ae..e6a268607 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index a83647a83..946d595fc 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { //handle caps if(spec->nofail) { chance = 100; //cannot fail. - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); } else if(over_trivial >= 0) { // At reaching trivial the chance goes to 95% going up an additional // percent for every 40 skillpoints above the trivial. @@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { chance = 95; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); float res = zone->random.Real(0, 99); int aa_chance = 0; @@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); itr = spec->onsuccess.begin(); while(itr != spec->onsuccess.end() && !spec->quest) { @@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(MT_Emote,TRADESKILL_FAILED); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); @@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float NotifyNewTitlesAvailable(); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); } bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,12 +1477,12 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if (results.RowCount() != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index 16c0d7e49..c7e370ade 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -86,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (!owner || !owner->IsClient()) { // This should never happen - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); return; } @@ -126,7 +126,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { inst2->SetCharges(stack_size + inst2->GetCharges()); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); if (_stack_size > 0) inst->SetCharges(_stack_size); @@ -143,7 +143,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { SendItemData(inst, trade_slot_id); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); client->DeleteItemInInventory(MainCursor); @@ -296,7 +296,7 @@ void Trade::LogTrade() void Trade::DumpTrade() { Mob* with = With(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) @@ -307,7 +307,7 @@ void Trade::DumpTrade() const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", inst->GetItem()->ID, inst->GetCharges(), i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); @@ -315,7 +315,7 @@ void Trade::DumpTrade() for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", inst->GetItem()->ID, inst->GetCharges(), Inventory::CalcSlotId(i, j)); } @@ -324,7 +324,7 @@ void Trade::DumpTrade() } } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); } #endif @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; if (partial_inst->GetID() != inst->GetID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -458,7 +458,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st bool qs_log = false; if(other) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); this->AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true); @@ -491,7 +491,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -552,17 +552,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; if (partial_inst->GetID() != inst->GetID()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -606,10 +606,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st inst->SetCharges(0); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); if (other->PutItemInInventory(partial_slot, *partial_inst, true)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, (old_charges - inst->GetCharges())); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -635,7 +635,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName(), (old_charges - inst->GetCharges())); inst->SetCharges(old_charges); @@ -710,7 +710,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -718,7 +718,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -772,17 +772,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -1160,7 +1160,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) { const Item_Struct* item = database.GetItem(ItemID); if(!item){ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); return; } @@ -1219,10 +1219,10 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } @@ -1245,7 +1245,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); return nullptr; } @@ -1302,7 +1302,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ } } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", SerialNumber , Quantity, this->GetName()); return 0; @@ -1311,7 +1311,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Customer,uint16 TraderSlot, int SerialNumber) { if(!Customer) return; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); if(Quantity < Charges) { Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber); m_inv.DeleteItem(Slot, Quantity); @@ -1395,7 +1395,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* if(!Stackable) Quantity = (Charges > 0) ? Charges : 1; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); } if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){ this->DeleteItemInInventory(SlotID, Quantity); @@ -1431,7 +1431,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* } } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, Quantity,this->GetName()); } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1510,13 +1510,13 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat const ItemInst* BuyItem = Trader->FindTraderItemBySerialNumber(tbs->ItemID); if(!BuyItem) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); TradeRequestFailed(app); safe_delete(outapp); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", BuyItem->GetItem()->Name, BuyItem->IsStackable(), tbs->Quantity, BuyItem->GetCharges()); // If the item is not stackable, then we can only be buying one of them. if(!BuyItem->IsStackable()) @@ -1534,12 +1534,12 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat outtbs->Quantity = tbs->Quantity; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); @@ -1836,11 +1836,11 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); int Size = 0; uint32 ID = 0; @@ -1887,7 +1887,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint VARSTRUCT_ENCODE_TYPE(uint32, bufptr, ID); } else{ - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0); } Cost = atoi(row[5]); @@ -1981,7 +1981,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(inst->IsStackable()) inst->SetMerchantCount(gis->Charges[i]); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor? @@ -2018,7 +2018,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St if(gis->ItemID[i] == ItemID) { tdis->ItemID = gis->SerialNumber[i]; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); _pkt(TRADING__PACKETS, outapp); @@ -2031,7 +2031,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St return; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); ItemInst* inst = database.CreateItem(item); @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantSlot(gis->SerialNumber[i]); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor?? @@ -2073,7 +2073,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { // TraderPriceUpdate_Struct* tpus = (TraderPriceUpdate_Struct*)app->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", GetName(), tpus->SerialNumber, tpus->NewPrice); // Pull the items this Trader currently has for sale from the trader table. @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); if(!gis) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); return; } @@ -2101,7 +2101,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((gis->ItemID[i] > 0) && (gis->SerialNumber[i] == tpus->SerialNumber)) { // We found the item that the Trader wants to change the price of (or add back up for sale). // - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); IDOfItemToUpdate = gis->ItemID[i]; @@ -2127,7 +2127,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { return ; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); // Find what is in their Trader Satchels GetItems_Struct* newgis=GetTraderItems(); @@ -2140,7 +2140,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((newgis->Items[i] > 0) && (newgis->SerialNumber[i] == tpus->SerialNumber)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], newgis->Charges[i]); IDOfItemToAdd = newgis->Items[i]; @@ -2158,7 +2158,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if(!IDOfItemToAdd || !item) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); @@ -2203,7 +2203,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { gis->SerialNumber[i] = newgis->SerialNumber[i]; gis->ItemCost[i] = tpus->NewPrice; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", GetName(), newgis->Items[i], newgis->SerialNumber[i], newgis->Charges[i], tpus->NewPrice, i); } @@ -2249,7 +2249,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { QueuePacket(app); if(OldPrice == tpus->NewPrice) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); safe_delete(gis); return; } @@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { // This method is called when a potential seller in the /barter window searches for matching buyers // - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); char* escSearchString = new char[strlen(searchString) * 2 + 1]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2515,7 +2515,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Quantity = i; break; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2523,7 +2523,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); if(ItemToTransfer) @@ -2561,7 +2561,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { int16 SellerSlot = m_inv.HasItem(ItemID, 1, invWhereWorn|invWherePersonal|invWhereCursor); if (SellerSlot == INVALID_INDEX) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2569,7 +2569,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2581,7 +2581,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { QuantityMoved += ItemToTransfer->GetCharges(); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2616,7 +2616,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemToTransfer->SetCharges(QuantityToRemoveFromStack); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2855,11 +2855,11 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { bool LoreConflict = CheckLoreConflict(item); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", GetName(), BuySlot, ItemID, item->Name, Quantity, ToggleOnOff, Price, ItemCount, LoreConflict); if((item->NoDrop != 0) && !LoreConflict && (Quantity > 0) && HasMoney(Quantity * Price) && ToggleOnOff && (ItemCount == 0)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); database.AddBuyLine(CharacterID(), BuySlot, ItemID, ItemName, Quantity, Price); QueuePacket(app); } diff --git a/zone/trap.cpp b/zone/trap.cpp index 6efb00517..ac4361fe0 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 82b1bb4f7..014fd8773 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index f574802b6..82cc2936a 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -88,7 +88,7 @@ void NPC::StopWandering() roamer=false; CastToNPC()->SetGrid(0); SendPosition(); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); return; } @@ -107,16 +107,16 @@ void NPC::ResumeWandering() cur_wp=save_wp; UpdateWaypoint(cur_wp); // have him head to last destination from here } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); } else if (AIwalking_timer->Enabled()) { // we are at a waypoint paused normally - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); AIwalking_timer->Trigger(); // disable timer to end pause now } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -143,7 +143,7 @@ void NPC::PauseWandering(int pausetime) if (GetGrid() != 0) { DistractedFromGrid = true; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); SendPosition(); if (pausetime<1) { // negative grid number stops him dead in his tracks until ResumeWandering() @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -166,7 +166,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if (GetGrid() < 0) { // currently stopped by a quest command SetGrid( 0 - GetGrid()); // get him moving again - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); } AIwalking_timer->Disable(); // disable timer in case he is paused at a wp if (cur_wp>=0) @@ -174,14 +174,14 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) save_wp=cur_wp; // save the current waypoint cur_wp=-1; // flag this move as quest controlled } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); } else { // not on a grid roamer=true; save_wp=0; cur_wp=-2; // flag as quest controlled w/no grid - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); } if (saveguardspot) { @@ -196,7 +196,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if(guard_heading == -1) guard_heading = this->CalculateHeadingToTarget(mtx, mty); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } cur_wp_x = mtx; @@ -212,7 +212,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) void NPC::UpdateWaypoint(int wp_index) { if(wp_index >= static_cast(Waypoints.size())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); return; } std::vector::iterator cur; @@ -224,7 +224,7 @@ void NPC::UpdateWaypoint(int wp_index) cur_wp_z = cur->z; cur_wp_pause = cur->pause; cur_wp_heading = cur->heading; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); //fix up pathing Z if(zone->HasMap() && RuleB(Map, FixPathingZAtWaypoints)) @@ -430,7 +430,7 @@ void NPC::SetWaypointPause() void NPC::SaveGuardSpot(bool iClearGuardSpot) { if (iClearGuardSpot) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); guard_x = 0; guard_y = 0; guard_z = 0; @@ -443,14 +443,14 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) { guard_heading = heading; if(guard_heading == 0) guard_heading = 0.0001; //hack to make IsGuarding simpler - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } } void NPC::NextGuardPosition() { if (!CalculateNewPosition2(guard_x, guard_y, guard_z, GetMovespeed())) { SetHeading(guard_heading); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); } else if((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z)) { @@ -516,15 +516,15 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords if(z_pos-z != 0) { z_pos = z; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); return true; } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); return false; } else if ((ABS(x_pos - x) < 0.1) && (ABS(y_pos - y) < 0.1)) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); if(IsNPC()) { entity_list.ProcessMove(CastToNPC(), x, y, z); @@ -550,7 +550,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); uint8 NPCFlyMode = 0; @@ -569,7 +569,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -612,7 +612,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b //pRunAnimSpeed = (int8)(speed*NPC_RUNANIM_RATIO); //speed *= NPC_SPEED_MULTIPLIER; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -647,7 +647,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b z_pos = new_z; tar_ndx=22-numsteps; heading = CalculateHeadingToTarget(x, y); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } else { @@ -659,7 +659,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = y; z_pos = z; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); } } @@ -678,7 +678,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; heading = CalculateHeadingToTarget(x, y); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } uint8 NPCFlyMode = 0; @@ -698,7 +698,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -759,7 +759,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec moved=false; } SetRunAnimSpeed(0); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); return true; } @@ -773,7 +773,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec pRunAnimSpeed = (uint8)(speed*NPC_RUNANIM_RATIO); speed *= NPC_SPEED_MULTIPLIER; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -790,7 +790,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = x; y_pos = y; z_pos = z; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); } else { float new_x = x_pos + tar_vx*tar_vector; @@ -803,7 +803,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = new_x; y_pos = new_y; z_pos = new_z; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); } uint8 NPCFlyMode = 0; @@ -823,7 +823,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -951,7 +951,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { x_pos = new_x; y_pos = new_y; z_pos = new_z; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); if(flymode == FlyMode1) return; @@ -967,7 +967,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -998,7 +998,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 50dff0073..8043954fc 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,12 +155,12 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); ZoneConfig::SetZonePort(sci->port); break; } case ServerOP_ZAAuthFailed: { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; @@ -386,12 +386,12 @@ void WorldServer::Process() { } } else { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); } } else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); break; } case ServerOP_EmoteMessage: { @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -748,7 +748,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - Log.DoLog(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); + Log.Out(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); @@ -1381,7 +1381,7 @@ void WorldServer::Process() { if(NewCorpse) NewCorpse->Spawn(); else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); break; } @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret; @@ -2005,14 +2005,14 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) { ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); switch(rts->Command) { case RELOADTASKS: entity_list.SaveAllClientsTaskState(); if(rts->Parameter == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); safe_delete(taskmanager); taskmanager = new TaskManager; taskmanager->LoadTasks(); @@ -2021,7 +2021,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) entity_list.ReloadAllClientsTaskState(); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); taskmanager->LoadTasks(rts->Parameter); entity_list.ReloadAllClientsTaskState(rts->Parameter); } @@ -2030,23 +2030,23 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) case RELOADTASKPROXIMITIES: if(zone) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); taskmanager->LoadProximities(zone->GetZoneID()); } break; case RELOADTASKGOALLISTS: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); taskmanager->ReloadGoalLists(); break; case RELOADTASKSETS: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); taskmanager->LoadTaskSets(); break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); } @@ -2061,7 +2061,7 @@ uint32 WorldServer::NextGroupID() { if(cur_groupid >= last_groupid) { //this is an error... This means that 50 groups were created before //1 packet could make the zone->world->zone trip... so let it error. - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); return(0); } if(cur_groupid > (last_groupid - /*50*/995)) { diff --git a/zone/zone.cpp b/zone/zone.cpp index f9276f8df..1ae1d237b 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -90,7 +90,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); zone->merchantvar = log_levels[1]; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); zone->tradevar = log_levels[2]; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); zone->lootvar = log_levels[3]; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); } else { zone->loglevelvar = uint8(atoi(tmp)); //continue supporting only command logging (for now) @@ -144,8 +144,8 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { delete pack; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); @@ -167,11 +167,11 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Objects from DB..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Objects from DB..."); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { @@ -288,7 +288,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name=0; @@ -402,7 +402,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -474,7 +474,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Merchant Lists..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() { std::map >::iterator cur; uint32 npcid = 0; if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); return; } for (auto row = results.begin(); row != results.end(); ++row) { @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); return; } @@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){ } if(MERC_DEBUG > 0) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); } @@ -707,11 +707,11 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); ZoneLoaded = false; zone->ResetAuth(); @@ -725,19 +725,19 @@ void Zone::Shutdown(bool quite) void Zone::LoadZoneDoors(const char* zone, int16 version) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading doors for %s ...", zone); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading doors for %s ...", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "... No doors loaded."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "... No doors loaded."); return; } Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load doors."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load doors."); delete[] dlist; return; } @@ -801,12 +801,12 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); if(graveyard_id() > 0) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); if(GraveYardLoaded) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); Weather_Timer = new Timer(60000); Weather_Timer->Start(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); zone_weather = 0; weather_intensity = 0; blocked_spells = nullptr; @@ -899,56 +899,56 @@ Zone::~Zone() { bool Zone::Init(bool iStaticZone) { SetStaticZone(iStaticZone); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn groups failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn groups failed."); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn2 points failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn2 points failed."); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading player corpses failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading player corpses failed."); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading traps failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading traps failed."); return false; } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading adventure flavor text..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading adventure flavor text..."); LoadAdventureFlavor(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading World Objects failed. continuing."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1005,10 +1005,10 @@ bool Zone::Init(bool iStaticZone) { } } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading timezone data..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading timezone data..."); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1019,32 +1019,32 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading Zone Static Data..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading Zone Static Data..."); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading traps failed."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading traps failed."); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1060,7 +1060,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Static Data Reloaded."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Static Data Reloaded."); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault) @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); return false; } } @@ -1098,7 +1098,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Successfully loaded Zone Config."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Successfully loaded Zone Config."); return true; } @@ -1403,11 +1403,11 @@ void Zone::ChangeWeather() weathertimer = weatherTimerRule*1000; Weather_Timer->Start(weathertimer); } - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); this->weatherSend(); } } @@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) { quest_manager.ClearAllTimers(); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); initgrids_timer.Start(); @@ -1580,8 +1580,8 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien { if(client) client->CheatDetected(MQZoneUnknownDest, x, y, z); // Someone is trying to use /zone - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); } if(closest_dist > max_distance2) @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load blocked spells."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 0f960d8c2..18c357bc2 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -523,14 +523,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } loadti->Code = BazaarTrader_ShowItems; for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -548,13 +548,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); return loadti; } for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -574,7 +574,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { return nullptr; if (results.RowCount() == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); return nullptr; } @@ -587,7 +587,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { const Item_Struct *item = database.GetItem(ItemID); if(!item) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); fflush(stdout); return nullptr; } @@ -597,7 +597,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { ItemInst* inst = database.CreateItem(item); if(!inst) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); fflush(stdout); return nullptr; } @@ -619,25 +619,25 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i", Charges, CharID, SerialNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", SerialNumber, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); const Item_Struct *item = database.GetItem(ItemID); @@ -645,12 +645,12 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg return; if(NewPrice == 0) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 char_id){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); return; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { @@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteBuyLines(uint32 CharID) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); return; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); } @@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons CharID, BuySlot, ItemID, ItemName, Quantity, Price); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity) std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); return true; } @@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u /* Save Home Bind Point */ std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } @@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i uint8 blue = (color & 0x000000FF); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); return true; } bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); return true; } bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); auto results = QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); return true; } @@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); } } return true; @@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } @@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla m_epp->expended_aa ); auto results = database.QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); return true; } @@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru pp->currentEbonCrystals, pp->careerEbonCrystals); auto results = database.QueryDatabase(query); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); return true; } @@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur " VALUES (%u, %u, %u)", character_id, aa_id, current_level); auto results = QueryDatabase(rquery); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2696,7 +2696,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Blocked Spells from database..."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Blocked Spells from database..."); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapCharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 0c8e8de98..8797ed7fa 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -44,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { zoning = true; if (app->size != sizeof(ZoneChange_Struct)) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); return; } #if EQDEBUG >= 5 - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); DumpPacket(app); #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -193,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { switch(zone_mode) { case EvacToSafeCoords: case ZoneToSafeCoords: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); dest_x = safe_x; dest_y = safe_y; dest_z = safe_z; @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -347,7 +347,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -534,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z heading = m_pp.binds[0].heading; zonesummon_ignorerestrictions = 1; - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); break; case SummonPC: zonesummon_x = x_pos = x; @@ -543,14 +543,14 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; case Rewind: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); zonesummon_x = x_pos = x; zonesummon_y = y_pos = y; zonesummon_z = z_pos = z; SetHeading(heading); break; default: - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z safe_delete(outapp); } - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); //Clear zonesummon variables if we're zoning to our own zone //Client wont generate a zone change packet to the server in this case so //They aren't needed and it keeps behavior on next zone attempt from being undefined. @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.DoLog(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //this should not happen... - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); return(false); } if(GetLevel() < minlevel) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); return(false); } if(Admin() < minstatus) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); return(false); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { - Log.DoLog(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); + Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); return(false); } } From 467b359d0cf02b48e7e4762a93f739bce1147ccb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:20:16 -0600 Subject: [PATCH 179/707] Moved all EQEmuLogSys:: enum references used in Log.Out to a namespace 'Logs' for shortening of syntax --- client_files/export/main.cpp | 30 +-- client_files/import/main.cpp | 28 +- common/crash.cpp | 44 +-- common/database.cpp | 34 +-- common/eq_stream.cpp | 242 ++++++++--------- common/eq_stream_factory.cpp | 8 +- common/eq_stream_ident.cpp | 22 +- common/eqemu_logsys.cpp | 14 +- common/eqemu_logsys.h | 100 +++---- common/eqtime.cpp | 6 +- common/guild_base.cpp | 132 ++++----- common/item.cpp | 2 +- common/misc_functions.h | 2 +- common/patches/rof.cpp | 88 +++--- common/patches/rof2.cpp | 88 +++--- common/patches/sod.cpp | 58 ++-- common/patches/sof.cpp | 28 +- common/patches/ss_define.h | 8 +- common/patches/titanium.cpp | 22 +- common/patches/underfoot.cpp | 58 ++-- common/ptimer.cpp | 14 +- common/rulesys.cpp | 36 +-- common/shareddb.cpp | 106 ++++---- common/spdat.cpp | 2 +- common/struct_strategy.cpp | 4 +- common/tcp_connection.cpp | 4 +- common/tcp_server.cpp | 4 +- common/timeoutmgr.cpp | 6 +- common/worldconn.cpp | 4 +- eqlaunch/eqlaunch.cpp | 18 +- eqlaunch/worldserver.cpp | 18 +- eqlaunch/zone_launch.cpp | 46 ++-- queryserv/database.cpp | 60 ++--- queryserv/lfguild.cpp | 14 +- queryserv/queryserv.cpp | 16 +- queryserv/worldserver.cpp | 6 +- shared_memory/main.cpp | 34 +-- ucs/chatchannel.cpp | 32 +-- ucs/clientlist.cpp | 78 +++--- ucs/database.cpp | 90 +++---- ucs/ucs.cpp | 26 +- ucs/worldserver.cpp | 8 +- world/adventure.cpp | 4 +- world/adventure_manager.cpp | 6 +- world/client.cpp | 168 ++++++------ world/cliententry.cpp | 2 +- world/clientlist.cpp | 14 +- world/console.cpp | 24 +- world/eql_config.cpp | 22 +- world/eqw.cpp | 6 +- world/eqw_http_handler.cpp | 18 +- world/eqw_parser.cpp | 6 +- world/launcher_link.cpp | 24 +- world/launcher_list.cpp | 10 +- world/login_server.cpp | 32 +-- world/login_server_list.cpp | 2 +- world/net.cpp | 116 ++++---- world/queryserv.cpp | 12 +- world/ucs.cpp | 12 +- world/wguild_mgr.cpp | 26 +- world/worlddb.cpp | 18 +- world/zonelist.cpp | 8 +- world/zoneserver.cpp | 88 +++--- zone/aa.cpp | 46 ++-- zone/aggro.cpp | 22 +- zone/attack.cpp | 174 ++++++------ zone/bonuses.cpp | 6 +- zone/bot.cpp | 116 ++++---- zone/botspellsai.cpp | 4 +- zone/client.cpp | 70 ++--- zone/client_mods.cpp | 12 +- zone/client_packet.cpp | 510 +++++++++++++++++------------------ zone/client_process.cpp | 24 +- zone/command.cpp | 64 ++--- zone/corpse.cpp | 8 +- zone/doors.cpp | 16 +- zone/effects.cpp | 2 +- zone/embparser.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embperl.cpp | 10 +- zone/embxs.cpp | 6 +- zone/entity.cpp | 14 +- zone/exp.cpp | 8 +- zone/fearpath.cpp | 4 +- zone/forage.cpp | 6 +- zone/groups.cpp | 36 +-- zone/guild.cpp | 20 +- zone/guild_mgr.cpp | 48 ++-- zone/horse.cpp | 6 +- zone/inventory.cpp | 154 +++++------ zone/loottables.cpp | 4 +- zone/merc.cpp | 16 +- zone/mob.cpp | 6 +- zone/mob_ai.cpp | 20 +- zone/net.cpp | 108 ++++---- zone/npc.cpp | 20 +- zone/object.cpp | 8 +- zone/pathing.cpp | 146 +++++----- zone/perl_client.cpp | 16 +- zone/petitions.cpp | 10 +- zone/pets.cpp | 16 +- zone/questmgr.cpp | 30 +-- zone/raids.cpp | 22 +- zone/spawn2.cpp | 152 +++++------ zone/spawngroup.cpp | 8 +- zone/special_attacks.cpp | 58 ++-- zone/spell_effects.cpp | 32 +-- zone/spells.cpp | 352 ++++++++++++------------ zone/tasks.cpp | 252 ++++++++--------- zone/titles.cpp | 12 +- zone/tradeskills.cpp | 82 +++--- zone/trading.cpp | 122 ++++----- zone/trap.cpp | 2 +- zone/tribute.cpp | 10 +- zone/waypoints.cpp | 108 ++++---- zone/worldserver.cpp | 42 +-- zone/zone.cpp | 148 +++++----- zone/zonedb.cpp | 124 ++++----- zone/zoning.cpp | 46 ++-- 119 files changed, 2812 insertions(+), 2808 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 2b3aa1e4e..5152cf008 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -38,22 +38,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Export Utility"); + Log.Out(Logs::General, Logs::Status, "Client Files Export Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Out(Logs::General, Logs::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Out(Logs::General, Logs::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.Out(Logs::General, Logs::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -66,11 +66,11 @@ int main(int argc, char **argv) { } void ExportSpells(SharedDatabase *db) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Spells..."); + Log.Out(Logs::General, Logs::Status, "Exporting Spells..."); FILE *f = fopen("export/spells_us.txt", "w"); if(!f) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/spells_us.txt to write, skipping."); + Log.Out(Logs::General, Logs::Error, "Unable to open export/spells_us.txt to write, skipping."); return; } @@ -94,7 +94,7 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); @@ -108,7 +108,7 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -128,7 +128,7 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -140,11 +140,11 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { } void ExportSkillCaps(SharedDatabase *db) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Skill Caps..."); + Log.Out(Logs::General, Logs::Status, "Exporting Skill Caps..."); FILE *f = fopen("export/SkillCaps.txt", "w"); if(!f) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/SkillCaps.txt to write, skipping."); + Log.Out(Logs::General, Logs::Error, "Unable to open export/SkillCaps.txt to write, skipping."); return; } @@ -169,11 +169,11 @@ void ExportSkillCaps(SharedDatabase *db) { } void ExportBaseData(SharedDatabase *db) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Exporting Base Data..."); + Log.Out(Logs::General, Logs::Status, "Exporting Base Data..."); FILE *f = fopen("export/BaseData.txt", "w"); if(!f) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open export/BaseData.txt to write, skipping."); + Log.Out(Logs::General, Logs::Error, "Unable to open export/BaseData.txt to write, skipping."); return; } @@ -195,7 +195,7 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index e94eed0c9..f390d2b0b 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -36,22 +36,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Client Files Import Utility"); + Log.Out(Logs::General, Logs::Status, "Client Files Import Utility"); if(!EQEmuConfig::LoadConfig()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Out(Logs::General, Logs::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Out(Logs::General, Logs::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.Out(Logs::General, Logs::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -68,7 +68,7 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -76,10 +76,10 @@ int GetSpellColumns(SharedDatabase *db) { } void ImportSpells(SharedDatabase *db) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Spells..."); + Log.Out(Logs::General, Logs::Status, "Importing Spells..."); FILE *f = fopen("import/spells_us.txt", "r"); if(!f) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/spells_us.txt to read, skipping."); + Log.Out(Logs::General, Logs::Error, "Unable to open import/spells_us.txt to read, skipping."); return; } @@ -142,23 +142,23 @@ void ImportSpells(SharedDatabase *db) { spells_imported++; if(spells_imported % 1000 == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.Out(Logs::General, Logs::Status, "%d spells imported.", spells_imported); } } if(spells_imported % 1000 != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "%d spells imported.", spells_imported); + Log.Out(Logs::General, Logs::Status, "%d spells imported.", spells_imported); } fclose(f); } void ImportSkillCaps(SharedDatabase *db) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Skill Caps..."); + Log.Out(Logs::General, Logs::Status, "Importing Skill Caps..."); FILE *f = fopen("import/SkillCaps.txt", "r"); if(!f) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/SkillCaps.txt to read, skipping."); + Log.Out(Logs::General, Logs::Error, "Unable to open import/SkillCaps.txt to read, skipping."); return; } @@ -190,11 +190,11 @@ void ImportSkillCaps(SharedDatabase *db) { } void ImportBaseData(SharedDatabase *db) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Importing Base Data..."); + Log.Out(Logs::General, Logs::Status, "Importing Base Data..."); FILE *f = fopen("import/BaseData.txt", "r"); if(!f) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to open import/BaseData.txt to read, skipping."); + Log.Out(Logs::General, Logs::Error, "Unable to open import/BaseData.txt to read, skipping."); return; } diff --git a/common/crash.cpp b/common/crash.cpp index 283dba9c5..fee4dcddf 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -25,7 +25,7 @@ public: } } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, buffer); + Log.Out(Logs::General, Logs::Crash, buffer); StackWalker::OnOutput(szText); } }; @@ -35,67 +35,67 @@ LONG WINAPI windows_exception_handler(EXCEPTION_POINTERS *ExceptionInfo) switch(ExceptionInfo->ExceptionRecord->ExceptionCode) { case EXCEPTION_ACCESS_VIOLATION: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ACCESS_VIOLATION"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ACCESS_VIOLATION"); break; case EXCEPTION_ARRAY_BOUNDS_EXCEEDED: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ARRAY_BOUNDS_EXCEEDED"); break; case EXCEPTION_BREAKPOINT: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_BREAKPOINT"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_BREAKPOINT"); break; case EXCEPTION_DATATYPE_MISALIGNMENT: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_DATATYPE_MISALIGNMENT"); break; case EXCEPTION_FLT_DENORMAL_OPERAND: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_DENORMAL_OPERAND"); break; case EXCEPTION_FLT_DIVIDE_BY_ZERO: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_DIVIDE_BY_ZERO"); break; case EXCEPTION_FLT_INEXACT_RESULT: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_INEXACT_RESULT"); break; case EXCEPTION_FLT_INVALID_OPERATION: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_INVALID_OPERATION"); break; case EXCEPTION_FLT_OVERFLOW: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_OVERFLOW"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_OVERFLOW"); break; case EXCEPTION_FLT_STACK_CHECK: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_STACK_CHECK"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_STACK_CHECK"); break; case EXCEPTION_FLT_UNDERFLOW: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_FLT_UNDERFLOW"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_FLT_UNDERFLOW"); break; case EXCEPTION_ILLEGAL_INSTRUCTION: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_ILLEGAL_INSTRUCTION"); break; case EXCEPTION_IN_PAGE_ERROR: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_IN_PAGE_ERROR"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_IN_PAGE_ERROR"); break; case EXCEPTION_INT_DIVIDE_BY_ZERO: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INT_DIVIDE_BY_ZERO"); break; case EXCEPTION_INT_OVERFLOW: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INT_OVERFLOW"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INT_OVERFLOW"); break; case EXCEPTION_INVALID_DISPOSITION: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_INVALID_DISPOSITION"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_INVALID_DISPOSITION"); break; case EXCEPTION_NONCONTINUABLE_EXCEPTION: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_NONCONTINUABLE_EXCEPTION"); break; case EXCEPTION_PRIV_INSTRUCTION: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_PRIV_INSTRUCTION"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_PRIV_INSTRUCTION"); break; case EXCEPTION_SINGLE_STEP: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_SINGLE_STEP"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_SINGLE_STEP"); break; case EXCEPTION_STACK_OVERFLOW: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "EXCEPTION_STACK_OVERFLOW"); + Log.Out(Logs::General, Logs::Crash, "EXCEPTION_STACK_OVERFLOW"); break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Crash, "Unknown Exception"); + Log.Out(Logs::General, Logs::Crash, "Unknown Exception"); break; } diff --git a/common/database.cpp b/common/database.cpp index ff05ea6df..6ef6c7485 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -84,12 +84,12 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf); return false; } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -706,7 +706,7 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid = GetCharacterID(pp->name); if(!charid) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter: no character id"); + Log.Out(Logs::General, Logs::Error, "StoreCharacter: no character id"); return false; } @@ -736,10 +736,10 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); + Log.Out(Logs::General, Logs::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); #endif } @@ -805,7 +805,7 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -3162,28 +3162,28 @@ void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); } void Database::AddReport(std::string who, std::string against, std::string lines) { @@ -3195,7 +3195,7 @@ void Database::AddReport(std::string who, std::string against, std::string lines safe_delete_array(escape_str); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { @@ -3206,7 +3206,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error deleting character from group id: %s", results.ErrorMessage().c_str()); return; } @@ -3216,7 +3216,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); } void Database::ClearAllGroups(void) @@ -3255,14 +3255,14 @@ uint32 Database::GetGroupID(const char* name){ if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); return 0; } if (results.RowCount() == 0) { // Commenting this out until logging levels can prevent this from going to console - //Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Character not in a group: %s", name); + //Log.Out(Logs::General, Logs::None,, "Character not in a group: %s", name); return 0; } @@ -3309,7 +3309,7 @@ void Database::SetGroupLeaderName(uint32 gid, const char* name) { result = QueryDatabase(query); if(!result.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::None, "Error in Database::SetGroupLeaderName: %s", result.ErrorMessage().c_str()); } } @@ -4049,7 +4049,7 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 7d10917f4..c409e275b 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -81,18 +81,18 @@ void EQStream::init(bool resetSession) { OpMgr = nullptr; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "init Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "init Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, p->size); _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; @@ -101,7 +101,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf, uint32 len) { EQRawApplicationPacket *ap=nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Creating new application packet, length %d" __L, len); + Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len); _hex(NET__APP_CREATE_HEX, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; @@ -132,7 +132,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Session not initialized, packet ignored" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Session not initialized, packet ignored" __L); _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -143,7 +143,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processed < p->size) { subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); + Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -158,12 +158,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) while(processedsize) { EQRawApplicationPacket *ap=nullptr; if ((subpacket_length=(unsigned char)*(p->pBuffer+processed))!=0xff) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+1,subpacket_length); processed+=subpacket_length+1; } else { subpacket_length=ntohs(*(uint16 *)(p->pBuffer+processed+1)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); + Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined app packet of length %d, short len" __L, subpacket_length); ap=MakeApplicationPacket(p->pBuffer+processed+3,subpacket_length); processed+=subpacket_length+3; } @@ -178,29 +178,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Packet: { if(!p->pBuffer || (p->Size() < 4)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Packet that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Packet that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); + Log.Out(Logs::General, Logs::Netcode, "[NET_TRACE] OP_Packet: Removing older queued packet with sequence %d", seq); delete qp; } @@ -209,7 +209,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) // Check for an embedded OP_AppCombinded (protocol level 0x19) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); @@ -228,29 +228,29 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_Fragment: { if(!p->pBuffer || (p->Size() < 4)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Fragment that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Fragment that was of malformed size" __L); break; } uint16 seq=ntohs(*(uint16 *)(p->pBuffer)); SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); //SendOutOfOrderAck(seq); } else if (check == SeqPast) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. EQProtocolPacket *qp=RemoveQueue(seq); if (qp) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); + Log.Out(Logs::General, Logs::Netcode, "[NET_TRACE] OP_Fragment: Removing older queued packet with sequence %d", seq); delete qp; } SetNextAckToSend(seq); @@ -258,18 +258,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (oversize_buffer) { memcpy(oversize_buffer+oversize_offset,p->pBuffer+2,p->size-2); oversize_offset+=p->size-2; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); + Log.Out(Logs::Detail, Logs::Netcode, _L "Fragment of oversized of length %d, seq %d: now at %d/%d" __L, p->size-2, seq, oversize_offset, oversize_length); if (oversize_offset==oversize_length) { if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); //_raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; } else { EQRawApplicationPacket *ap=MakeApplicationPacket(oversize_buffer,oversize_offset); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, completed combined oversize packet of length %d" __L, seq, ap->size); if (ap) { ap->copyInfo(p); InboundQueuePush(ap); @@ -284,7 +284,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) oversize_buffer=new unsigned char[oversize_length]; memcpy(oversize_buffer,p->pBuffer+6,p->size-6); oversize_offset=p->size-6; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); + Log.Out(Logs::Detail, Logs::Netcode, _L "First fragment of oversized of seq %d: now at %d/%d" __L, seq, oversize_offset, oversize_length); } } } @@ -292,14 +292,14 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_KeepAlive: { #ifndef COLLECTOR NonSequencedPush(new EQProtocolPacket(p->opcode,p->pBuffer,p->size)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received and queued reply to keep alive" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received and queued reply to keep alive" __L); #endif } break; case OP_Ack: { if(!p->pBuffer || (p->Size() < 4)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_Ack that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_Ack that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -315,12 +315,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionRequest: { if(p->Size() < sizeof(SessionRequest)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest that was of malformed size" __L); break; } #ifndef COLLECTOR if (GetState()==ESTABLISHED) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest in ESTABLISHED state (%d) streamactive (%i) attempt (%i)" __L, GetState(),streamactive,sessionAttempts); // client seems to try a max of 30 times (initial+3 retries) then gives up, giving it a few more attempts just in case // streamactive means we identified the opcode for the stream, we cannot re-establish this connection @@ -340,7 +340,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SessionRequest *Request=(SessionRequest *)p->pBuffer; Session=ntohl(Request->Session); SetMaxLen(ntohl(Request->MaxLength)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionRequest: session %lu, maxlen %d" __L, (unsigned long)Session, MaxLen); SetState(ESTABLISHED); #ifndef COLLECTOR Key=0x11223344; @@ -351,7 +351,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionResponse: { if(p->Size() < sizeof(SessionResponse)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionResponse that was of malformed size" __L); break; } @@ -367,7 +367,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) compressed=(Response->Format&FLAG_COMPRESSED); encoded=(Response->Format&FLAG_ENCODED); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionResponse: session %lu, maxlen %d, key %lu, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, (unsigned long)Key, compressed?"yes":"no", encoded?"yes":"no"); // Kinda kludgy, but trie for now if (StreamType==UnknownStream) { @@ -390,17 +390,17 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) EQStreamState state = GetState(); if(state == ESTABLISHED) { //client initiated disconnect? - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received unsolicited OP_SessionDisconnect. Treating like a client-initiated disconnect." __L); _SendDisconnect(); SetState(CLOSED); } else if(state == CLOSING) { //we were waiting for this anyways, ignore pending messages, send the reply and be closed. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionDisconnect when we have a pending close, they beat us to it. Were happy though." __L); _SendDisconnect(); SetState(CLOSED); } else { //we are expecting this (or have already gotten it, but dont care either way) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received expected OP_SessionDisconnect. Moving to closed state." __L); SetState(CLOSED); } } @@ -408,7 +408,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_OutOfOrderAck: { if(!p->pBuffer || (p->Size() < 4)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck that was of malformed size" __L); break; } #ifndef COLLECTOR @@ -416,15 +416,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } //if the packet they got out of order is between our last acked packet and the last sent packet, then its valid. if (CompareSequence(SequencedBase,seq) != SeqPast && CompareSequence(NextOutSeq,seq) == SeqPast) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for sequence %d, starting retransmit at the start of our unacked buffer (seq %d, was %d)." __L, seq, SequencedBase, SequencedBase+NextSequencedSend); bool retransmit_acked_packets = false; @@ -435,7 +435,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if(!retransmit_acked_packets) { uint16 sqsize = SequencedQueue.size(); uint16 index = seq - SequencedBase; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); + Log.Out(Logs::Detail, Logs::Netcode, _L "OP_OutOfOrderAck marking packet acked in queue (queue index = %d, queue size = %d)." __L, index, sqsize); if (index < sqsize) { std::deque::iterator sitr; sitr = SequencedQueue.begin(); @@ -450,15 +450,15 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) NextSequencedSend = 0; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfOrderAck for out-of-window %d. Window (%d->%d)." __L, seq, SequencedBase, NextOutSeq); } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Post-OOA Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Post-OOA Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -467,12 +467,12 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) case OP_SessionStatRequest: { if(p->Size() < sizeof(SessionStats)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatRequest that was of malformed size" __L); break; } #ifndef COLLECTOR SessionStats *Stats=(SessionStats *)p->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, + Log.Out(Logs::Detail, Logs::Netcode, _L "Received Stats: %lu packets received, %lu packets sent, Deltas: local %lu, (%lu <- %lu -> %lu) remote %lu" __L, (unsigned long)ntohl(Stats->packets_received), (unsigned long)ntohl(Stats->packets_sent), (unsigned long)ntohl(Stats->last_local_delta), (unsigned long)ntohl(Stats->low_delta), (unsigned long)ntohl(Stats->average_delta), (unsigned long)ntohl(Stats->high_delta), (unsigned long)ntohl(Stats->last_remote_delta)); @@ -493,18 +493,18 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } if(retransmittimeout > RETRANSMIT_TIMEOUT_MAX) retransmittimeout = RETRANSMIT_TIMEOUT_MAX; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); + Log.Out(Logs::Detail, Logs::Netcode, _L "Retransmit timeout recalculated to %dms" __L, retransmittimeout); } } #endif } break; case OP_SessionStatResponse: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_SessionStatResponse. Ignoring." __L); } break; case OP_OutOfSession: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received OP_OutOfSession. Ignoring." __L); } break; default: @@ -535,7 +535,7 @@ void EQStream::FastQueuePacket(EQApplicationPacket **p, bool ack_req) return; if(OpMgr == nullptr || *OpMgr == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Packet enqueued into a stream with no opcode manager, dropping." __L); delete pack; return; } @@ -562,7 +562,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) // Convert the EQApplicationPacket to 1 or more EQProtocolPackets if (p->size>(MaxLen-8)) { // proto-op(2), seq(2), app-op(2) ... data ... crc(2) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Making oversized packet, len %d" __L, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Making oversized packet, len %d" __L, p->size); unsigned char *tmpbuff=new unsigned char[p->size+3]; length=p->serialize(opcode, tmpbuff); @@ -571,7 +571,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) *(uint32 *)(out->pBuffer+2)=htonl(p->Size()); used=MaxLen-10; memcpy(out->pBuffer+6,tmpbuff,used); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "First fragment: used %d/%d. Put size %d in the packet" __L, used, p->size, p->Size()); SequencedPush(out); @@ -582,7 +582,7 @@ void EQStream::SendPacket(uint16 opcode, EQApplicationPacket *p) out->size=chunksize+2; SequencedPush(out); used+=chunksize; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Subsequent fragment: len %d, used %d/%d." __L, chunksize, used, p->size); } delete p; delete[] tmpbuff; @@ -606,22 +606,22 @@ void EQStream::SequencedPush(EQProtocolPacket *p) #else MOutboundQueue.lock(); if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing sequenced packet %d of length %d. Base Seq is %d." __L, NextOutSeq, p->size, SequencedBase); *(uint16 *)(p->pBuffer)=htons(NextOutSeq); SequencedQueue.push_back(p); NextOutSeq++; if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Push Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Push Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } MOutboundQueue.unlock(); #endif @@ -633,7 +633,7 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) delete p; #else MOutboundQueue.lock(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pushing non-sequenced packet of length %d" __L, p->size); NonSequencedQueue.push(p); MOutboundQueue.unlock(); #endif @@ -642,14 +642,14 @@ void EQStream::NonSequencedPush(EQProtocolPacket *p) void EQStream::SendAck(uint16 seq) { uint16 Seq=htons(seq); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending ack with sequence %d" __L, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Sending ack with sequence %d" __L, seq); SetLastAckSent(seq); NonSequencedPush(new EQProtocolPacket(OP_Ack,(unsigned char *)&Seq,sizeof(uint16))); } void EQStream::SendOutOfOrderAck(uint16 seq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Sending out of order ack with sequence %d" __L, seq); uint16 Seq=htons(seq); NonSequencedPush(new EQProtocolPacket(OP_OutOfOrderAck,(unsigned char *)&Seq,sizeof(uint16))); } @@ -685,7 +685,7 @@ void EQStream::Write(int eq_fd) // if we have a timeout defined and we have not received an ack recently enough, retransmit from beginning of queue if (RETRANSMIT_TIMEOUT_MULT && !SequencedQueue.empty() && NextSequencedSend && (GetState()==ESTABLISHED) && ((retransmittimer+retransmittimeout) < Timer::GetCurrentTime())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " + Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout since last ack received, starting retransmit at the start of our unacked " "buffer (seq %d, was %d)." __L, SequencedBase, SequencedBase+NextSequencedSend); NextSequencedSend = 0; retransmittimer = Timer::GetCurrentTime(); // don't want to endlessly retransmit the first packet @@ -706,24 +706,24 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // And remove it form the queue p = NonSequencedQueue.front(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with non-seq packet of len %d" __L, p->size); NonSequencedQueue.pop(); } else if (!p->combine(NonSequencedQueue.front())) { // Tryint to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next non-seq packet is len %d" __L, p->size, (NonSequencedQueue.front())->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); + Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in nonseq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked, so just remove this packet and it's spot in the queue - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Combined non-seq packet of len %d, yeilding %d combined." __L, (NonSequencedQueue.front())->size, p->size); delete NonSequencedQueue.front(); NonSequencedQueue.pop(); } @@ -734,48 +734,48 @@ void EQStream::Write(int eq_fd) if (sitr!=SequencedQueue.end()) { if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Send Seq NSS=%d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, NextSequencedSend, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } uint16 seq_send = SequencedBase + NextSequencedSend; //just for logging... if(SequencedQueue.empty()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Tried to write a packet with an empty queue (%d is past next out %d)" __L, seq_send, NextOutSeq); SeqEmpty=true; continue; } if(GetExecutablePlatform() == ExePlatformWorld || GetExecutablePlatform() == ExePlatformZone) { if (!RETRANSMIT_ACKED_PACKETS && (*sitr)->acked) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); + Log.Out(Logs::Detail, Logs::Netcode, _L "Not retransmitting seq packet %d because already marked as acked" __L, seq_send); sitr++; NextSequencedSend++; } else if (!p) { // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } @@ -784,35 +784,35 @@ void EQStream::Write(int eq_fd) // If we don't have a packet to try to combine into, use this one as the base // Copy it first as it will still live until it is acked p=(*sitr)->Copy(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Starting combined packet with seq packet %d of len %d" __L, seq_send, p->size); ++sitr; NextSequencedSend++; } else if (!p->combine(*sitr)) { // Trying to combine this packet with the base didn't work (too big maybe) // So just send the base packet (we'll try this packet again later) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Combined packet full at len %d, next seq packet %d is len %d" __L, p->size, seq_send, (*sitr)->size); ReadyToSend.push(p); BytesWritten+=p->size; p=nullptr; if (BytesWritten > threshold) { // Sent enough this round, lets stop to be fair - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); + Log.Out(Logs::Detail, Logs::Netcode, _L "Exceeded write threshold in seq (%d > %d)" __L, BytesWritten, threshold); break; } } else { // Combine worked - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Combined seq packet %d of len %d, yeilding %d combined." __L, seq_send, (*sitr)->size, p->size); ++sitr; NextSequencedSend++; } } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Post send Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Post send Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } else { // No more sequenced packets @@ -824,7 +824,7 @@ void EQStream::Write(int eq_fd) // We have a packet still, must have run out of both seq and non-seq, so send it if (p) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Final combined packet not full, len %d" __L, p->size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Final combined packet not full, len %d" __L, p->size); ReadyToSend.push(p); BytesWritten+=p->size; } @@ -841,7 +841,7 @@ void EQStream::Write(int eq_fd) if(SeqEmpty && NonSeqEmpty) { //no more data to send if(CheckState(CLOSING)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "All outgoing data flushed, closing stream." __L ); + Log.Out(Logs::Detail, Logs::Netcode, _L "All outgoing data flushed, closing stream." __L ); //we are waiting for the queues to empty, now we can do our disconnect. //this packet will not actually go out until the next call to Write(). _SendDisconnect(); @@ -904,7 +904,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionResponse,nullptr,sizeof(Ses out->size=sizeof(SessionResponse); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, + Log.Out(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionResponse: session %lu, maxlen=%d, key=0x%x, compressed? %s, encoded? %s" __L, (unsigned long)Session, MaxLen, Key, compressed?"yes":"no", encoded?"yes":"no"); NonSequencedPush(out); @@ -918,7 +918,7 @@ EQProtocolPacket *out=new EQProtocolPacket(OP_SessionRequest,nullptr,sizeof(Sess Request->Session=htonl(time(nullptr)); Request->MaxLength=htonl(512); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); + Log.Out(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionRequest: session %lu, maxlen=%d" __L, (unsigned long)ntohl(Request->Session), ntohl(Request->MaxLength)); NonSequencedPush(out); } @@ -932,7 +932,7 @@ void EQStream::_SendDisconnect() *(uint32 *)out->pBuffer=htonl(Session); NonSequencedPush(out); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); + Log.Out(Logs::Detail, Logs::Netcode, _L "Sending OP_SessionDisconnect: session %lu" __L, (unsigned long)Session); } void EQStream::InboundQueuePush(EQRawApplicationPacket *p) @@ -959,7 +959,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if (emu_op == OP_Unknown) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -986,7 +986,7 @@ EQRawApplicationPacket *p=nullptr; if(OpMgr != nullptr && *OpMgr != nullptr) { EmuOpcode emu_op = (*OpMgr)->EQToEmu(p->opcode); if(emu_op == OP_Unknown) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); + Log.Out(Logs::General, Logs::Netcode, "Unable to convert EQ opcode 0x%.4x to an Application opcode.", p->opcode); } p->SetOpcode(emu_op); @@ -1014,7 +1014,7 @@ void EQStream::InboundQueueClear() { EQApplicationPacket *p=nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing inbound queue" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing inbound queue" __L); MInboundQueue.lock(); if (!InboundQueue.empty()) { @@ -1057,7 +1057,7 @@ void EQStream::OutboundQueueClear() { EQProtocolPacket *p=nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing outbound queue" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing outbound queue" __L); MOutboundQueue.lock(); while(!NonSequencedQueue.empty()) { @@ -1079,7 +1079,7 @@ void EQStream::PacketQueueClear() { EQProtocolPacket *p=nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Clearing future packet queue" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Clearing future packet queue" __L); if(!PacketQueue.empty()) { std::map::iterator itr; @@ -1111,7 +1111,7 @@ uint32 newlength=0; delete p; ProcessQueue(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Incoming packet failed checksum" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Incoming packet failed checksum" __L); _hex(NET__NET_CREATE_HEX, buffer, length); } } @@ -1141,33 +1141,33 @@ std::deque::iterator itr, tmp; MOutboundQueue.lock(); //do a bit of sanity checking. if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Ack Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Pre-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } SeqOrder ord = CompareSequence(SequencedBase, seq); if(ord == SeqInOrder) { //they are not acking anything new... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received an ack with no window advancement (seq %d)." __L, seq); } else if(ord == SeqPast) { //they are nacking blocks going back before our buffer, wtf? - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received an ack with backward window advancement (they gave %d, our window starts at %d). This is bad." __L, seq, SequencedBase); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); + Log.Out(Logs::Detail, Logs::Netcode, _L "Received an ack up through sequence %d. Our base is %d." __L, seq, SequencedBase); //this is a good ack, we get to ack some blocks. seq++; //we stop at the block right after their ack, counting on the wrap of both numbers. while(SequencedBase != seq) { if(SequencedQueue.empty()) { -Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); +Log.Out(Logs::Detail, Logs::Netcode, _L "OUT OF PACKETS acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); SequencedBase = NextOutSeq; NextSequencedSend = 0; break; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); + Log.Out(Logs::Detail, Logs::Netcode, _L "Removing acked packet with sequence %lu. Next send is %d before this." __L, (unsigned long)SequencedBase, NextSequencedSend); //clean out the acked packet delete SequencedQueue.front(); SequencedQueue.pop_front(); @@ -1178,10 +1178,10 @@ Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OUT OF PACKETS acked pack SequencedBase++; } if(uint16(SequencedBase + SequencedQueue.size()) != NextOutSeq) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Post-Ack on %d Invalid Sequenced queue: BS %d + SQ %d != NOS %d" __L, seq, SequencedBase, SequencedQueue.size(), NextOutSeq); } if(NextSequencedSend > SequencedQueue.size()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "Post-Ack Next Send Sequence is beyond the end of the queue NSS %d > SQ %d" __L, NextSequencedSend, SequencedQueue.size()); } } @@ -1191,7 +1191,7 @@ if(NextSequencedSend > SequencedQueue.size()) { void EQStream::SetNextAckToSend(uint32 seq) { MAcks.lock(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Set Next Ack To Send to %lu" __L, (unsigned long)seq); NextAckToSend=seq; MAcks.unlock(); } @@ -1199,7 +1199,7 @@ void EQStream::SetNextAckToSend(uint32 seq) void EQStream::SetLastAckSent(uint32 seq) { MAcks.lock(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Set Last Ack Sent to %lu" __L, (unsigned long)seq); LastAckSent=seq; MAcks.unlock(); } @@ -1212,10 +1212,10 @@ void EQStream::ProcessQueue() EQProtocolPacket *qp=nullptr; while((qp=RemoveQueue(NextInSeq))!=nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); + Log.Out(Logs::Detail, Logs::Netcode, _L "Processing Queued Packet: Seq=%d" __L, NextInSeq); ProcessPacket(qp); delete qp; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } } @@ -1226,21 +1226,21 @@ EQProtocolPacket *qp=nullptr; if ((itr=PacketQueue.find(seq))!=PacketQueue.end()) { qp=itr->second; PacketQueue.erase(itr); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); + Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); } return qp; } void EQStream::SetStreamType(EQStreamType type) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); + Log.Out(Logs::Detail, Logs::Netcode, _L "Changing stream type from %s to %s" __L, StreamTypeString(StreamType), StreamTypeString(type)); StreamType=type; switch (StreamType) { case LoginStream: app_opcode_size=1; compressed=false; encoded=false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Login stream has app opcode size %d, is not compressed or encoded." __L, app_opcode_size); break; case ChatOrMailStream: case ChatStream: @@ -1248,7 +1248,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=1; compressed=false; encoded=true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); + Log.Out(Logs::Detail, Logs::Netcode, _L "Chat/Mail stream has app opcode size %d, is not compressed, and is encoded." __L, app_opcode_size); break; case ZoneStream: case WorldStream: @@ -1256,7 +1256,7 @@ void EQStream::SetStreamType(EQStreamType type) app_opcode_size=2; compressed=true; encoded=false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); + Log.Out(Logs::Detail, Logs::Netcode, _L "World/Zone stream has app opcode size %d, is compressed, and is not encoded." __L, app_opcode_size); break; } } @@ -1306,7 +1306,7 @@ EQStream::SeqOrder EQStream::CompareSequence(uint16 expected_seq , uint16 seq) void EQStream::SetState(EQStreamState state) { MState.lock(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Changing state from %d to %d" __L, State, state); + Log.Out(Logs::Detail, Logs::Netcode, _L "Changing state from %d to %d" __L, State, state); State=state; MState.unlock(); } @@ -1318,29 +1318,29 @@ void EQStream::CheckTimeout(uint32 now, uint32 timeout) { EQStreamState orig_state = GetState(); if (orig_state == CLOSING && !outgoing_data) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Out of data in closing state, disconnecting." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Out of data in closing state, disconnecting." __L); _SendDisconnect(); SetState(DISCONNECTING); } else if (LastPacket && (now-LastPacket) > timeout) { switch(orig_state) { case CLOSING: //if we time out in the closing state, they are not acking us, just give up - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in closing state. Moving to closed state." __L); _SendDisconnect(); SetState(CLOSED); break; case DISCONNECTING: //we timed out waiting for them to send us the disconnect reply, just give up. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in disconnecting state. Moving to closed state." __L); SetState(CLOSED); break; case CLOSED: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in closed state??" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in closed state??" __L); break; case ESTABLISHED: //we timed out during normal operation. Try to be nice about it. //we will almost certainly time out again waiting for the disconnect reply, but oh well. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Timeout expired in established state. Closing connection." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Timeout expired in established state. Closing connection." __L); _SendDisconnect(); SetState(DISCONNECTING); break; @@ -1369,11 +1369,11 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, + Log.Out(Logs::Detail, Logs::Netcode, _L "Not adjusting data rate because avg delta over max (%d > %d)" __L, average_delta, AVERAGE_DELTA_MAX); } } else { @@ -1381,7 +1381,7 @@ void EQStream::AdjustRates(uint32 average_delta) MRate.lock(); RateThreshold=RATEBASE/average_delta; DecayRate=DECAYBASE/average_delta; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, + Log.Out(Logs::Detail, Logs::Netcode, _L "Adjusting data rate to thresh %d, decay %d based on avg delta %d" __L, RateThreshold, DecayRate, average_delta); MRate.unlock(); } @@ -1391,12 +1391,12 @@ void EQStream::AdjustRates(uint32 average_delta) void EQStream::Close() { if(HasOutgoingData()) { //there is pending data, wait for it to go out. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Stream requested to Close(), but there is pending data, waiting for it." __L); SetState(CLOSING); } else { //otherwise, we are done, we can drop immediately. _SendDisconnect(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, _L "Stream closing immediate due to Close()" __L); + Log.Out(Logs::Detail, Logs::Netcode, _L "Stream closing immediate due to Close()" __L); SetState(DISCONNECTING); } } @@ -1424,19 +1424,19 @@ EQStream::MatchState EQStream::CheckSignature(const Signature *sig) { } else if(p->opcode == sig->first_eq_opcode) { //opcode matches, check length.. if(p->size == sig->first_length) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length matched %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else if(sig->first_length == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); + Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x and length (%d) is ignored", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size); res = MatchSuccessful; } else { //opcode matched but length did not. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); + Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: First opcode matched 0x%x, but length %d did not match expected %d", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), sig->first_eq_opcode, p->size, sig->first_length); res = MatchFailed; } } else { //first opcode did not match.. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); + Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: First opcode 0x%x did not match expected 0x%x", long2ip(GetRemoteIP()).c_str(), ntohs(GetRemotePort()), p->opcode, sig->first_eq_opcode); res = MatchFailed; } } diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 114b61c68..4a75068b6 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -26,13 +26,13 @@ ThreadReturnType EQStreamFactoryReaderLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif fs->ReaderLoop(); #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Ending EQStreamFactoryReaderLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); @@ -43,13 +43,13 @@ ThreadReturnType EQStreamFactoryWriterLoop(void *eqfs) EQStreamFactory *fs=(EQStreamFactory *)eqfs; #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Starting EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif fs->WriterLoop(); #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Ending EQStreamFactoryWriterLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index 9ec7f2c92..22b9f77b4 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -46,7 +46,7 @@ void EQStreamIdentifier::Process() { //first see if this stream has expired if(r->expire.Check(false)) { //this stream has failed to match any pattern in our timeframe. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before timeout.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); delete r; cur = m_streams.erase(cur); @@ -62,23 +62,23 @@ void EQStreamIdentifier::Process() { } if(r->stream->GetState() != ESTABLISHED) { //the stream closed before it was identified. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d before it closed.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); switch(r->stream->GetState()) { case ESTABLISHED: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Established"); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Established"); break; case CLOSING: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closing"); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closing"); break; case DISCONNECTING: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Disconnecting"); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Disconnecting"); break; case CLOSED: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Closed"); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Closed"); break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Stream state was Unestablished or unknown"); break; } r->stream->ReleaseFromUse(); @@ -103,13 +103,13 @@ void EQStreamIdentifier::Process() { switch(res) { case EQStream::MatchNotReady: //the stream has not received enough packets to compare with this signature -// Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); +// Log.LogDebugType(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, but stream is not ready for it.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); all_ready = false; break; case EQStream::MatchSuccessful: { //yay, a match. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Identified stream %s:%d with signature %s", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); // before we assign the eqstream to an interface, let the stream recognize it is in use and the session should not be reset any further r->stream->SetActive(true); @@ -123,7 +123,7 @@ void EQStreamIdentifier::Process() { } case EQStream::MatchFailed: //do nothing... - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); + Log.Out(Logs::General, Logs::Netcode, "[IDENT_TRACE] %s:%d: Tried patch %s, and it did not match.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort()), p->name.c_str()); break; } } @@ -131,7 +131,7 @@ void EQStreamIdentifier::Process() { //if we checked all patches and did not find a match. if(all_ready && !found_one) { //the stream cannot be identified. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Unable to identify stream from %s:%d, no match found.", long2ip(r->stream->GetRemoteIP()).c_str(), ntohs(r->stream->GetRemotePort())); r->stream->ReleaseFromUse(); } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index e61ea8a1b..6f9611012 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -83,7 +83,7 @@ void EQEmuLogSys::LoadLogSettingsDefaults() { log_platform = GetExecutablePlatformInt(); /* Write defaults */ - for (int i = 0; i < EQEmuLogSys::LogCategory::MaxCategoryID; i++){ + for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){ log_settings[i].log_to_console = 0; log_settings[i].log_to_file = 0; log_settings[i].log_to_gmsay = 0; @@ -93,8 +93,8 @@ void EQEmuLogSys::LoadLogSettingsDefaults() std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string in_message){ std::string category_string = ""; - if (log_category > 0 && LogCategoryName[log_category]){ - category_string = StringFormat("[%s] ", LogCategoryName[log_category]); + if (log_category > 0 && Logs::LogCategoryName[log_category]){ + category_string = StringFormat("[%s] ", Logs::LogCategoryName[log_category]); } return StringFormat("%s%s", category_string.c_str(), in_message.c_str()); } @@ -106,7 +106,7 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_category, std::string message) return; /* Enabling Netcode based GMSay output creates a feedback loop that ultimately ends in a crash */ - if (log_category == EQEmuLogSys::LogCategory::Netcode) + if (log_category == Logs::LogCategory::Netcode) return; if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ @@ -124,7 +124,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) EQEmuLogSys::SetCurrentTimeStamp(time_stamp); if (process_log){ - process_log << time_stamp << " " << StringFormat("[%s] ", LogCategoryName[log_category]).c_str() << message << std::endl; + process_log << time_stamp << " " << StringFormat("[%s] ", Logs::LogCategoryName[log_category]).c_str() << message << std::endl; } else{ // std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; @@ -154,7 +154,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m //} #endif - std::cout << "[" << LogCategoryName[log_category] << "] " << message << "\n"; + std::cout << message << "\n"; #ifdef _WINDOWS /* Always set back to white*/ @@ -162,7 +162,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m #endif } -void EQEmuLogSys::Out(DebugLevel debug_level, uint16 log_category, std::string message, ...) +void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; va_start(args, message); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 3370e704f..d77ee3b6b 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -26,21 +26,18 @@ #include "types.h" -class EQEmuLogSys { -public: - EQEmuLogSys(); - ~EQEmuLogSys(); - +namespace Logs{ enum DebugLevel { General = 0, /* 0 - Low-Level general debugging, useful info on single line */ Moderate, /* 1 - Informational based, used in functions, when particular things load */ Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; - /* - If you add to this, make sure you update LogCategoryName + /* + If you add to this, make sure you update LogCategoryName NOTE: Only add to the bottom of the enum because that is the type ID assignment */ + enum LogCategory { None = 0, AA, @@ -80,9 +77,55 @@ public: MaxCategoryID /* Don't Remove this*/ }; + /* If you add to this, make sure you update LogCategory */ + static const char* LogCategoryName[LogCategory::MaxCategoryID] = { + "", + "AA", + "AI", + "Aggro", + "Attack", + "Client_Server_Packet", + "Combat", + "Commands", + "Crash", + "Debug", + "Doors", + "Error", + "Guilds", + "Inventory", + "Launcher", + "Netcode", + "Normal", + "Object", + "Pathing", + "QS_Server", + "Quests", + "Rules", + "Skills", + "Spawns", + "Spells", + "Status", + "TCP_Connection", + "Tasks", + "Tradeskills", + "Trading", + "Tribute", + "UCS_Server", + "WebInterface_Server", + "World_Server", + "Zone_Server", + }; + +} + +class EQEmuLogSys { +public: + EQEmuLogSys(); + ~EQEmuLogSys(); + void CloseFileLogs(); void LoadLogSettingsDefaults(); - void Out(DebugLevel debug_level, uint16 log_category, std::string message, ...); + void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); @@ -93,7 +136,7 @@ public: uint8 log_to_gmsay; }; - LogSettings log_settings[EQEmuLogSys::LogCategory::MaxCategoryID]; + LogSettings log_settings[Logs::LogCategory::MaxCategoryID]; bool log_settings_loaded = false; int log_platform = 0; @@ -112,43 +155,4 @@ private: extern EQEmuLogSys Log; -/* If you add to this, make sure you update LogCategory */ -static const char* LogCategoryName[EQEmuLogSys::LogCategory::MaxCategoryID] = { - "", - "AA", - "AI", - "Aggro", - "Attack", - "Client_Server_Packet", - "Combat", - "Commands", - "Crash", - "Debug", - "Doors", - "Error", - "Guilds", - "Inventory", - "Launcher", - "Netcode", - "Normal", - "Object", - "Pathing", - "QS_Server", - "Quests", - "Rules", - "Skills", - "Spawns", - "Spells", - "Status", - "TCP_Connection", - "Tasks", - "Tradeskills", - "Trading", - "Tribute", - "UCS_Server", - "WebInterface_Server", - "World_Server", - "Zone_Server", -}; - #endif \ No newline at end of file diff --git a/common/eqtime.cpp b/common/eqtime.cpp index a047029df..dcb3db359 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -141,7 +141,7 @@ bool EQTime::saveFile(const char *filename) of.open(filename); if(!of) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); + Log.Out(Logs::General, Logs::Error, "EQTime::saveFile failed: Unable to open file '%s'", filename); return false; } //Enable for debugging @@ -165,14 +165,14 @@ bool EQTime::loadFile(const char *filename) in.open(filename); if(!in) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not load EQTime file %s", filename); + Log.Out(Logs::General, Logs::Error, "Could not load EQTime file %s", filename); return false; } in >> version; in.ignore(80, '\n'); if(version != EQT_VERSION) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); + Log.Out(Logs::General, Logs::Error, "'%s' is NOT a valid EQTime file. File version is %i, EQTime version is %i", filename, version, EQT_VERSION); return false; } //in >> eqTime.start_eqtime.day; diff --git a/common/guild_base.cpp b/common/guild_base.cpp index fb742d487..ae653e0eb 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -46,7 +46,7 @@ bool BaseGuildManager::LoadGuilds() { ClearGuilds(); if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to load guilds when we have no database object."); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to load guilds when we have no database object."); return(false); } @@ -57,7 +57,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -69,7 +69,7 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -79,13 +79,13 @@ bool BaseGuildManager::LoadGuilds() { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Found rank %d for non-existent guild %d, skipping.", rankn, guild_id); continue; } @@ -107,7 +107,7 @@ bool BaseGuildManager::LoadGuilds() { bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to refresh guild %d when we have no database object.", guild_id); return(false); } @@ -120,13 +120,13 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find guild %d in the database.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Unable to find guild %d in the database.", guild_id); return false; } @@ -140,7 +140,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -149,7 +149,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { uint8 rankn = atoi(row[1]); if(rankn > GUILD_MAX_RANK) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Found invalid (too high) rank %d for guild %d, skipping.", rankn, guild_id); continue; } @@ -166,7 +166,7 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { rank.permissions[GUILD_WARPEACE] = (row[10][0] == '1') ? true: false; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Successfully refreshed guild %d from the database.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Successfully refreshed guild %d from the database.", guild_id); return true; } @@ -218,14 +218,14 @@ BaseGuildManager::GuildInfo *BaseGuildManager::_CreateGuild(uint32 guild_id, con bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to store guild %d when we have no database object.", guild_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to store non-existent guild %d", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to store non-existent guild %d", guild_id); return(false); } GuildInfo *info = res->second; @@ -236,14 +236,14 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; @@ -260,7 +260,7 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); @@ -294,21 +294,21 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } safe_delete_array(title_esc); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Stored guild %d in the database", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Stored guild %d in the database", guild_id); return true; } uint32 BaseGuildManager::_GetFreeGuildID() { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested find a free guild ID when we have no database object."); + Log.Out(Logs::Detail, Logs::Guilds, "Requested find a free guild ID when we have no database object."); return(GUILD_NONE); } @@ -337,18 +337,18 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Located free guild ID %d in the database", index); + Log.Out(Logs::Detail, Logs::Guilds, "Located free guild ID %d in the database", index); return index; } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to find a free guild ID when requested."); + Log.Out(Logs::Detail, Logs::Guilds, "Unable to find a free guild ID when requested."); return GUILD_NONE; } @@ -518,11 +518,11 @@ uint32 BaseGuildManager::DBCreateGuild(const char* name, uint32 leader) { //now store the resulting guild setup into the DB. if(!_StoreGuildDB(new_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); + Log.Out(Logs::Detail, Logs::Guilds, "Error storing new guild. It may have been partially created which may need manual removal."); return(GUILD_NONE); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Created guild %d in the database.", new_id); + Log.Out(Logs::Detail, Logs::Guilds, "Created guild %d in the database.", new_id); return(new_id); } @@ -538,7 +538,7 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { } if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to delete guild %d when we have no database object.", guild_id); return(false); } @@ -558,14 +558,14 @@ bool BaseGuildManager::DBDeleteGuild(uint32 guild_id) { query = StringFormat("DELETE FROM guild_bank WHERE guildid=%lu", (unsigned long)guild_id); QueryWithLogging(query, "deleting guild bank"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleted guild %d from the database.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Deleted guild %d from the database.", guild_id); return(true); } bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to rename guild %d when we have no database object.", guild_id); return false; } @@ -586,13 +586,13 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); + Log.Out(Logs::Detail, Logs::Guilds, "Error renaming guild %d '%s': %s", guild_id, query.c_str(), results.Success()); safe_delete_array(esc); return false; } safe_delete_array(esc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); + Log.Out(Logs::Detail, Logs::Guilds, "Renamed guild %s (%d) to %s in database.", info->name.c_str(), guild_id, name); info->name = name; //update our local record. @@ -601,7 +601,7 @@ bool BaseGuildManager::DBRenameGuild(uint32 guild_id, const char* name) { bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to set the leader for guild %d when we have no database object.", guild_id); return false; } @@ -617,7 +617,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -628,7 +628,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if(!DBSetGuildRank(leader, GUILD_LEADER)) return false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); + Log.Out(Logs::Detail, Logs::Guilds, "Set guild leader for guild %d to %d in the database", guild_id, leader); info->leader_char_id = leader; //update our local record. @@ -637,7 +637,7 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const char *setter) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to set the MOTD for guild %d when we have no database object.", guild_id); return(false); } @@ -661,7 +661,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; @@ -669,7 +669,7 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c safe_delete_array(esc); safe_delete_array(esc_set); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set MOTD for guild %d in the database", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Set MOTD for guild %d in the database", guild_id); info->motd = motd; //update our local record. info->motd_setter = setter; //update our local record. @@ -698,13 +698,13 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set URL for guild %d in the database", GuildID); + Log.Out(Logs::Detail, Logs::Guilds, "Set URL for guild %d in the database", GuildID); info->url = URL; //update our local record. @@ -733,13 +733,13 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } safe_delete_array(esc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set Channel for guild %d in the database", GuildID); + Log.Out(Logs::Detail, Logs::Guilds, "Set Channel for guild %d in the database", GuildID); info->channel = Channel; //update our local record. @@ -748,7 +748,7 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested to set char to guild %d when we have no database object.", guild_id); return(false); } @@ -759,7 +759,7 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -768,11 +768,11 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); + Log.Out(Logs::Detail, Logs::Guilds, "Set char %d to guild %d and rank %d in the database.", charid, guild_id, rank); return true; } @@ -796,7 +796,7 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -827,7 +827,7 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -863,11 +863,11 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Set public not for char %d", charid); + Log.Out(Logs::Detail, Logs::Guilds, "Set public not for char %d", charid); return true; } @@ -880,7 +880,7 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } @@ -938,7 +938,7 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -948,14 +948,14 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -978,7 +978,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %s from the database", char_name); + Log.Out(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %s from the database", char_name); return true; @@ -987,7 +987,7 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { if(m_db == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Requested char info on %d when we have no database object.", char_id); + Log.Out(Logs::Detail, Logs::Guilds, "Requested char info on %d when we have no database object.", char_id); return false; } @@ -1000,7 +1000,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1009,7 +1009,7 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { auto row = results.begin(); ProcessGuildMember(row, into); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Retreived guild member info for char %d", char_id); + Log.Out(Logs::Detail, Logs::Guilds, "Retreived guild member info for char %d", char_id); return true; @@ -1124,16 +1124,16 @@ bool BaseGuildManager::GuildExists(uint32 guild_id) const { bool BaseGuildManager::IsGuildLeader(uint32 guild_id, uint32 char_id) const { if(guild_id == GUILD_NONE) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: not a guild.", char_id); + Log.Out(Logs::Detail, Logs::Guilds, "Check leader for char %d: not a guild.", char_id); return(false); } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for char %d: invalid guild.", char_id); + Log.Out(Logs::Detail, Logs::Guilds, "Check leader for char %d: invalid guild.", char_id); return(false); //invalid guild } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); + Log.Out(Logs::Detail, Logs::Guilds, "Check leader for guild %d, char %d: leader id=%d", guild_id, char_id, res->second->leader_char_id); return(char_id == res->second->leader_char_id); } @@ -1163,20 +1163,20 @@ uint8 BaseGuildManager::GetDisplayedRank(uint32 guild_id, uint8 rank, uint32 cha bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { if(status >= 250) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); + Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d > 250, granted.", guild_id, status); return(true); //250+ as allowed anything } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); + Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d with user status %d, no such guild, denied.", guild_id, status); return(false); //invalid guild } bool granted = (res->second->minstatus <= status); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", + Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %s (%d) with user status %d. Min status %d: %s", res->second->name.c_str(), guild_id, status, res->second->minstatus, granted?"granted":"denied"); return(granted); @@ -1184,21 +1184,21 @@ bool BaseGuildManager::CheckGMStatus(uint32 guild_id, uint8 status) const { bool BaseGuildManager::CheckPermission(uint32 guild_id, uint8 rank, GuildAction act) const { if(rank > GUILD_MAX_RANK) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", + Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid rank, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid rank } std::map::const_iterator res; res = m_guilds.find(guild_id); if(res == m_guilds.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", + Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %d and rank %d for action %s (%d): Invalid guild, denied.", guild_id, rank, GuildActionNames[act], act); return(false); //invalid guild } bool granted = res->second->ranks[rank].permissions[act]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", + Log.Out(Logs::Detail, Logs::Guilds, "Check permission on guild %s (%d) and rank %s (%d) for action %s (%d): %s", res->second->name.c_str(), guild_id, res->second->ranks[rank].name.c_str(), rank, GuildActionNames[act], act, @@ -1245,7 +1245,7 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/common/item.cpp b/common/item.cpp index 42885fe5a..df078491e 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -1153,7 +1153,7 @@ int16 Inventory::_PutItem(int16 slot_id, ItemInst* inst) } if (result == INVALID_INDEX) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); + Log.Out(Logs::General, Logs::Error, "Inventory::_PutItem: Invalid slot_id specified (%i) with parent slot id (%i)", slot_id, parentSlot); Inventory::MarkDirty(inst); // Slot not found, clean up } diff --git a/common/misc_functions.h b/common/misc_functions.h index 2fd5b2126..346f5a753 100644 --- a/common/misc_functions.h +++ b/common/misc_functions.h @@ -40,7 +40,7 @@ #define VERIFY_PACKET_LENGTH(OPCode, Packet, StructName) \ if(Packet->size != sizeof(StructName)) \ { \ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ + Log.Out(Logs::Detail, Logs::Netcode, "Size mismatch in " #OPCode " expected %i got %i", sizeof(StructName), Packet->size); \ DumpPacket(Packet); \ return; \ } diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index a56e9a82d..33eac8c24 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -52,7 +52,7 @@ namespace RoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -316,7 +316,7 @@ namespace RoF if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -551,7 +551,7 @@ namespace RoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -585,13 +585,13 @@ namespace RoF safe_delete_array(Serialized); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -952,16 +952,16 @@ namespace RoF ENCODE(OP_GroupUpdate) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -979,7 +979,7 @@ namespace RoF return; } //if(gjs->action == groupActLeave) - // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -996,19 +996,19 @@ namespace RoF if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -1016,7 +1016,7 @@ namespace RoF } } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -1078,7 +1078,7 @@ namespace RoF return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1386,7 +1386,7 @@ namespace RoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2556,7 +2556,7 @@ namespace RoF outapp->WriteUInt8(0); // Unknown - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3321,7 +3321,7 @@ namespace RoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3654,16 +3654,16 @@ namespace RoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer, *BufferStart; @@ -3902,9 +3902,9 @@ namespace RoF Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4298,7 +4298,7 @@ namespace RoF DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4312,7 +4312,7 @@ namespace RoF DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4326,7 +4326,7 @@ namespace RoF DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4340,7 +4340,7 @@ namespace RoF DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4353,7 +4353,7 @@ namespace RoF DECODE(OP_GroupInvite2) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -4497,8 +4497,8 @@ namespace RoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoFToServerSlot(eq->from_slot); emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); @@ -4827,7 +4827,7 @@ namespace RoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); RoF::structs::ItemSerializationHeader hdr; @@ -4936,7 +4936,7 @@ namespace RoF } ss.write((const char*)&null_term, sizeof(uint8)); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF::structs::ItemBodyStruct)); RoF::structs::ItemBodyStruct ibs; memset(&ibs, 0, sizeof(RoF::structs::ItemBodyStruct)); @@ -5043,7 +5043,7 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF::structs::ItemSecondaryBodyStruct)); RoF::structs::ItemSecondaryBodyStruct isbs; memset(&isbs, 0, sizeof(RoF::structs::ItemSecondaryBodyStruct)); @@ -5084,7 +5084,7 @@ namespace RoF ss.write((const char*)&null_term, sizeof(uint8)); } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF::structs::ItemTertiaryBodyStruct)); RoF::structs::ItemTertiaryBodyStruct itbs; memset(&itbs, 0, sizeof(RoF::structs::ItemTertiaryBodyStruct)); @@ -5123,7 +5123,7 @@ namespace RoF // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF::structs::ClickEffectStruct)); RoF::structs::ClickEffectStruct ices; memset(&ices, 0, sizeof(RoF::structs::ClickEffectStruct)); @@ -5150,7 +5150,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF::structs::ProcEffectStruct)); RoF::structs::ProcEffectStruct ipes; memset(&ipes, 0, sizeof(RoF::structs::ProcEffectStruct)); @@ -5174,7 +5174,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF::structs::WornEffectStruct)); RoF::structs::WornEffectStruct iwes; memset(&iwes, 0, sizeof(RoF::structs::WornEffectStruct)); @@ -5265,7 +5265,7 @@ namespace RoF ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF::structs::ItemQuaternaryBodyStruct)); RoF::structs::ItemQuaternaryBodyStruct iqbs; memset(&iqbs, 0, sizeof(RoF::structs::ItemQuaternaryBodyStruct)); @@ -5455,7 +5455,7 @@ namespace RoF RoFSlot.MainSlot = TempSlot; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5496,7 +5496,7 @@ namespace RoF RoFSlot.SubSlot = TempSlot - ((RoFSlot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01); return RoFSlot; } @@ -5601,7 +5601,7 @@ namespace RoF ServerSlot = INVALID_INDEX; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.SlotType, RoFSlot.Unknown02, RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } @@ -5636,7 +5636,7 @@ namespace RoF ServerSlot = TempSlot; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoFSlot.MainSlot, RoFSlot.SubSlot, RoFSlot.AugSlot, RoFSlot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 4fba21144..7421eefbd 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -52,7 +52,7 @@ namespace RoF2 //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -78,7 +78,7 @@ namespace RoF2 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -93,10 +93,10 @@ namespace RoF2 opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -382,7 +382,7 @@ namespace RoF2 if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -617,7 +617,7 @@ namespace RoF2 if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -651,13 +651,13 @@ namespace RoF2 safe_delete_array(Serialized); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -1018,16 +1018,16 @@ namespace RoF2 ENCODE(OP_GroupUpdate) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -1045,7 +1045,7 @@ namespace RoF2 return; } //if(gjs->action == groupActLeave) - // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -1062,19 +1062,19 @@ namespace RoF2 if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -1082,7 +1082,7 @@ namespace RoF2 } } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -1144,7 +1144,7 @@ namespace RoF2 return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1452,7 +1452,7 @@ namespace RoF2 char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0, old_item_pkt->PacketType); if (!serialized) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2640,7 +2640,7 @@ namespace RoF2 // Think we need 1 byte of padding at the end outapp->WriteUInt8(0); // Unknown - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Player Profile Packet is %i bytes", outapp->GetWritePosition()); unsigned char *NewBuffer = new unsigned char[outapp->GetWritePosition()]; memcpy(NewBuffer, outapp->pBuffer, outapp->GetWritePosition()); @@ -3387,7 +3387,7 @@ namespace RoF2 if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -3721,16 +3721,16 @@ namespace RoF2 //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer, *BufferStart; @@ -3973,9 +3973,9 @@ namespace RoF2 Buffer += 29; if (Buffer != (BufferStart + PacketSize)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); //_hex(NET__ERROR, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4370,7 +4370,7 @@ namespace RoF2 DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4384,7 +4384,7 @@ namespace RoF2 DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4398,7 +4398,7 @@ namespace RoF2 DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4412,7 +4412,7 @@ namespace RoF2 DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4425,7 +4425,7 @@ namespace RoF2 DECODE(OP_GroupInvite2) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -4568,8 +4568,8 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); @@ -4898,7 +4898,7 @@ namespace RoF2 std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); RoF2::structs::ItemSerializationHeader hdr; @@ -5006,7 +5006,7 @@ namespace RoF2 } ss.write((const char*)&null_term, sizeof(uint8)); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody struct is %i bytes", sizeof(RoF2::structs::ItemBodyStruct)); RoF2::structs::ItemBodyStruct ibs; memset(&ibs, 0, sizeof(RoF2::structs::ItemBodyStruct)); @@ -5113,7 +5113,7 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody secondary struct is %i bytes", sizeof(RoF2::structs::ItemSecondaryBodyStruct)); RoF2::structs::ItemSecondaryBodyStruct isbs; memset(&isbs, 0, sizeof(RoF2::structs::ItemSecondaryBodyStruct)); @@ -5154,7 +5154,7 @@ namespace RoF2 ss.write((const char*)&null_term, sizeof(uint8)); } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody tertiary struct is %i bytes", sizeof(RoF2::structs::ItemTertiaryBodyStruct)); RoF2::structs::ItemTertiaryBodyStruct itbs; memset(&itbs, 0, sizeof(RoF2::structs::ItemTertiaryBodyStruct)); @@ -5193,7 +5193,7 @@ namespace RoF2 // Effect Structures Broken down to allow variable length strings for effect names int32 effect_unknown = 0; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody Click effect struct is %i bytes", sizeof(RoF2::structs::ClickEffectStruct)); RoF2::structs::ClickEffectStruct ices; memset(&ices, 0, sizeof(RoF2::structs::ClickEffectStruct)); @@ -5220,7 +5220,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // clickunk7 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody proc effect struct is %i bytes", sizeof(RoF2::structs::ProcEffectStruct)); RoF2::structs::ProcEffectStruct ipes; memset(&ipes, 0, sizeof(RoF2::structs::ProcEffectStruct)); @@ -5244,7 +5244,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown5 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody worn effect struct is %i bytes", sizeof(RoF2::structs::WornEffectStruct)); RoF2::structs::WornEffectStruct iwes; memset(&iwes, 0, sizeof(RoF2::structs::WornEffectStruct)); @@ -5335,7 +5335,7 @@ namespace RoF2 ss.write((const char*)&effect_unknown, sizeof(int32)); // unknown6 // End of Effects - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] ItemBody Quaternary effect struct is %i bytes", sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); RoF2::structs::ItemQuaternaryBodyStruct iqbs; memset(&iqbs, 0, sizeof(RoF2::structs::ItemQuaternaryBodyStruct)); @@ -5546,7 +5546,7 @@ namespace RoF2 RoF2Slot.MainSlot = TempSlot; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5587,7 +5587,7 @@ namespace RoF2 RoF2Slot.SubSlot = TempSlot - ((RoF2Slot.MainSlot + 2) * EmuConstants::ITEM_CONTAINER_SIZE); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert Server Slot %i to RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i", ServerSlot, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01); return RoF2Slot; } @@ -5696,7 +5696,7 @@ namespace RoF2 ServerSlot = RoF2Slot.MainSlot + EmuConstants::CORPSE_BEGIN; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Type %i, Unk2 %i, Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.SlotType, RoF2Slot.Unknown02, RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } @@ -5731,7 +5731,7 @@ namespace RoF2 ServerSlot = TempSlot; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Convert RoF2 Slots: Main %i, Sub %i, Aug %i, Unk1 %i to Server Slot %i", RoF2Slot.MainSlot, RoF2Slot.SubSlot, RoF2Slot.AugSlot, RoF2Slot.Unknown01, ServerSlot); return ServerSlot; } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 4881750d1..a19c4c45d 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -50,7 +50,7 @@ namespace SoD //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoD - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoD opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -247,7 +247,7 @@ namespace SoD if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -359,7 +359,7 @@ namespace SoD if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -391,13 +391,13 @@ namespace SoD } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -683,16 +683,16 @@ namespace SoD ENCODE(OP_GroupUpdate) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -710,7 +710,7 @@ namespace SoD return; } //if(gjs->action == groupActLeave) - // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -727,19 +727,19 @@ namespace SoD if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -747,7 +747,7 @@ namespace SoD } } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); char *Buffer = (char *)outapp->pBuffer; @@ -807,7 +807,7 @@ namespace SoD return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -967,7 +967,7 @@ namespace SoD char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2108,7 +2108,7 @@ namespace SoD if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2363,16 +2363,16 @@ namespace SoD //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer; @@ -2963,7 +2963,7 @@ namespace SoD DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -2977,7 +2977,7 @@ namespace SoD DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -2991,7 +2991,7 @@ namespace SoD DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3005,7 +3005,7 @@ namespace SoD DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -3018,7 +3018,7 @@ namespace SoD DECODE(OP_GroupInvite2) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -3091,7 +3091,7 @@ namespace SoD DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoDToServerSlot(eq->from_slot); emu->to_slot = SoDToServerSlot(eq->to_slot); @@ -3384,7 +3384,7 @@ namespace SoD std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); SoD::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 464c40cb3..e6f804c66 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -50,7 +50,7 @@ namespace SoF //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace SoF - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace SoF opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -214,7 +214,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -337,7 +337,7 @@ namespace SoF if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -371,13 +371,13 @@ namespace SoF } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -766,7 +766,7 @@ namespace SoF char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1707,7 +1707,7 @@ namespace SoF if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1887,7 +1887,7 @@ namespace SoF //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -2096,7 +2096,7 @@ namespace SoF //kill off the emu structure and send the eq packet. delete[] __emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending zone spawns"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawns"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -2429,7 +2429,7 @@ namespace SoF DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = SoFToServerSlot(eq->from_slot); emu->to_slot = SoFToServerSlot(eq->to_slot); @@ -2708,7 +2708,7 @@ namespace SoF std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); SoF::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 308e56191..97f824983 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -64,7 +64,7 @@ //check length of packet before decoding. Call before setup. #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -72,7 +72,7 @@ } #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ + Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ @@ -127,14 +127,14 @@ #define DECODE_LENGTH_EXACT(struct_) \ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ + Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 11adc498d..a19872c14 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -48,7 +48,7 @@ namespace Titanium //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -74,7 +74,7 @@ namespace Titanium - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -89,10 +89,10 @@ namespace Titanium opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -187,7 +187,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(BazaarSearchResults_Struct); if (entrycount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; @@ -268,7 +268,7 @@ namespace Titanium int itemcount = in->size / sizeof(InternalSerializedItem_Struct); if (itemcount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; return; } @@ -285,7 +285,7 @@ namespace Titanium safe_delete_array(serialized); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } @@ -635,7 +635,7 @@ namespace Titanium char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -1157,7 +1157,7 @@ namespace Titanium if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -1274,7 +1274,7 @@ namespace Titanium //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } @@ -1623,7 +1623,7 @@ namespace Titanium DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = TitaniumToServerSlot(eq->from_slot); emu->to_slot = TitaniumToServerSlot(eq->to_slot); diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 2d8feba20..8ef3f8fb7 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -50,7 +50,7 @@ namespace Underfoot //TODO: figure out how to support shared memory with multiple patches... opcodes = new RegularOpcodeManager(); if (!opcodes->LoadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error loading opcodes file %s. Not registering patch %s.", opfile.c_str(), name); return; } } @@ -76,7 +76,7 @@ namespace Underfoot - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[IDENTIFY] Registered patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[IDENTIFY] Registered patch %s", name); } void Reload() @@ -91,10 +91,10 @@ namespace Underfoot opfile += name; opfile += ".conf"; if (!opcodes->ReloadOpcodes(opfile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Error reloading opcodes file %s for patch %s.", opfile.c_str(), name); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); + Log.Out(Logs::General, Logs::Netcode, "[OPCODES] Reloaded opcodes for patch %s", name); } } @@ -307,7 +307,7 @@ namespace Underfoot if (EntryCount == 0 || (in->size % sizeof(BazaarSearchResults_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(BazaarSearchResults_Struct)); delete in; return; } @@ -494,7 +494,7 @@ namespace Underfoot if (ItemCount == 0 || (in->size % sizeof(InternalSerializedItem_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(InternalSerializedItem_Struct)); delete in; @@ -526,13 +526,13 @@ namespace Underfoot safe_delete_array(Serialized); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Serialization failed on item slot %d during OP_CharInventory. Item skipped.", eq->slot_id); } } delete[] __emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Sending inventory to client"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); //_hex(NET__ERROR, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); @@ -839,16 +839,16 @@ namespace Underfoot ENCODE(OP_GroupUpdate) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] OP_GroupUpdate"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] OP_GroupUpdate"); EQApplicationPacket *in = *p; GroupJoin_Struct *gjs = (GroupJoin_Struct*)in->pBuffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received outgoing OP_GroupUpdate with action code %i", gjs->action); if ((gjs->action == groupActLeave) || (gjs->action == groupActDisband)) { if ((gjs->action == groupActDisband) || !strcmp(gjs->yourname, gjs->membername)) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandYou, sizeof(structs::GroupGeneric_Struct)); @@ -867,7 +867,7 @@ namespace Underfoot return; } //if(gjs->action == groupActLeave) - // Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + // Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Group Leave, yourname = %s, membername = %s", gjs->yourname, gjs->membername); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupDisbandOther, sizeof(structs::GroupGeneric_Struct)); @@ -884,19 +884,19 @@ namespace Underfoot if (in->size == sizeof(GroupUpdate2_Struct)) { // Group Update2 - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Struct is GroupUpdate2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Struct is GroupUpdate2"); unsigned char *__emu_buffer = in->pBuffer; GroupUpdate2_Struct *gu2 = (GroupUpdate2_Struct*)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Yourname is %s", gu2->yourname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Yourname is %s", gu2->yourname); int MemberCount = 1; int PacketLength = 8 + strlen(gu2->leadersname) + 1 + 22 + strlen(gu2->yourname) + 1; for (int i = 0; i < 5; ++i) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Membername[%i] is %s", i, gu2->membername[i]); if (gu2->membername[i][0] != '\0') { PacketLength += (22 + strlen(gu2->membername[i]) + 1); @@ -904,7 +904,7 @@ namespace Underfoot } } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Leadername is %s", gu2->leadersname); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GroupUpdateB, PacketLength); @@ -964,7 +964,7 @@ namespace Underfoot delete in; return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Generic GroupUpdate, yourname = %s, membername = %s", gjs->yourname, gjs->membername); ENCODE_LENGTH_EXACT(GroupJoin_Struct); SETUP_DIRECT_ENCODE(GroupJoin_Struct, structs::GroupJoin_Struct); @@ -1190,7 +1190,7 @@ namespace Underfoot char *serialized = SerializeItem((ItemInst *)int_struct->inst, int_struct->slot_id, &length, 0); if (!serialized) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Serialization failed on item slot %d.", int_struct->slot_id); delete in; return; } @@ -2374,7 +2374,7 @@ namespace Underfoot if (EntryCount == 0 || ((in->size % sizeof(Track_Struct))) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Track_Struct)); delete in; return; } @@ -2624,16 +2624,16 @@ namespace Underfoot //determine and verify length int entrycount = in->size / sizeof(Spawn_Struct); if (entrycount == 0 || (in->size % sizeof(Spawn_Struct)) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Wrong size on outbound %s: Got %d, expected multiple of %d", opcodes->EmuToName(in->GetOpcode()), in->size, sizeof(Spawn_Struct)); delete in; return; } - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn name is [%s]", emu->name); emu = (Spawn_Struct *)__emu_buffer; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[STRUCTS] Spawn packet size is %i, entries = %i", in->size, entrycount); char *Buffer = (char *)in->pBuffer; @@ -3276,7 +3276,7 @@ namespace Underfoot DECODE(OP_GroupDisband) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_Disband"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -3290,7 +3290,7 @@ namespace Underfoot DECODE(OP_GroupFollow) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3304,7 +3304,7 @@ namespace Underfoot DECODE(OP_GroupFollow2) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3318,7 +3318,7 @@ namespace Underfoot DECODE(OP_GroupInvite) { //EQApplicationPacket *in = __packet; - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); //_hex(NET__ERROR, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -3331,7 +3331,7 @@ namespace Underfoot DECODE(OP_GroupInvite2) { - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite2. Forwarding"); DECODE_FORWARD(OP_GroupInvite); } @@ -3406,7 +3406,7 @@ namespace Underfoot DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); + Log.Out(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot, eq->to_slot); emu->from_slot = UnderfootToServerSlot(eq->from_slot); emu->to_slot = UnderfootToServerSlot(eq->to_slot); @@ -3629,7 +3629,7 @@ namespace Underfoot std::stringstream ss(std::stringstream::in | std::stringstream::out | std::stringstream::binary); const Item_Struct *item = inst->GetUnscaledItem(); - //Log.LogDebugType(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[ERROR] Serialize called for: %s", item->Name); + //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Serialize called for: %s", item->Name); Underfoot::structs::ItemSerializationHeader hdr; hdr.stacksize = stackable ? charges : 1; hdr.unknown004 = 0; diff --git a/common/ptimer.cpp b/common/ptimer.cpp index d5b31e317..76bc41419 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -135,7 +135,7 @@ bool PersistentTimer::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -168,7 +168,7 @@ bool PersistentTimer::Store(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Store, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -188,7 +188,7 @@ bool PersistentTimer::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -200,7 +200,7 @@ bool PersistentTimer::Clear(Database *db) { /* This function checks if the timer triggered */ bool PersistentTimer::Expired(Database *db, bool iReset) { if (this == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Null timer during ->Check()!?\n"); + Log.Out(Logs::General, Logs::Error, "Null timer during ->Check()!?\n"); return(true); } uint32 current_time = get_current_time(); @@ -292,7 +292,7 @@ bool PTimerList::Load(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Load, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -351,7 +351,7 @@ bool PTimerList::Clear(Database *db) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PersistentTimer::Clear, error: %s", results.ErrorMessage().c_str()); #endif return false; } @@ -443,7 +443,7 @@ bool PTimerList::ClearOffline(Database *db, uint32 char_id, pTimerType type) { auto results = db->QueryDatabase(query); if (!results.Success()) { #if EQDEBUG > 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PTimerList::ClearOffline, error: %s", results.ErrorMessage().c_str()); #endif return false; } diff --git a/common/rulesys.cpp b/common/rulesys.cpp index e3eac0611..aeca625da 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -107,7 +107,7 @@ bool RuleManager::ListRules(const char *catname, std::vector &into if(catname != nullptr) { cat = FindCategory(catname); if(cat == InvalidCategory) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find category '%s'", catname); + Log.Out(Logs::Detail, Logs::Rules, "Unable to find category '%s'", catname); return(false); } } @@ -168,18 +168,18 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas switch(type) { case IntRule: m_RuleIntValues [index] = atoi(rule_value); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); + Log.Out(Logs::Detail, Logs::Rules, "Set rule %s to value %d", rule_name, m_RuleIntValues[index]); break; case RealRule: m_RuleRealValues[index] = atof(rule_value); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); + Log.Out(Logs::Detail, Logs::Rules, "Set rule %s to value %.13f", rule_name, m_RuleRealValues[index]); break; case BoolRule: uint32 val = 0; if(!strcasecmp(rule_value, "on") || !strcasecmp(rule_value, "true") || !strcasecmp(rule_value, "yes") || !strcasecmp(rule_value, "enabled") || !strcmp(rule_value, "1")) val = 1; m_RuleBoolValues[index] = val; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); + Log.Out(Logs::Detail, Logs::Rules, "Set rule %s to value %s", rule_name, m_RuleBoolValues[index] == 1 ?"true":"false"); break; } @@ -190,7 +190,7 @@ bool RuleManager::SetRule(const char *rule_name, const char *rule_value, Databas } void RuleManager::ResetRules() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Resetting running rules to default values"); + Log.Out(Logs::Detail, Logs::Rules, "Resetting running rules to default values"); #define RULE_INT(cat, rule, default_value) \ m_RuleIntValues[ Int__##rule ] = default_value; #define RULE_REAL(cat, rule, default_value) \ @@ -214,7 +214,7 @@ bool RuleManager::_FindRule(const char *rule_name, RuleType &type_into, uint16 & return(true); } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find rule '%s'", rule_name); + Log.Out(Logs::Detail, Logs::Rules, "Unable to find rule '%s'", rule_name); return(false); } @@ -241,14 +241,14 @@ void RuleManager::SaveRules(Database *db, const char *ruleset) { m_activeRuleset = _FindOrCreateRuleset(db, ruleset); if(m_activeRuleset == -1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to find or create rule set %s", ruleset); + Log.Out(Logs::Detail, Logs::Rules, "Unable to find or create rule set %s", ruleset); return; } m_activeName = ruleset; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); + Log.Out(Logs::Detail, Logs::Rules, "Saving running rules into rule set %s (%d)", ruleset, m_activeRuleset); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); + Log.Out(Logs::Detail, Logs::Rules, "Saving running rules into running rule set %s", m_activeName.c_str(), m_activeRuleset); } int r; @@ -269,11 +269,11 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { int rsid = GetRulesetID(db, ruleset); if(rsid < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); + Log.Out(Logs::Detail, Logs::Rules, "Failed to find ruleset '%s' for load operation. Canceling.", ruleset); return(false); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); + Log.Out(Logs::Detail, Logs::Rules, "Loading rule set '%s' (%d)", ruleset, rsid); m_activeRuleset = rsid; m_activeName = ruleset; @@ -282,13 +282,13 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } for(auto row = results.begin(); row != results.end(); ++row) if(!SetRule(row[0], row[1], nullptr, false)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Unable to interpret rule record for %s", row[0]); + Log.Out(Logs::Detail, Logs::Rules, "Unable to interpret rule record for %s", row[0]); return true; } @@ -314,7 +314,7 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -329,7 +329,7 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -356,7 +356,7 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -369,7 +369,7 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } @@ -390,7 +390,7 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 64b94657c..785888ff5 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,7 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } @@ -214,7 +214,7 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -258,7 +258,7 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -271,7 +271,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -284,7 +284,7 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -299,7 +299,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -313,7 +313,7 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -403,7 +403,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { "FROM sharedbank WHERE acctid=%i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Database::GetSharedBank(uint32 account_id): %s", results.ErrorMessage().c_str()); return false; } @@ -423,7 +423,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.Out(Logs::General, Logs::Error, "Warning: %s %i has an invalid item_id %i in inventory slot %i", ((is_charid==true) ? "charid" : "acctid"), id, item_id, slot_id); continue; @@ -473,7 +473,7 @@ bool SharedDatabase::GetSharedBank(uint32 id, Inventory* inv, bool is_charid) { if (put_slot_id != INVALID_INDEX) continue; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", + Log.Out(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in shared bank inventory: %s=%i, item_id=%i, slot_id=%i", ((is_charid==true)? "charid": "acctid"), id, item_id, slot_id); if (is_charid) @@ -492,8 +492,8 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.Out(Logs::General, Logs::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -521,7 +521,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { const Item_Struct* item = GetItem(item_id); if (!item) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); + Log.Out(Logs::General, Logs::Error,"Warning: charid %i has an invalid item_id %i in inventory slot %i", char_id, item_id, slot_id); continue; } @@ -587,7 +587,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { else if (slot_id >= 3111 && slot_id <= 3179) { // Admins: please report any occurrences of this error - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); + Log.Out(Logs::General, Logs::Error, "Warning: Defunct location for item in inventory: charid=%i, item_id=%i, slot_id=%i .. pushing to cursor...", char_id, item_id, slot_id); put_slot_id = inv->PushCursor(*inst); } else @@ -599,7 +599,7 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); + Log.Out(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in inventory: charid=%i, item_id=%i, slot_id=%i",char_id, item_id, slot_id); } } @@ -617,8 +617,8 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); + Log.Out(Logs::General, Logs::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } @@ -704,7 +704,7 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); + Log.Out(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in inventory: name=%s, acctid=%i, item_id=%i, slot_id=%i", name, account_id, item_id, slot_id); } @@ -720,7 +720,7 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -760,7 +760,7 @@ bool SharedDatabase::LoadItems() { items_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(items_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Items: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Error Loading Items: %s", ex.what()); return false; } @@ -805,7 +805,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1018,7 +1018,7 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ try { hash.insert(item.ID, item); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Database::LoadItems: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Database::LoadItems: %s", ex.what()); break; } } @@ -1079,7 +1079,7 @@ std::string SharedDatabase::GetBook(const char *txtfile) } if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No book to send, (%s)", txtfile); + Log.Out(Logs::General, Logs::Error, "No book to send, (%s)", txtfile); txtout.assign(" ",1); return txtout; } @@ -1097,7 +1097,7 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1132,7 +1132,7 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1198,7 +1198,7 @@ bool SharedDatabase::LoadNPCFactionLists() { faction_hash = new EQEmu::FixedMemoryHashSet(reinterpret_cast(faction_mmf->Get()), size); mutex.Unlock(); } catch(std::exception& ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading npc factions: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Error Loading npc factions: %s", ex.what()); return false; } @@ -1216,8 +1216,8 @@ ItemInst* SharedDatabase::CreateItem(uint32 item_id, int16 charges, uint32 aug1, inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Out(Logs::General, Logs::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.Out(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1242,8 +1242,8 @@ ItemInst* SharedDatabase::CreateItem(const Item_Struct* item, int16 charges, uin inst = CreateBaseItem(item, charges); if (inst == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Out(Logs::General, Logs::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateItem()"); + Log.Out(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1273,8 +1273,8 @@ ItemInst* SharedDatabase::CreateBaseItem(const Item_Struct* item, int16 charges) inst = new ItemInst(item, charges); if (inst == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); + Log.Out(Logs::General, Logs::Error, "Error: valid item data returned a null reference for ItemInst creation in SharedDatabase::CreateBaseItem()"); + Log.Out(Logs::General, Logs::Error, "Item Data = ID: %u, Name: %s, Charges: %i", item->ID, item->Name, charges); return nullptr; } @@ -1344,7 +1344,7 @@ bool SharedDatabase::LoadSkillCaps() { mutex.Unlock(); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Error loading skill caps: %s", ex.what()); return false; } @@ -1360,7 +1360,7 @@ void SharedDatabase::LoadSkillCaps(void *data) { const std::string query = "SELECT skillID, class, level, cap FROM skill_caps ORDER BY skillID, class, level"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error loading skill caps from database: %s", results.ErrorMessage().c_str()); return; } @@ -1462,7 +1462,7 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1482,7 +1482,7 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1497,12 +1497,12 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.ColumnCount() <= SPELL_LOAD_FIELD_COUNT) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); + Log.Out(Logs::Detail, Logs::Spells, "Fatal error loading spells: Spell field count < SPELL_LOAD_FIELD_COUNT(%u)", SPELL_LOAD_FIELD_COUNT); return; } @@ -1512,7 +1512,7 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { for (auto row = results.begin(); row != results.end(); ++row) { tempid = atoi(row[0]); if(tempid >= max_spells) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); + Log.Out(Logs::Detail, Logs::Spells, "Non fatal error: spell.id >= max_spells, ignoring."); continue; } @@ -1658,7 +1658,7 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -1691,7 +1691,7 @@ bool SharedDatabase::LoadBaseData() { mutex.Unlock(); } catch(std::exception& ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Base Data: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Error Loading Base Data: %s", ex.what()); return false; } @@ -1704,7 +1704,7 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1716,22 +1716,22 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { cl = atoi(row[1]); if(lvl <= 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level <= 0, ignoring."); + Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.level <= 0, ignoring."); continue; } if(lvl >= max_level) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.level >= max_level, ignoring."); + Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.level >= max_level, ignoring."); continue; } if(cl <= 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.cl <= 0, ignoring."); + Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.cl <= 0, ignoring."); continue; } if(cl > 16) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Non fatal error: base_data.class > 16, ignoring."); + Log.Out(Logs::General, Logs::Error, "Non fatal error: base_data.class > 16, ignoring."); continue; } @@ -1784,7 +1784,7 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1806,7 +1806,7 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1832,7 +1832,7 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1886,7 +1886,7 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; @@ -1940,7 +1940,7 @@ bool SharedDatabase::LoadLoot() { loot_drop_mmf->Size()); mutex.Unlock(); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading loot: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Error loading loot: %s", ex.what()); return false; } @@ -1956,7 +1956,7 @@ const LootTable_Struct* SharedDatabase::GetLootTable(uint32 loottable_id) { return &loot_table_hash->at(loottable_id); } } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot table: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Could not get loot table: %s", ex.what()); } return nullptr; } @@ -1970,7 +1970,7 @@ const LootDrop_Struct* SharedDatabase::GetLootDrop(uint32 lootdrop_id) { return &loot_drop_hash->at(lootdrop_id); } } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not get loot drop: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Could not get loot drop: %s", ex.what()); } return nullptr; } diff --git a/common/spdat.cpp b/common/spdat.cpp index a6b17e449..3bbca4af2 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -839,7 +839,7 @@ DmgShieldType GetDamageShieldType(uint16 spell_id, int32 DSType) // If we have a DamageShieldType for this spell from the damageshieldtypes table, return that, // else, make a guess, based on the resist type. Default return value is DS_THORNS if (IsValidSpell(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, + Log.Out(Logs::Detail, Logs::Spells, "DamageShieldType for spell %i (%s) is %X\n", spell_id, spells[spell_id].name, spells[spell_id].DamageShieldType); if (spells[spell_id].DamageShieldType) diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 6e1eb038a..8df723f6b 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -39,13 +39,13 @@ void StructStrategy::ErrorEncoder(EQApplicationPacket **in_p, EQStream *dest, bo EQApplicationPacket *p = *in_p; *in_p = nullptr; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Error encoding opcode %s: no encoder provided. Dropping.", OpcodeManager::EmuToName(p->GetOpcode())); delete p; } void StructStrategy::ErrorDecoder(EQApplicationPacket *p) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); + Log.Out(Logs::General, Logs::Netcode, "[STRUCTS] Error decoding opcode %s: no decoder provided. Invalidating.", OpcodeManager::EmuToName(p->GetOpcode())); p->SetOpcode(OP_Unknown); } diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 924fef2f2..58ea11822 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -900,7 +900,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -927,7 +927,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index b85e78ae5..cfde2f24e 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -68,7 +68,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { BaseTCPServer* tcps = (BaseTCPServer*) tmp; #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Starting TCPServerLoop with thread ID %d", pthread_self()); #endif tcps->MLoopRunning.lock(); @@ -79,7 +79,7 @@ ThreadReturnType BaseTCPServer::TCPServerLoop(void* tmp) { tcps->MLoopRunning.unlock(); #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Ending TCPServerLoop with thread ID %d", pthread_self()); #endif THREAD_RETURN(nullptr); diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index 3bd4c9942..b7be6ee98 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -43,7 +43,7 @@ void TimeoutManager::CheckTimeouts() { Timeoutable *it = *cur; if(it->next_check.Check()) { #ifdef TIMEOUT_DEBUG - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Checking timeout on 0x%x\n", it); + Log.Out(Logs::General, Logs::None,, "Checking timeout on 0x%x\n", it); #endif it->CheckTimeout(); } @@ -58,13 +58,13 @@ void TimeoutManager::AddMember(Timeoutable *who) { DeleteMember(who); //just in case... prolly not needed. members.push_back(who); #ifdef TIMEOUT_DEBUG - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Adding timeoutable 0x%x\n", who); + Log.Out(Logs::General, Logs::None,, "Adding timeoutable 0x%x\n", who); #endif } void TimeoutManager::DeleteMember(Timeoutable *who) { #ifdef TIMEOUT_DEBUG - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None,, "Removing timeoutable 0x%x\n", who); + Log.Out(Logs::General, Logs::None,, "Removing timeoutable 0x%x\n", who); #endif std::vector::iterator cur,end; cur = members.begin(); diff --git a/common/worldconn.cpp b/common/worldconn.cpp index 33fc2f7d3..81b281174 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -44,7 +44,7 @@ bool WorldConnection::SendPacket(ServerPacket* pack) { void WorldConnection::OnConnected() { const EQEmuConfig *Config=EQEmuConfig::get(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); + Log.Out(Logs::General, Logs::Netcode, "[WORLD] Connected to World: %s:%d", Config->WorldIP.c_str(), Config->WorldTCPPort); ServerPacket* pack = new ServerPacket(ServerOP_ZAAuth, 16); MD5::Generate((const uchar*) m_password.c_str(), m_password.length(), pack->pBuffer); @@ -76,7 +76,7 @@ bool WorldConnection::Connect() { if (tcpc.Connect(Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf)) { return true; } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); + Log.Out(Logs::General, Logs::Netcode, "[WORLD] WorldConnection connect: Connecting to the server %s:%d failed: %s", Config->WorldIP.c_str(), Config->WorldTCPPort, errbuf); } return false; } diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 4c2f3fdd9..6af623b5f 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -47,13 +47,13 @@ int main(int argc, char *argv[]) { launcher_name = argv[1]; } if(launcher_name.length() < 1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "You must specfify a launcher name as the first argument to this program."); + Log.Out(Logs::Detail, Logs::Launcher, "You must specfify a launcher name as the first argument to this program."); return 1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration.."); + Log.Out(Logs::Detail, Logs::Launcher, "Loading server configuration.."); if (!EQEmuConfig::LoadConfig()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Loading server configuration failed."); + Log.Out(Logs::Detail, Logs::Launcher, "Loading server configuration failed."); return 1; } const EQEmuConfig *Config = EQEmuConfig::get(); @@ -62,16 +62,16 @@ int main(int argc, char *argv[]) { * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::Launcher, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::Launcher, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::Launcher, "Could not set signal handler"); return 1; } @@ -92,7 +92,7 @@ int main(int argc, char *argv[]) { std::map zones; WorldServer world(zones, launcher_name.c_str(), Config); if (!world.Connect()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "worldserver.Connect() FAILED! Will retry."); + Log.Out(Logs::Detail, Logs::Launcher, "worldserver.Connect() FAILED! Will retry."); } std::map::iterator zone, zend; @@ -100,7 +100,7 @@ int main(int argc, char *argv[]) { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting main loop..."); + Log.Out(Logs::Detail, Logs::Launcher, "Starting main loop..."); // zones["test"] = new ZoneLaunch(&world, "./zone", "dynamic_1"); @@ -182,7 +182,7 @@ int main(int argc, char *argv[]) { void CatchSignal(int sig_num) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Caught signal %d", sig_num); + Log.Out(Logs::Detail, Logs::Launcher, "Caught signal %d", sig_num); RunLoops = false; } diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index 799cbd4ee..b9c7d6b91 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -74,14 +74,14 @@ void WorldServer::Process() { break; } case ServerOP_ZAAuthFailed: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World server responded 'Not Authorized', disabling reconnect"); + Log.Out(Logs::Detail, Logs::Launcher, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; } case ServerOP_LauncherZoneRequest: { if(pack->size != sizeof(LauncherZoneRequest)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); + Log.Out(Logs::Detail, Logs::Launcher, "Invalid size of LauncherZoneRequest: %d", pack->size); break; } const LauncherZoneRequest *lzr = (const LauncherZoneRequest *) pack->pBuffer; @@ -90,9 +90,9 @@ void WorldServer::Process() { switch(ZoneRequestCommands(lzr->command)) { case ZR_Start: { if(m_zones.find(lzr->short_name) != m_zones.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); + Log.Out(Logs::Detail, Logs::Launcher, "World told us to start zone %s, but it is already running.", lzr->short_name); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to start zone %s.", lzr->short_name); + Log.Out(Logs::Detail, Logs::Launcher, "World told us to start zone %s.", lzr->short_name); ZoneLaunch *l = new ZoneLaunch(this, m_name, lzr->short_name, m_config); m_zones[lzr->short_name] = l; } @@ -101,9 +101,9 @@ void WorldServer::Process() { case ZR_Restart: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); + Log.Out(Logs::Detail, Logs::Launcher, "World told us to restart zone %s, but it is not running.", lzr->short_name); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to restart zone %s.", lzr->short_name); + Log.Out(Logs::Detail, Logs::Launcher, "World told us to restart zone %s.", lzr->short_name); res->second->Restart(); } break; @@ -111,9 +111,9 @@ void WorldServer::Process() { case ZR_Stop: { std::map::iterator res = m_zones.find(lzr->short_name); if(res == m_zones.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); + Log.Out(Logs::Detail, Logs::Launcher, "World told us to stop zone %s, but it is not running.", lzr->short_name); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "World told us to stop zone %s.", lzr->short_name); + Log.Out(Logs::Detail, Logs::Launcher, "World told us to stop zone %s.", lzr->short_name); res->second->Stop(); } break; @@ -127,7 +127,7 @@ void WorldServer::Process() { } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); + Log.Out(Logs::Detail, Logs::Launcher, "Unknown opcode 0x%x from World of len %d", pack->opcode, pack->size); break; } } diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index d9e92b8cd..7e211fb88 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -72,7 +72,7 @@ void ZoneLaunch::Start() { //spec is consumed, even on failure m_ref = ProcLauncher::get()->Launch(spec); if(m_ref == ProcLauncher::ProcError) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); + Log.Out(Logs::Detail, Logs::Launcher, "Failure to launch '%s %s %s'. ", m_config->ZoneExe.c_str(), m_zone.c_str(), m_launcherName); m_timer.Start(m_config->RestartWait); return; } @@ -84,17 +84,17 @@ void ZoneLaunch::Start() { SendStatus(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has been started.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has been started.", m_zone.c_str()); } void ZoneLaunch::Restart() { switch(m_state) { case StateRestartPending: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Restart of zone %s requested when a restart is already pending.", m_zone.c_str()); break; case StateStartPending: //we havent started yet, do nothing - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Restart of %s before it has started. Ignoring.", m_zone.c_str()); break; case StateStarted: //process is running along, kill it off.. @@ -102,20 +102,20 @@ void ZoneLaunch::Restart() { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, true)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateRestartPending; break; case StateStopPending: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Restart of zone %s requested when a stop is pending. Ignoring.", m_zone.c_str()); break; case StateStopped: //process is already stopped... nothing to do.. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Restart requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -124,7 +124,7 @@ void ZoneLaunch::Stop(bool graceful) { switch(m_state) { case StateStartPending: //we havent started yet, transition directly to stopped. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Stopping zone %s before it has started.", m_zone.c_str()); m_state = StateStopped; break; case StateStarted: @@ -134,17 +134,17 @@ void ZoneLaunch::Stop(bool graceful) { break; //we have no proc ref... cannot stop.. if(!ProcLauncher::get()->Terminate(m_ref, graceful)) { //failed to terminate the process, its not likely that it will work if we try again, so give up. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Failed to terminate zone %s. Giving up and moving to stopped.", m_zone.c_str()); m_state = StateStopped; break; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Termination signal sent to zone %s.", m_zone.c_str()); m_timer.Start(m_config->TerminateWait); m_state = StateStopPending; break; case StateStopped: //process is already stopped... nothing to do.. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Stop requested when zone %s is already stopped.", m_zone.c_str()); break; } } @@ -164,17 +164,17 @@ bool ZoneLaunch::Process() { m_timer.Disable(); //actually start up the program - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Starting zone %s", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Starting zone %s", m_zone.c_str()); Start(); //now update the shared timer to reflect the proper start interval. if(s_running == 1) { //we are the first zone started. wait that interval. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); + Log.Out(Logs::Detail, Logs::Launcher, "Waiting %d milliseconds before booting the second zone.", m_config->InitialBootWait); s_startTimer.Start(m_config->InitialBootWait); } else { //just some follow on zone, use that interval. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); + Log.Out(Logs::Detail, Logs::Launcher, "Waiting %d milliseconds before booting the next zone.", m_config->ZoneBootInterval); s_startTimer.Start(m_config->ZoneBootInterval); } @@ -187,7 +187,7 @@ bool ZoneLaunch::Process() { //waiting for notification that our child has died.. if(m_timer.Check()) { //we have timed out, try to kill the child again - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Restart(); } break; @@ -197,12 +197,12 @@ bool ZoneLaunch::Process() { //we have timed out, try to kill the child again m_killFails++; if(m_killFails > 5) { //should get this number from somewhere.. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s refused to die, giving up and acting like its dead.", m_zone.c_str()); m_state = StateStopped; s_running--; SendStatus(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s refused to die, killing again.", m_zone.c_str()); Stop(false); } } @@ -221,29 +221,29 @@ void ZoneLaunch::OnTerminate(const ProcLauncher::ProcRef &ref, const ProcLaunche switch(m_state) { case StateStartPending: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has gone down before we started it..?? Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateStarted: //something happened to our happy process... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has gone down. Restart timer started.", m_zone.c_str()); m_state = StateStartPending; m_timer.Start(m_config->RestartWait); break; case StateRestartPending: //it finally died, start it on up again - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has terminated. Transitioning to starting state.", m_zone.c_str()); m_state = StateStartPending; break; case StateStopPending: //it finally died, transition to close. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Zone %s has terminated. Transitioning to stopped state.", m_zone.c_str()); m_state = StateStopped; break; case StateStopped: //we already thought it was stopped... dont care... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); + Log.Out(Logs::Detail, Logs::Launcher, "Notified of zone %s terminating when we thought it was stopped.", m_zone.c_str()); break; } diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 5041eb410..b6c44f573 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -69,14 +69,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -116,8 +116,8 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, safe_delete_array(escapedMessage); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Speech Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } @@ -136,8 +136,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->char2_money.silver, QS->char2_money.copper, QS->char2_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Trade Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -156,8 +156,8 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Trade Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } } @@ -179,8 +179,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->npc_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Handin Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } if(detailCount == 0) @@ -198,8 +198,8 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) QS->items[i].aug_2, QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Handin Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } } @@ -213,8 +213,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ QS->s1.NPCID, QS->s1.Type, QS->s1.ZoneID); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed NPC Kill Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } if(members == 0) @@ -228,8 +228,8 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ lastIndex, QS->Chars[i].char_id); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed NPC Kill Log Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } } @@ -243,8 +243,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->char_id, QS->stack_size, QS->char_count, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -261,8 +261,8 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } } @@ -279,8 +279,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->char_count, QS->postaction); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Move Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -297,8 +297,8 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { QS->items[i].aug_3, QS->items[i].aug_4, QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Move Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } } @@ -320,8 +320,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->char_money.copper, QS->char_count); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Transaction Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } if(items == 0) @@ -338,8 +338,8 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 QS->items[i].aug_5); results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Transaction Log Record Entry Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } } @@ -356,8 +356,8 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { std::string query(queryBuffer); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "%s", query.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed Delete Log Record Insert: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "%s", query.c_str()); } safe_delete(pack); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index e802f493f..dbfb4e314 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -40,7 +40,7 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -242,7 +242,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -257,7 +257,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -288,7 +288,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); @@ -305,7 +305,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -335,7 +335,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } @@ -348,7 +348,7 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 79003a2bd..f5233c29e 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -65,16 +65,16 @@ int main() { */ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Starting EQEmu QueryServ."); + Log.Out(Logs::Detail, Logs::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Loading server configuration failed."); + Log.Out(Logs::Detail, Logs::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connecting to MySQL..."); + Log.Out(Logs::Detail, Logs::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!database.Connect( @@ -83,22 +83,22 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::Detail, Logs::World_Server, "Cannot continue without a database connection."); return 1; } /* Initialize Logging */ if (!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::QS_Server, "Could not set signal handler"); return 1; } diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index 1e6013696..32e8756ef 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -53,7 +53,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Connected to World."); + Log.Out(Logs::Detail, Logs::QS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -66,7 +66,7 @@ void WorldServer::Process() ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received Opcode: %4X", pack->opcode); + Log.Out(Logs::Detail, Logs::QS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { case 0: { break; @@ -148,7 +148,7 @@ void WorldServer::Process() break; } default: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); + Log.Out(Logs::Detail, Logs::QS_Server, "Received unhandled ServerOP_QueryServGeneric", Type); break; } break; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 8fbd296e7..dc2817f9a 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -40,22 +40,22 @@ int main(int argc, char **argv) { Log.LoadLogSettingsDefaults(); set_exception_handler(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Shared Memory Loader Program"); + Log.Out(Logs::General, Logs::Status, "Shared Memory Loader Program"); if(!EQEmuConfig::LoadConfig()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load configuration file."); + Log.Out(Logs::General, Logs::Error, "Unable to load configuration file."); return 1; } const EQEmuConfig *config = EQEmuConfig::get(); if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); + Log.Out(Logs::General, Logs::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); } SharedDatabase database; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Connecting to database..."); + Log.Out(Logs::General, Logs::Status, "Connecting to database..."); if(!database.Connect(config->DatabaseHost.c_str(), config->DatabaseUsername.c_str(), config->DatabasePassword.c_str(), config->DatabaseDB.c_str(), config->DatabasePort)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to connect to the database, cannot continue without a " + Log.Out(Logs::General, Logs::Error, "Unable to connect to the database, cannot continue without a " "database connection"); return 1; } @@ -114,61 +114,61 @@ int main(int argc, char **argv) { } if(load_all || load_items) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading items..."); + Log.Out(Logs::General, Logs::Status, "Loading items..."); try { LoadItems(&database); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(Logs::General, Logs::Error, "%s", ex.what()); return 1; } } if(load_all || load_factions) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading factions..."); + Log.Out(Logs::General, Logs::Status, "Loading factions..."); try { LoadFactions(&database); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(Logs::General, Logs::Error, "%s", ex.what()); return 1; } } if(load_all || load_loot) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading loot..."); + Log.Out(Logs::General, Logs::Status, "Loading loot..."); try { LoadLoot(&database); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(Logs::General, Logs::Error, "%s", ex.what()); return 1; } } if(load_all || load_skill_caps) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading skill caps..."); + Log.Out(Logs::General, Logs::Status, "Loading skill caps..."); try { LoadSkillCaps(&database); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(Logs::General, Logs::Error, "%s", ex.what()); return 1; } } if(load_all || load_spells) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spells..."); + Log.Out(Logs::General, Logs::Status, "Loading spells..."); try { LoadSpells(&database); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(Logs::General, Logs::Error, "%s", ex.what()); return 1; } } if(load_all || load_bd) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading base data..."); + Log.Out(Logs::General, Logs::Status, "Loading base data..."); try { LoadBaseData(&database); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s", ex.what()); + Log.Out(Logs::General, Logs::Error, "%s", ex.what()); return 1; } } diff --git a/ucs/chatchannel.cpp b/ucs/chatchannel.cpp index 0ee80510f..890d3d908 100644 --- a/ucs/chatchannel.cpp +++ b/ucs/chatchannel.cpp @@ -42,7 +42,7 @@ ChatChannel::ChatChannel(std::string inName, std::string inOwner, std::string in Moderated = false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", + Log.Out(Logs::Detail, Logs::UCS_Server, "New ChatChannel created: Name: [%s], Owner: [%s], Password: [%s], MinStatus: %i", Name.c_str(), Owner.c_str(), Password.c_str(), MinimumStatus); } @@ -149,7 +149,7 @@ void ChatChannelList::SendAllChannels(Client *c) { void ChatChannelList::RemoveChannel(ChatChannel *Channel) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "RemoveChannel(%s)", Channel->GetName().c_str()); LinkedListIterator iterator(ChatChannels); @@ -170,7 +170,7 @@ void ChatChannelList::RemoveChannel(ChatChannel *Channel) { void ChatChannelList::RemoveAllChannels() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveAllChannels"); + Log.Out(Logs::Detail, Logs::UCS_Server, "RemoveAllChannels"); LinkedListIterator iterator(ChatChannels); @@ -228,7 +228,7 @@ void ChatChannel::AddClient(Client *c) { if(IsClientInChannel(c)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Client %s already in channel %s", c->GetName().c_str(), GetName().c_str()); return; } @@ -237,7 +237,7 @@ void ChatChannel::AddClient(Client *c) { int AccountStatus = c->GetAccountStatus(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Adding %s to channel %s", c->GetName().c_str(), Name.c_str()); LinkedListIterator iterator(ClientsInChannel); @@ -262,7 +262,7 @@ bool ChatChannel::RemoveClient(Client *c) { if(!c) return false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "RemoveClient %s from channel %s", c->GetName().c_str(), GetName().c_str()); bool HideMe = c->GetHideMe(); @@ -299,7 +299,7 @@ bool ChatChannel::RemoveClient(Client *c) { if((Password.length() == 0) || (RuleI(Channels, DeleteTimer) == 0)) return false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Starting delete timer for empty password protected channel %s", Name.c_str()); DeleteTimer.Start(RuleI(Channels, DeleteTimer) * 60000); } @@ -397,7 +397,7 @@ void ChatChannel::SendMessageToChannel(std::string Message, Client* Sender) { if(ChannelClient) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sending message to %s from %s", + Log.Out(Logs::Detail, Logs::UCS_Server, "Sending message to %s from %s", ChannelClient->GetName().c_str(), Sender->GetName().c_str()); ChannelClient->SendChannelMessage(Name, Message, Sender); } @@ -479,7 +479,7 @@ ChatChannel *ChatChannelList::AddClientToChannel(std::string ChannelName, Client return nullptr; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "AddClient to channel [%s] with password [%s]", NormalisedName.c_str(), Password.c_str()); ChatChannel *RequiredChannel = FindChannel(NormalisedName); @@ -555,7 +555,7 @@ void ChatChannelList::Process() { if(CurrentChannel && CurrentChannel->ReadyToDelete()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Empty temporary password protected channel %s being destroyed.", + Log.Out(Logs::Detail, Logs::UCS_Server, "Empty temporary password protected channel %s being destroyed.", CurrentChannel->GetName().c_str()); RemoveChannel(CurrentChannel); @@ -572,7 +572,7 @@ void ChatChannel::AddInvitee(std::string Invitee) { Invitees.push_back(Invitee); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Added %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); } } @@ -587,7 +587,7 @@ void ChatChannel::RemoveInvitee(std::string Invitee) { Invitees.erase(Iterator); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Removed %s as invitee to channel %s", Invitee.c_str(), Name.c_str()); return; } @@ -613,7 +613,7 @@ void ChatChannel::AddModerator(std::string Moderator) { Moderators.push_back(Moderator); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Added %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); } } @@ -628,7 +628,7 @@ void ChatChannel::RemoveModerator(std::string Moderator) { Moderators.erase(Iterator); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Removed %s as moderator to channel %s", Moderator.c_str(), Name.c_str()); return; } @@ -654,7 +654,7 @@ void ChatChannel::AddVoice(std::string inVoiced) { Voiced.push_back(inVoiced); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Added %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); } } @@ -669,7 +669,7 @@ void ChatChannel::RemoveVoice(std::string inVoiced) { Voiced.erase(Iterator); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Removed %s as voiced to channel %s", inVoiced.c_str(), Name.c_str()); return; } diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index 4aaa4c748..e665cc8fd 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -236,7 +236,7 @@ std::vector ParseRecipients(std::string RecipientString) { static void ProcessMailTo(Client *c, std::string MailMessage) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "MAILTO: From %s, %s", c->MailBoxName().c_str(), MailMessage.c_str()); std::vector Recipients; @@ -305,7 +305,7 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { if (!database.SendMail(Recipient, c->MailBoxName(), Subject, Body, RecipientsString)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), + Log.Out(Logs::Detail, Logs::UCS_Server, "Failed in SendMail(%s, %s, %s, %s)", Recipient.c_str(), c->MailBoxName().c_str(), Subject.c_str(), RecipientsString.c_str()); int PacketLength = 10 + Recipient.length() + Subject.length(); @@ -400,7 +400,7 @@ static void ProcessSetMessageStatus(std::string SetMessageCommand) { static void ProcessCommandBuddy(Client *c, std::string Buddy) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Received buddy command with parameters %s", Buddy.c_str()); c->GeneralChannelMessage("Buddy list modified"); uint8 SubAction = 1; @@ -430,7 +430,7 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { static void ProcessCommandIgnore(Client *c, std::string Ignoree) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Received ignore command with parameters %s", Ignoree.c_str()); c->GeneralChannelMessage("Ignore list modified"); uint8 SubAction = 0; @@ -481,9 +481,9 @@ Clientlist::Clientlist(int ChatPort) { exit(1); if (chatsf->Open()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); + Log.Out(Logs::Detail, Logs::UCS_Server,"Client (UDP) Chat listener started on port %i.", ChatPort); else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); + Log.Out(Logs::Detail, Logs::UCS_Server,"Failed to start client (UDP) listener (port %-4i)", ChatPort); exit(1); } @@ -560,13 +560,13 @@ void Clientlist::CheckForStaleConnections(Client *c) { if(((*Iterator) != c) && ((c->GetName() == (*Iterator)->GetName()) && (c->GetConnectionType() == (*Iterator)->GetConnectionType()))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Removing old connection for %s", c->GetName().c_str()); struct in_addr in; in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.Out(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -586,7 +586,7 @@ void Clientlist::Process() { in.s_addr = eqs->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); + Log.Out(Logs::Detail, Logs::UCS_Server, "New Client UDP connection from %s:%d", inet_ntoa(in), ntohs(eqs->GetRemotePort())); eqs->SetOpcodeManager(&ChatOpMgr); @@ -606,7 +606,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), + Log.Out(Logs::Detail, Logs::UCS_Server, "Client connection from %s:%d closed.", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort())); safe_delete((*Iterator)); @@ -646,7 +646,7 @@ void Clientlist::Process() { if(strlen(PacketBuffer) != 9) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Mail key is the wrong size. Version of world incompatible with UCS."); KeyValid = false; break; } @@ -667,11 +667,11 @@ void Clientlist::Process() { else CharacterName = MailBoxString.substr(LastPeriod + 1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received login for user %s with key %s", MailBox, Key); + Log.Out(Logs::Detail, Logs::UCS_Server, "Received login for user %s with key %s", MailBox, Key); if(!database.VerifyMailKey(CharacterName, (*Iterator)->ClientStream->GetRemoteIP(), Key)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); + Log.Out(Logs::Detail, Logs::UCS_Server, "Chat Key for %s does not match, closing connection.", MailBox); KeyValid = false; @@ -703,7 +703,7 @@ void Clientlist::Process() { default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled chat opcode %8X", opcode); + Log.Out(Logs::Detail, Logs::UCS_Server, "Unhandled chat opcode %8X", opcode); break; } } @@ -716,7 +716,7 @@ void Clientlist::Process() { in.s_addr = (*Iterator)->ClientStream->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", + Log.Out(Logs::Detail, Logs::UCS_Server, "Force disconnecting client: %s:%d, KeyValid=%i, GetForceDisconnect()=%i", inet_ntoa(in), ntohs((*Iterator)->ClientStream->GetRemotePort()), KeyValid, (*Iterator)->GetForceDisconnect()); @@ -860,7 +860,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) break; case CommandSetMessageStatus: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Set Message Status, Params: %s", Parameters.c_str()); ProcessSetMessageStatus(Parameters); break; @@ -885,7 +885,7 @@ void Clientlist::ProcessOPMailCommand(Client *c, std::string CommandString) default: c->SendHelp(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Unhandled OP_Mail command: %s", CommandString.c_str()); } } @@ -896,7 +896,7 @@ void Clientlist::CloseAllConnections() { for(Iterator = ClientChatConnections.begin(); Iterator != ClientChatConnections.end(); ++Iterator) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Removing client %s", (*Iterator)->GetName().c_str()); (*Iterator)->CloseConnection(); } @@ -905,7 +905,7 @@ void Clientlist::CloseAllConnections() { void Client::AddCharacter(int CharID, const char *CharacterName, int Level) { if(!CharacterName) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Adding character %s with ID %i for %s", CharacterName, CharID, GetName().c_str()); CharacterEntry NewCharacter; NewCharacter.CharID = CharID; NewCharacter.Name = CharacterName; @@ -971,7 +971,7 @@ void Client::AddToChannelList(ChatChannel *JoinedChannel) { for(int i = 0; i < MAX_JOINED_CHANNELS; i++) if(JoinedChannels[i] == nullptr) { JoinedChannels[i] = JoinedChannel; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Added Channel %s to slot %i for %s", JoinedChannel->GetName().c_str(), i + 1, GetName().c_str()); return; } } @@ -1012,7 +1012,7 @@ void Client::JoinChannels(std::string ChannelNameList) { } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Client: %s joining channels %s", GetName().c_str(), ChannelNameList.c_str()); int NumberOfChannels = ChannelCount(); @@ -1113,7 +1113,7 @@ void Client::JoinChannels(std::string ChannelNameList) { void Client::LeaveChannels(std::string ChannelNameList) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Client: %s leaving channels %s", GetName().c_str(), ChannelNameList.c_str()); std::string::size_type CurrentPos = 0; @@ -1292,7 +1292,7 @@ void Client::SendChannelMessage(std::string Message) std::string ChannelName = Message.substr(1, MessageStart-1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), ChannelName.c_str(), Message.substr(MessageStart + 1).c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1435,7 +1435,7 @@ void Client::SendChannelMessageByNumber(std::string Message) { } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), + Log.Out(Logs::Detail, Logs::UCS_Server, "%s tells %s, [%s]", GetName().c_str(), RequiredChannel->GetName().c_str(), Message.substr(MessageStart + 1).c_str()); if(RuleB(Chat, EnableAntiSpam)) @@ -1647,7 +1647,7 @@ void Client::SetChannelPassword(std::string ChannelPassword) { else Message = "Password change on channel " + ChannelName; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Set password of channel [%s] to [%s] by %s", ChannelName.c_str(), Password.c_str(), GetName().c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1702,7 +1702,7 @@ void Client::SetChannelOwner(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Set owner of channel [%s] to [%s]", ChannelName.c_str(), NewOwner.c_str()); ChatChannel *RequiredChannel = ChannelList->FindChannel(ChannelName); @@ -1790,7 +1790,7 @@ void Client::ChannelInvite(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] invites [%s] to channel [%s]", GetName().c_str(), Invitee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Invitee); @@ -1918,7 +1918,7 @@ void Client::ChannelGrantModerator(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] moderator rights to channel [%s]", GetName().c_str(), Moderator.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Moderator); @@ -1999,7 +1999,7 @@ void Client::ChannelGrantVoice(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] gives [%s] voice to channel [%s]", GetName().c_str(), Voicee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Voicee); @@ -2087,7 +2087,7 @@ void Client::ChannelKick(std::string CommandString) { if((ChannelName.length() > 0) && isdigit(ChannelName[0])) ChannelName = ChannelSlotName(atoi(ChannelName.c_str())); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "[%s] kicks [%s] from channel [%s]", GetName().c_str(), Kickee.c_str(), ChannelName.c_str()); Client *RequiredClient = CL->FindCharacter(Kickee); @@ -2196,32 +2196,32 @@ void Client::SetConnectionType(char c) { case 'S': { TypeOfConnection = ConnectionTypeCombined; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (SoF/SoD)"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (SoF/SoD)"); break; } case 'U': { TypeOfConnection = ConnectionTypeCombined; UnderfootOrLater = true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Combined (Underfoot+)"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Combined (Underfoot+)"); break; } case 'M': { TypeOfConnection = ConnectionTypeMail; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Mail (6.2 or Titanium client)"); break; } case 'C': { TypeOfConnection = ConnectionTypeChat; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is Chat (6.2 or Titanium client)"); break; } default: { TypeOfConnection = ConnectionTypeUnknown; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connection type is unknown."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connection type is unknown."); } } } @@ -2299,11 +2299,11 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin void Client::ChangeMailBox(int NewMailBox) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); + Log.Out(Logs::Detail, Logs::UCS_Server, "%s Change to mailbox %i", MailBoxName().c_str(), NewMailBox); SetMailBox(NewMailBox); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "New mailbox is %s", MailBoxName().c_str()); auto outapp = new EQApplicationPacket(OP_MailboxChange, 2); @@ -2377,13 +2377,13 @@ std::string Client::MailBoxName() { if((Characters.size() == 0) || (CurrentMailBox > (Characters.size() - 1))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.Out(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return ""; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", + Log.Out(Logs::Detail, Logs::UCS_Server, "MailBoxName() called with CurrentMailBox set to %i and Characters.size() is %i", CurrentMailBox, Characters.size()); return Characters[CurrentMailBox].Name; diff --git a/ucs/database.cpp b/ucs/database.cpp index ee09dc7c2..cb7bd3d51 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -74,14 +74,14 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to connect to database: Error: %s", errbuf); + Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf); HandleMysqlError(errnum); return false; } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); return true; } } @@ -110,15 +110,15 @@ void Database::GetAccountStatus(Client *client) { client->GetAccountID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Unable to get account status for character %s, error %s", client->GetName().c_str(), results.ErrorMessage().c_str()); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "GetAccountStatus Query: %s", query.c_str()); if(results.RowCount() != 1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error in GetAccountStatus"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error in GetAccountStatus"); return; } @@ -129,13 +129,13 @@ void Database::GetAccountStatus(Client *client) { client->SetKarma(atoi(row[2])); client->SetRevoked((atoi(row[3])==1?true:false)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Set account status to %i, hideme to %i and karma to %i for %s", client->GetAccountStatus(), client->GetHideMe(), client->GetKarma(), client->GetName().c_str()); } int Database::FindAccount(const char *characterName, Client *client) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount for character %s", characterName); + Log.Out(Logs::Detail, Logs::UCS_Server, "FindAccount for character %s", characterName); client->ClearCharacters(); @@ -144,12 +144,12 @@ int Database::FindAccount(const char *characterName, Client *client) { characterName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindAccount query failed: %s", query.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "FindAccount query failed: %s", query.c_str()); return -1; } if (results.RowCount() != 1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from query"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Bad result from query"); return -1; } @@ -158,7 +158,7 @@ int Database::FindAccount(const char *characterName, Client *client) { int accountID = atoi(row[1]); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Account ID for %s is %i", characterName, accountID); + Log.Out(Logs::Detail, Logs::UCS_Server, "Account ID for %s is %i", characterName, accountID); query = StringFormat("SELECT `id`, `name`, `level` FROM `character_data` " "WHERE `account_id` = %i AND `name` != '%s'", @@ -179,7 +179,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri characterName.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error retrieving mailkey from database: %s", results.ErrorMessage().c_str()); return false; } @@ -195,7 +195,7 @@ bool Database::VerifyMailKey(std::string characterName, int IPAddress, std::stri else sprintf(combinedKey, "%s", MailKey.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); + Log.Out(Logs::Detail, Logs::UCS_Server, "DB key is [%s], Client key is [%s]", row[0], combinedKey); return !strcmp(row[0], combinedKey); } @@ -206,14 +206,14 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } safe_delete(safeCharName); if (results.RowCount() != 1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); + Log.Out(Logs::Detail, Logs::UCS_Server, "Bad result from FindCharacter query for character %s", characterName); return -1; } @@ -229,7 +229,7 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -245,12 +245,12 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ bool Database::LoadChatChannels() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading chat channels from the database."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Loading chat channels from the database."); const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -267,25 +267,25 @@ bool Database::LoadChatChannels() { void Database::SetChannelPassword(std::string channelName, std::string password) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Database::SetChannelPassword(%s, %s)", channelName.c_str(), password.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::SetChannelOwner(std::string channelName, std::string owner) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Database::SetChannelOwner(%s, %s)", channelName.c_str(), owner.c_str()); std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -295,7 +295,7 @@ void Database::SendHeaders(Client *client) { int unknownField3 = 1; int characterID = FindCharacter(client->MailBoxName().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); + Log.Out(Logs::Detail, Logs::UCS_Server, "Sendheaders for %s, CharID is %i", client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -382,7 +382,7 @@ void Database::SendBody(Client *client, int messageNumber) { int characterID = FindCharacter(client->MailBoxName().c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); + Log.Out(Logs::Detail, Logs::UCS_Server, "SendBody: MsgID %i, to %s, CharID is %i", messageNumber, client->MailBoxName().c_str(), characterID); if(characterID <= 0) return; @@ -399,7 +399,7 @@ void Database::SendBody(Client *client, int messageNumber) { auto row = results.begin(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); + Log.Out(Logs::Detail, Logs::UCS_Server, "Message: %i body (%i bytes)", messageNumber, strlen(row[1])); int packetLength = 12 + strlen(row[0]) + strlen(row[1]) + strlen(row[2]); @@ -445,7 +445,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub characterID = FindCharacter(characterName.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); + Log.Out(Logs::Detail, Logs::UCS_Server, "SendMail: CharacterID for recipient %s is %i", characterName.c_str(), characterID); if(characterID <= 0) return false; @@ -467,11 +467,11 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "MessageID %i generated, from %s, to %s", results.LastInsertedID(), from.c_str(), recipient.c_str()); Client *client = CL->IsCharacterOnline(characterName); @@ -488,7 +488,7 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub void Database::SetMessageStatus(int messageNumber, int status) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); + Log.Out(Logs::Detail, Logs::UCS_Server, "SetMessageStatus %i %i", messageNumber, status); if(status == 0) { std::string query = StringFormat("DELETE FROM `mail` WHERE `msgid` = %i", messageNumber); @@ -499,24 +499,24 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } void Database::ExpireMail() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expiring mail..."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Expiring mail..."); std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } auto row = results.begin(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "There are %s messages in the database.", row[0]); + Log.Out(Logs::Detail, Logs::UCS_Server, "There are %s messages in the database.", row[0]); // Expire Trash if(RuleI(Mail, ExpireTrash) >= 0) { @@ -524,9 +524,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireTrash)); results = QueryDatabase(query); if(results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -536,9 +536,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireRead)); results = QueryDatabase(query); if(results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i read messages.", results.RowsAffected()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread @@ -547,9 +547,9 @@ void Database::ExpireMail() { time(nullptr) - RuleI(Mail, ExpireUnread)); results = QueryDatabase(query); if(results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } @@ -560,9 +560,9 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } @@ -573,9 +573,9 @@ void Database::RemoveFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Error removing friend/ignore, query was %s", query.c_str()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Removed Friend/Ignore entry for charid %i, type %i, name %s from database.", charID, type, name.c_str()); } @@ -584,7 +584,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -595,12 +595,12 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends if(atoi(row[0]) == 0) { ignorees.push_back(name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Ignoree from DB %s", name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Added Ignoree from DB %s", name.c_str()); continue; } friends.push_back(name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Added Friend from DB %s", name.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Added Friend from DB %s", name.c_str()); } } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index c51d1e0dd..241d50775 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -78,11 +78,11 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Starting EQEmu Universal Chat Server."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loading server configuration failed."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Loading server configuration failed."); return 1; } @@ -90,13 +90,13 @@ int main() { Config = ucsconfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); WorldShortName = Config->ShortName; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connecting to MySQL..."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -104,22 +104,22 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::Detail, Logs::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::Detail, Logs::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(Logs::Detail, Logs::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "No rule set configured, using default rules"); + Log.Out(Logs::Detail, Logs::UCS_Server, "No rule set configured, using default rules"); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Loaded default rule set 'default'", tmp); + Log.Out(Logs::Detail, Logs::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -127,7 +127,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + Log.Out(Logs::Detail, Logs::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -138,11 +138,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::UCS_Server, "Could not set signal handler"); return 1; } diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index 2d05d753d..67bc81987 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -52,7 +52,7 @@ WorldServer::~WorldServer() void WorldServer::OnConnected() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Connected to World."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Connected to World."); WorldConnection::OnConnected(); } @@ -67,7 +67,7 @@ void WorldServer::Process() while((pack = tcpc.PopPacket())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Received Opcode: %4X", pack->opcode); + Log.Out(Logs::Detail, Logs::UCS_Server, "Received Opcode: %4X", pack->opcode); switch(pack->opcode) { @@ -88,7 +88,7 @@ void WorldServer::Process() std::string Message = Buffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); + Log.Out(Logs::Detail, Logs::UCS_Server, "Player: %s, Sent Message: %s", From, Message.c_str()); Client *c = CL->FindCharacter(From); @@ -99,7 +99,7 @@ void WorldServer::Process() if(!c) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Client not found."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Client not found."); break; } diff --git a/world/adventure.cpp b/world/adventure.cpp index fa41e3c09..83b98813d 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,7 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); @@ -405,7 +405,7 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 9c65620bf..3f671ee97 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,7 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -702,7 +702,7 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1079,7 +1079,7 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/world/client.cpp b/world/client.cpp index 2b3b8dde2..bcf709373 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -136,7 +136,7 @@ void Client::SendEnterWorld(std::string name) eqs->Close(); return; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Telling client to continue session."); + Log.Out(Logs::Detail, Logs::World_Server,"Telling client to continue session."); } } @@ -378,7 +378,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if (strlen(password) <= 1) { // TODO: Find out how to tell the client wrong username/password - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login without a password"); + Log.Out(Logs::Detail, Logs::World_Server,"Login without a password"); return false; } @@ -408,31 +408,31 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { if ((cle = zoneserver_list.CheckAuth(inet_ntoa(tmpip), password))) #else if (loginserverlist.Connected() == false && !pZoning) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error: Login server login while not connected to login server."); + Log.Out(Logs::Detail, Logs::World_Server,"Error: Login server login while not connected to login server."); return false; } if (((cle = client_list.CheckAuth(name, password)) || (cle = client_list.CheckAuth(id, password)))) #endif { if (cle->AccountID() == 0 || (!minilogin && cle->LSID()==0)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ID is 0. Is this server connected to minilogin?"); + Log.Out(Logs::Detail, Logs::World_Server,"ID is 0. Is this server connected to minilogin?"); if(!minilogin) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"If so you forget the minilogin variable..."); + Log.Out(Logs::Detail, Logs::World_Server,"If so you forget the minilogin variable..."); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); + Log.Out(Logs::Detail, Logs::World_Server,"Could not find a minilogin account, verify ip address logging into minilogin is the same that is in your account table."); return false; } cle->SetOnline(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); + Log.Out(Logs::Detail, Logs::World_Server,"Logged in. Mode=%s",pZoning ? "(Zoning)" : "(CharSel)"); if(minilogin){ WorldConfig::DisableStats(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"MiniLogin Account #%d",cle->AccountID()); + Log.Out(Logs::Detail, Logs::World_Server,"MiniLogin Account #%d",cle->AccountID()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"LS Account #%d",cle->LSID()); + Log.Out(Logs::Detail, Logs::World_Server,"LS Account #%d",cle->LSID()); } const WorldConfig *Config=WorldConfig::get(); @@ -465,7 +465,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { } else { // TODO: Find out how to tell the client wrong username/password - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bad/Expired session key '%s'",name); + Log.Out(Logs::Detail, Logs::World_Server,"Bad/Expired session key '%s'",name); return false; } @@ -479,7 +479,7 @@ bool Client::HandleSendLoginInfoPacket(const EQApplicationPacket *app) { bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Name approval request with no logged in account"); + Log.Out(Logs::Detail, Logs::World_Server,"Name approval request with no logged in account"); return false; } @@ -487,7 +487,7 @@ bool Client::HandleNameApprovalPacket(const EQApplicationPacket *app) uchar race = app->pBuffer[64]; uchar clas = app->pBuffer[68]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); + Log.Out(Logs::Detail, Logs::World_Server, "Name approval request. Name=%s, race=%s, class=%s", char_name, GetRaceName(race), GetEQClassName(clas)); EQApplicationPacket *outapp; outapp = new EQApplicationPacket; @@ -648,11 +648,11 @@ bool Client::HandleCharacterCreateRequestPacket(const EQApplicationPacket *app) bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account ID not set; unable to create character."); + Log.Out(Logs::Detail, Logs::World_Server,"Account ID not set; unable to create character."); return false; } else if (app->size != sizeof(CharCreate_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on OP_CharacterCreate. Got: %d, Expected: %d",app->size,sizeof(CharCreate_Struct)); DumpPacket(app); // the previous behavior was essentially returning true here // but that seems a bit odd to me. @@ -679,14 +679,14 @@ bool Client::HandleCharacterCreatePacket(const EQApplicationPacket *app) { bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (GetAccountID() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world with no logged in account"); + Log.Out(Logs::Detail, Logs::World_Server,"Enter world with no logged in account"); eqs->Close(); return true; } if(GetAdmin() < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Account banned or suspended."); + Log.Out(Logs::Detail, Logs::World_Server,"Account banned or suspended."); eqs->Close(); return true; } @@ -702,14 +702,14 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { uint32 tmpaccid = 0; charid = database.GetCharacterInfo(char_name, &tmpaccid, &zoneID, &instanceID); if (charid == 0 || tmpaccid != GetAccountID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not get CharInfo for '%s'",char_name); + Log.Out(Logs::Detail, Logs::World_Server,"Could not get CharInfo for '%s'",char_name); eqs->Close(); return true; } // Make sure this account owns this character if (tmpaccid != GetAccountID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"This account does not own the character named '%s'",char_name); + Log.Out(Logs::Detail, Logs::World_Server,"This account does not own the character named '%s'",char_name); eqs->Close(); return true; } @@ -737,7 +737,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { zoneID = database.MoveCharacterToBind(charid,4); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go home before they're able...",char_name); + Log.Out(Logs::Detail, Logs::World_Server,"'%s' is trying to go home before they're able...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQGoHome: player tried to go home before they were able."); eqs->Close(); return true; @@ -770,7 +770,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); + Log.Out(Logs::Detail, Logs::World_Server,"'%s' is trying to go to tutorial but are not allowed...",char_name); database.SetHackerFlag(GetAccountName(), char_name, "MQTutorial: player tried to enter the tutorial without having tutorial enabled for this character."); eqs->Close(); return true; @@ -780,7 +780,7 @@ bool Client::HandleEnterWorldPacket(const EQApplicationPacket *app) { if (zoneID == 0 || !database.GetZoneName(zoneID)) { // This is to save people in an invalid zone, once it's removed from the DB database.MoveCharacterToZone(charid, "arena"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); + Log.Out(Logs::Detail, Logs::World_Server, "Zone not found in database zone_id=%i, moveing char to arena character:%s", zoneID, char_name); } if(instanceID > 0) @@ -894,7 +894,7 @@ bool Client::HandleDeleteCharacterPacket(const EQApplicationPacket *app) { uint32 char_acct_id = database.GetAccountIDByChar((char*)app->pBuffer); if(char_acct_id == GetAccountID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Delete character: %s",app->pBuffer); + Log.Out(Logs::Detail, Logs::World_Server,"Delete character: %s",app->pBuffer); database.DeleteCharacter((char *)app->pBuffer); SendCharInfo(); } @@ -915,25 +915,25 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { EmuOpcode opcode = app->GetOpcode(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied EQApplicationPacket"); + Log.Out(Logs::Detail, Logs::World_Server,"Recevied EQApplicationPacket"); _pkt(WORLD__CLIENT_TRACE,app); if (!eqs->CheckState(ESTABLISHED)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (net inactive on send)"); + Log.Out(Logs::Detail, Logs::World_Server,"Client disconnected (net inactive on send)"); return false; } // Voidd: Anti-GM Account hack, Checks source ip against valid GM Account IP Addresses if (RuleB(World, GMAccountIPList) && this->GetAdmin() >= (RuleI(World, MinGMAntiHackStatus))) { if(!database.CheckGMIPs(long2ip(this->GetIP()).c_str(), this->GetAccountID())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); + Log.Out(Logs::Detail, Logs::World_Server,"GM Account not permited from source address %s and accountid %i", long2ip(this->GetIP()).c_str(), this->GetAccountID()); eqs->Close(); } } if (GetAccountID() == 0 && opcode != OP_SendLoginInfo) { // Got a packet other than OP_SendLoginInfo when not logged in - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); + Log.Out(Logs::Detail, Logs::World_Server,"Expecting OP_SendLoginInfo, got %s", OpcodeNames[opcode]); return false; } else if (opcode == OP_AckPacket) { @@ -1005,7 +1005,7 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received unknown EQApplicationPacket"); + Log.Out(Logs::Detail, Logs::World_Server,"Received unknown EQApplicationPacket"); _pkt(WORLD__CLIENT_ERR,app); return true; } @@ -1024,7 +1024,7 @@ bool Client::Process() { to.sin_addr.s_addr = ip; if (autobootup_timeout.Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone bootup timer expired, bootup failed or too slow."); + Log.Out(Logs::Detail, Logs::World_Server, "Zone bootup timer expired, bootup failed or too slow."); ZoneUnavail(); } if(connect.Check()){ @@ -1058,7 +1058,7 @@ bool Client::Process() { loginserverlist.SendPacket(pack); safe_delete(pack); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client disconnected (not active in process)"); + Log.Out(Logs::Detail, Logs::World_Server,"Client disconnected (not active in process)"); return false; } @@ -1107,17 +1107,17 @@ void Client::EnterWorld(bool TryBootup) { } else { if (TryBootup) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); + Log.Out(Logs::Detail, Logs::World_Server,"Attempting autobootup of %s (%d:%d)",zone_name,zoneID,instanceID); autobootup_timeout.Start(); pwaitingforbootup = zoneserver_list.TriggerBootup(zoneID, instanceID); if (pwaitingforbootup == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"No zoneserver available to boot up."); + Log.Out(Logs::Detail, Logs::World_Server,"No zoneserver available to boot up."); ZoneUnavail(); } return; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Requested zone %s is no running.",zone_name); + Log.Out(Logs::Detail, Logs::World_Server,"Requested zone %s is no running.",zone_name); ZoneUnavail(); return; } @@ -1126,12 +1126,12 @@ void Client::EnterWorld(bool TryBootup) { cle->SetChar(charid, char_name); database.UpdateLiveChar(char_name, GetAccountID()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); + Log.Out(Logs::Detail, Logs::World_Server,"%s %s (%d:%d)",seencharsel ? "Entering zone" : "Zoning to",zone_name,zoneID,instanceID); // database.SetAuthentication(account_id, char_name, zone_name, ip); if (seencharsel) { if (GetAdmin() < 80 && zoneserver_list.IsZoneLocked(zoneID)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Enter world failed. Zone is locked."); + Log.Out(Logs::Detail, Logs::World_Server,"Enter world failed. Zone is locked."); ZoneUnavail(); return; } @@ -1169,9 +1169,9 @@ void Client::Clearance(int8 response) { if (zs == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unable to find zoneserver in Client::Clearance!!"); + Log.Out(Logs::Detail, Logs::World_Server,"Unable to find zoneserver in Client::Clearance!!"); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Invalid response %d in Client::Clearance", response); + Log.Out(Logs::Detail, Logs::World_Server, "Invalid response %d in Client::Clearance", response); } ZoneUnavail(); @@ -1181,20 +1181,20 @@ void Client::Clearance(int8 response) EQApplicationPacket* outapp; if (zs->GetCAddress() == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to do zs->GetCAddress() in Client::Clearance!!"); ZoneUnavail(); return; } if (zoneID == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zoneID is nullptr in Client::Clearance!!"); + Log.Out(Logs::Detail, Logs::World_Server, "zoneID is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } const char* zonename = database.GetZoneName(zoneID); if (zonename == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "zonename is nullptr in Client::Clearance!!"); + Log.Out(Logs::Detail, Logs::World_Server, "zonename is nullptr in Client::Clearance!!"); ZoneUnavail(); return; } @@ -1225,7 +1225,7 @@ void Client::Clearance(int8 response) } strcpy(zsi->ip, zs_addr); zsi->port =zs->GetCPort(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); + Log.Out(Logs::Detail, Logs::World_Server,"Sending client to zone %s (%d:%d) at %s:%d",zonename,zoneID,instanceID,zsi->ip,zsi->port); QueuePacket(outapp); safe_delete(outapp); @@ -1256,7 +1256,7 @@ bool Client::GenPassKey(char* key) { } void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); + Log.Out(Logs::Detail, Logs::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); _pkt(WORLD__CLIENT_TRACE, app); ack_req = true; // It's broke right now, dont delete this line till fix it. =P @@ -1355,27 +1355,27 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Name: %s", name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", + Log.Out(Logs::Detail, Logs::World_Server, "Character creation request from %s LS#%d (%s:%d) : ", GetCLE()->LSName(), GetCLE()->LSID(), inet_ntoa(in), GetPort()); + Log.Out(Logs::Detail, Logs::World_Server, "Name: %s", name); + Log.Out(Logs::Detail, Logs::World_Server, "Race: %d Class: %d Gender: %d Deity: %d Start zone: %d Tutorial: %s", cc->race, cc->class_, cc->gender, cc->deity, cc->start_zone, cc->tutorial ? "true" : "false"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "STR STA AGI DEX WIS INT CHA Total"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", + Log.Out(Logs::Detail, Logs::World_Server, "STR STA AGI DEX WIS INT CHA Total"); + Log.Out(Logs::Detail, Logs::World_Server, "%3d %3d %3d %3d %3d %3d %3d %3d", cc->STR, cc->STA, cc->AGI, cc->DEX, cc->WIS, cc->INT, cc->CHA, stats_sum); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); + Log.Out(Logs::Detail, Logs::World_Server, "Face: %d Eye colors: %d %d", cc->face, cc->eyecolor1, cc->eyecolor2); + Log.Out(Logs::Detail, Logs::World_Server, "Hairstyle: %d Haircolor: %d", cc->hairstyle, cc->haircolor); + Log.Out(Logs::Detail, Logs::World_Server, "Beard: %d Beardcolor: %d", cc->beard, cc->beardcolor); /* Validate the char creation struct */ if (ClientVersionBit & BIT_SoFAndLater) { if (!CheckCharCreateInfoSoF(cc)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.Out(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } else { if (!CheckCharCreateInfoTitanium(cc)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); + Log.Out(Logs::Detail, Logs::World_Server,"CheckCharCreateInfo did not validate the request (bad race/class/stats)"); return false; } } @@ -1437,21 +1437,21 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) /* If it is an SoF Client and the SoF Start Zone rule is set, send new chars there */ if (ClientVersionBit & BIT_SoFAndLater && RuleI(World, SoFStartZoneID) > 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); + Log.Out(Logs::Detail, Logs::World_Server,"Found 'SoFStartZoneID' rule setting: %i", RuleI(World, SoFStartZoneID)); pp.zone_id = RuleI(World, SoFStartZoneID); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); + Log.Out(Logs::Detail, Logs::World_Server,"Error getting zone id for Zone ID %i", RuleI(World, SoFStartZoneID)); } else { /* if there's a startzone variable put them in there */ if (database.GetVariable("startzone", startzone, 50)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found 'startzone' variable setting: %s", startzone); + Log.Out(Logs::Detail, Logs::World_Server,"Found 'startzone' variable setting: %s", startzone); pp.zone_id = database.GetZoneID(startzone); if (pp.zone_id) database.GetSafePoints(pp.zone_id, 0, &pp.x, &pp.y, &pp.z); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error getting zone id for '%s'", startzone); + Log.Out(Logs::Detail, Logs::World_Server,"Error getting zone id for '%s'", startzone); } else { /* otherwise use normal starting zone logic */ bool ValidStartZone = false; if (ClientVersionBit & BIT_TitaniumAndEarlier) @@ -1490,11 +1490,11 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) pp.binds[0].z = pp.z; pp.binds[0].heading = pp.heading; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", + Log.Out(Logs::Detail, Logs::World_Server,"Current location: %s (%d) %0.2f, %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.zone_id), pp.zone_id, pp.x, pp.y, pp.z, pp.heading); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.Out(Logs::Detail, Logs::World_Server,"Bind location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[0].zoneId), pp.binds[0].zoneId, pp.binds[0].x, pp.binds[0].y, pp.binds[0].z); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", + Log.Out(Logs::Detail, Logs::World_Server,"Home location: %s (%d) %0.2f, %0.2f, %0.2f", database.GetZoneName(pp.binds[4].zoneId), pp.binds[4].zoneId, pp.binds[4].x, pp.binds[4].y, pp.binds[4].z); /* Starting Items inventory */ @@ -1503,10 +1503,10 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) // now we give the pp and the inv we made to StoreCharacter // to see if we can store it if (!database.StoreCharacter(GetAccountID(), &pp, &inv)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation failed: %s", pp.name); + Log.Out(Logs::Detail, Logs::World_Server,"Character creation failed: %s", pp.name); return false; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Character creation successful: %s", pp.name); + Log.Out(Logs::Detail, Logs::World_Server,"Character creation successful: %s", pp.name); return true; } @@ -1516,7 +1516,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) if (!cc) return false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Validating char creation info..."); + Log.Out(Logs::Detail, Logs::World_Server, "Validating char creation info..."); RaceClassCombos class_combo; bool found = false; @@ -1533,7 +1533,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find class/race/deity/start_zone combination"); + Log.Out(Logs::Detail, Logs::World_Server, "Could not find class/race/deity/start_zone combination"); return false; } @@ -1550,7 +1550,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) } if (!found) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); + Log.Out(Logs::Detail, Logs::World_Server, "Could not find starting stats for selected character combo, cannot verify stats"); return false; } @@ -1563,37 +1563,37 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) allocation.DefaultPointAllocation[6]; if (cc->STR > allocation.BaseStats[0] + max_stats || cc->STR < allocation.BaseStats[0]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Strength out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Strength out of range"); return false; } if (cc->DEX > allocation.BaseStats[1] + max_stats || cc->DEX < allocation.BaseStats[1]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Dexterity out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Dexterity out of range"); return false; } if (cc->AGI > allocation.BaseStats[2] + max_stats || cc->AGI < allocation.BaseStats[2]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Agility out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Agility out of range"); return false; } if (cc->STA > allocation.BaseStats[3] + max_stats || cc->STA < allocation.BaseStats[3]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Stamina out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Stamina out of range"); return false; } if (cc->INT > allocation.BaseStats[4] + max_stats || cc->INT < allocation.BaseStats[4]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Intelligence out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Intelligence out of range"); return false; } if (cc->WIS > allocation.BaseStats[5] + max_stats || cc->WIS < allocation.BaseStats[5]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Wisdom out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Wisdom out of range"); return false; } if (cc->CHA > allocation.BaseStats[6] + max_stats || cc->CHA < allocation.BaseStats[6]) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Charisma out of range"); + Log.Out(Logs::Detail, Logs::World_Server, "Charisma out of range"); return false; } @@ -1606,7 +1606,7 @@ bool CheckCharCreateInfoSoF(CharCreate_Struct *cc) current_stats += cc->WIS - allocation.BaseStats[5]; current_stats += cc->CHA - allocation.BaseStats[6]; if (current_stats > max_stats) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Current Stats > Maximum Stats"); + Log.Out(Logs::Detail, Logs::World_Server, "Current Stats > Maximum Stats"); return false; } @@ -1687,7 +1687,7 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) if (!cc) return false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Validating char creation info..."); + Log.Out(Logs::Detail, Logs::World_Server,"Validating char creation info..."); classtemp = cc->class_ - 1; racetemp = cc->race - 1; @@ -1700,16 +1700,16 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // if out of range looking it up in the table would crash stuff // so we return from these if (classtemp >= PLAYER_CLASS_COUNT) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," class is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," class is out of range"); return false; } if (racetemp >= _TABLE_RACES) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," race is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," race is out of range"); return false; } if (!ClassRaceLookupTable[classtemp][racetemp]) { //Lookup table better than a bunch of ifs? - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," invalid race/class combination"); + Log.Out(Logs::Detail, Logs::World_Server," invalid race/class combination"); // we return from this one, since if it's an invalid combination our table // doesn't have meaningful values for the stats return false; @@ -1737,43 +1737,43 @@ bool CheckCharCreateInfoTitanium(CharCreate_Struct *cc) // that are messed up not just the first hit if (bTOTAL + stat_points != cTOTAL) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); + Log.Out(Logs::Detail, Logs::World_Server," stat points total doesn't match expected value: expecting %d got %d", bTOTAL + stat_points, cTOTAL); Charerrors++; } if (cc->STR > bSTR + stat_points || cc->STR < bSTR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STR is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat STR is out of range"); Charerrors++; } if (cc->STA > bSTA + stat_points || cc->STA < bSTA) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat STA is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat STA is out of range"); Charerrors++; } if (cc->AGI > bAGI + stat_points || cc->AGI < bAGI) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat AGI is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat AGI is out of range"); Charerrors++; } if (cc->DEX > bDEX + stat_points || cc->DEX < bDEX) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat DEX is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat DEX is out of range"); Charerrors++; } if (cc->WIS > bWIS + stat_points || cc->WIS < bWIS) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat WIS is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat WIS is out of range"); Charerrors++; } if (cc->INT > bINT + stat_points || cc->INT < bINT) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat INT is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat INT is out of range"); Charerrors++; } if (cc->CHA > bCHA + stat_points || cc->CHA < bCHA) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," stat CHA is out of range"); + Log.Out(Logs::Detail, Logs::World_Server," stat CHA is out of range"); Charerrors++; } /*TODO: Check for deity/class/race.. it'd be nice, but probably of any real use to hack(faction, deity based items are all I can think of) I am NOT writing those tables - kathgar*/ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found %d errors in character creation request", Charerrors); + Log.Out(Logs::Detail, Logs::World_Server,"Found %d errors in character creation request", Charerrors); return Charerrors == 0; } diff --git a/world/cliententry.cpp b/world/cliententry.cpp index 976ab113c..93adbc931 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -267,7 +267,7 @@ bool ClientListEntry::CheckAuth(uint32 iLSID, const char* iKey) { int16 tmpStatus = WorldConfig::get()->DefaultStatus; paccountid = database.CreateAccount(plsname, 0, tmpStatus, LSID()); if (!paccountid) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); + Log.Out(Logs::Detail, Logs::World_Server,"Error adding local account for LS login: '%s', duplicate name?" ,plsname); return false; } strn0cpy(paccountname, plsname, sizeof(paccountname)); diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 6ab4f9d78..53f989538 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -56,7 +56,7 @@ void ClientList::Process() { if (!iterator.GetData()->Process()) { struct in_addr in; in.s_addr = iterator.GetData()->GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"Removing client from %s:%d", inet_ntoa(in), iterator.GetData()->GetPort()); //the client destructor should take care of this. // iterator.GetData()->Free(); iterator.RemoveCurrent(); @@ -425,7 +425,7 @@ ClientListEntry* ClientList::CheckAuth(const char* iName, const char* iPassword) } int16 tmpadmin; - //Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login with '%s' and '%s'", iName, iPassword); + //Log.LogDebugType(Logs::Detail, Logs::World_Server,"Login with '%s' and '%s'", iName, iPassword); uint32 accid = database.CheckLogin(iName, iPassword, &tmpadmin); if (accid) { @@ -447,7 +447,7 @@ void ClientList::SendOnlineGuildMembers(uint32 FromID, uint32 GuildID) if(!from) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); + Log.Out(Logs::Detail, Logs::World_Server,"Invalid client. FromID=%i GuildID=%i", FromID, GuildID); return; } @@ -751,7 +751,7 @@ void ClientList::SendWhoAll(uint32 fromid,const char* to, int16 admin, Who_All_S safe_delete(output); } catch(...){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); + Log.Out(Logs::Detail, Logs::World_Server,"Unknown error in world's SendWhoAll (probably mem error), ignoring..."); return; } } @@ -895,7 +895,7 @@ void ClientList::SendFriendsWho(ServerFriendsWho_Struct *FriendsWho, WorldTCPCon safe_delete(pack2); } catch(...){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); + Log.Out(Logs::Detail, Logs::World_Server,"Unknown error in world's SendFriendsWho (probably mem error), ignoring..."); return; } } @@ -1130,7 +1130,7 @@ Client* ClientList::FindByAccountID(uint32 account_id) { iterator.Reset(); while(iterator.MoreElements()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); + Log.Out(Logs::Detail, Logs::World_Server, "ClientList[0x%08x]::FindByAccountID(%p) iterator.GetData()[%p]", this, account_id, iterator.GetData()); if (iterator.GetData()->GetAccountID() == account_id) { Client* tmp = iterator.GetData(); return tmp; @@ -1145,7 +1145,7 @@ Client* ClientList::FindByName(char* charname) { iterator.Reset(); while(iterator.MoreElements()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); + Log.Out(Logs::Detail, Logs::World_Server, "ClientList[0x%08x]::FindByName(\"%s\") iterator.GetData()[%p]", this, charname, iterator.GetData()); if (iterator.GetData()->GetCharName() == charname) { Client* tmp = iterator.GetData(); return tmp; diff --git a/world/console.cpp b/world/console.cpp index bb15f724b..fbf9415bd 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -88,7 +88,7 @@ void Console::Die() { state = CONSOLE_STATE_CLOSED; struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"Removing console from %s:%d",inet_ntoa(in),GetPort()); tcpc->Disconnect(); } @@ -219,7 +219,7 @@ bool Console::Process() { if (!tcpc->Connected()) { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"Removing console (!tcpc->Connected) from %s:%d",inet_ntoa(in),GetPort()); return false; } //if we have not gotten the special markers after this timer, send login prompt @@ -234,7 +234,7 @@ bool Console::Process() { SendMessage(1, "Timeout, disconnecting..."); struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"TCP connection timeout from %s:%d",inet_ntoa(in),GetPort()); return false; } @@ -243,29 +243,29 @@ bool Console::Process() { in.s_addr = GetIP(); if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeZone) { auto zs = new ZoneServer(tcpc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"New zoneserver #%d from %s:%d", zs->GetID(), inet_ntoa(in), GetPort()); zoneserver_list.Add(zs); numzones++; tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeLauncher) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"New launcher from %s:%d", inet_ntoa(in), GetPort()); launcher_list.Add(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeUCS) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"New UCS Connection from %s:%d", inet_ntoa(in), GetPort()); UCSLink.SetConnection(tcpc); tcpc = 0; } else if(tcpc->GetPacketMode() == EmuTCPConnection::packetModeQueryServ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"New QS Connection from %s:%d", inet_ntoa(in), GetPort()); QSLink.SetConnection(tcpc); tcpc = 0; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); + Log.Out(Logs::Detail, Logs::World_Server,"Unsupported packet mode from %s:%d", inet_ntoa(in), GetPort()); } return false; } @@ -422,7 +422,7 @@ void Console::ProcessCommand(const char* command) { state = CONSOLE_STATE_CLOSED; return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); + Log.Out(Logs::Detail, Logs::World_Server,"TCP console authenticated: Username=%s, Admin=%d",paccountname,admin); SendMessage(1, 0); SendMessage(2, "Login accepted."); state = CONSOLE_STATE_CONNECTED; @@ -431,7 +431,7 @@ void Console::ProcessCommand(const char* command) { break; } case CONSOLE_STATE_CONNECTED: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"TCP command: %s: \"%s\"",paccountname,command); + Log.Out(Logs::Detail, Logs::World_Server,"TCP command: %s: \"%s\"",paccountname,command); Seperator sep(command); if (strcasecmp(sep.arg[0], "help") == 0 || strcmp(sep.arg[0], "?") == 0) { SendMessage(1, " whoami"); @@ -719,7 +719,7 @@ void Console::ProcessCommand(const char* command) { tmpname[0] = '*'; strcpy(&tmpname[1], paccountname); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); + Log.Out(Logs::Detail, Logs::World_Server,"Console ZoneBootup: %s, %s, %s",tmpname,sep.arg[2],sep.arg[1]); zoneserver_list.SOPZoneBootup(tmpname, atoi(sep.arg[1]), sep.arg[2], (bool) (strcasecmp(sep.arg[3], "static") == 0)); } } @@ -803,7 +803,7 @@ void Console::ProcessCommand(const char* command) { #endif RunLoops = true; SendMessage(1, " Login Server Reconnect manually restarted by Console"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Console"); + Log.Out(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Console"); } else if (strcasecmp(sep.arg[0], "zonelock") == 0 && admin >= consoleZoneStatus) { if (strcasecmp(sep.arg[1], "list") == 0) { diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 13f095575..85f98713d 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -42,7 +42,7 @@ void EQLConfig::LoadSettings() { std::string query = StringFormat("SELECT dynamics FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); else { auto row = results.begin(); m_dynamics = atoi(row[0]); @@ -51,7 +51,7 @@ void EQLConfig::LoadSettings() { query = StringFormat("SELECT zone, port FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "EQLConfig::LoadSettings: %s", results.ErrorMessage().c_str()); return; } @@ -73,7 +73,7 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } @@ -118,14 +118,14 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } @@ -173,7 +173,7 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -202,7 +202,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.Out(Logs::General, Logs::Error, "Update for unknown zone %s", short_name); return false; } @@ -217,7 +217,7 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -239,7 +239,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { res = m_zones.find(short_name); if(res == m_zones.end()) { //not found. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update for unknown zone %s", short_name); + Log.Out(Logs::General, Logs::Error, "Update for unknown zone %s", short_name); return false; } @@ -254,7 +254,7 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } @@ -279,7 +279,7 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/eqw.cpp b/world/eqw.cpp index 0137bfe8e..7ff709ec6 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -75,11 +75,11 @@ EQW::EQW() { void EQW::AppendOutput(const char *str) { m_outputBuffer += str; -// Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length()); +// Log.LogDebugType(Logs::Detail, Logs::World_Server, "Append %d chars, yeilding result of length %d", strlen(str), m_outputBuffer.length()); } const std::string &EQW::GetOutput() const { -// Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Getting, length %d", m_outputBuffer.length()); +// Log.LogDebugType(Logs::Detail, Logs::World_Server, "Getting, length %d", m_outputBuffer.length()); return(m_outputBuffer); } @@ -269,7 +269,7 @@ void EQW::LSReconnect() { pthread_create(&thread, nullptr, &AutoInitLoginServer, nullptr); #endif RunLoops = true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Login Server Reconnect manually restarted by Web Tool"); + Log.Out(Logs::Detail, Logs::World_Server,"Login Server Reconnect manually restarted by Web Tool"); } /*EQLConfig * EQW::FindLauncher(Const_char *zone_ref) { diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index c1afc41e8..ba2e5b21c 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -139,11 +139,11 @@ bool EQWHTTPHandler::CheckAuth() const { int16 status = 0; uint32 acctid = database.CheckLogin(m_username.c_str(), m_password.c_str(), &status); if(acctid == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Login autentication failed for %s with '%s'", m_username.c_str(), m_password.c_str()); return(false); } if(status < httpLoginStatus) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login of %s failed: status too low.", m_username.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Login of %s failed: status too low.", m_username.c_str()); return(false); } @@ -278,29 +278,29 @@ void EQWHTTPServer::CreateNewConnection(uint32 ID, SOCKET in_socket, uint32 irIP } void EQWHTTPServer::Stop() { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requesting that HTTP Service stop."); + Log.Out(Logs::Detail, Logs::World_Server, "Requesting that HTTP Service stop."); m_running = false; Close(); } bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { if(m_running) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Service is already running on port %d", m_port); + Log.Out(Logs::Detail, Logs::World_Server, "HTTP Service is already running on port %d", m_port); return(false); } //load up our nice mime types if(!EQWHTTPHandler::LoadMimeTypes(mime_file)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load mime types from '%s'", mime_file); + Log.Out(Logs::Detail, Logs::World_Server, "Failed to load mime types from '%s'", mime_file); return(false); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded mime types from %s", mime_file); + Log.Out(Logs::Detail, Logs::World_Server, "Loaded mime types from %s", mime_file); } //fire up the server thread char errbuf[TCPServer_ErrorBufferSize]; if(!Open(port, errbuf)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to bind to port %d for HTTP service: %s", port, errbuf); return(false); } @@ -320,12 +320,12 @@ bool EQWHTTPServer::Start(uint16 port, const char *mime_file) { /* void EQWHTTPServer::Run() { - Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread started on port %d", m_port); + Log.LogDebugType(Logs::Detail, Logs::World_Server, "HTTP Processing thread started on port %d", m_port); do { #warning DELETE THIS IF YOU DONT USE IT Sleep(10); } while(m_running); - Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP Processing thread terminating on port %d", m_port); + Log.LogDebugType(Logs::Detail, Logs::World_Server, "HTTP Processing thread terminating on port %d", m_port); } ThreadReturnType EQWHTTPServer::ThreadProc(void *data) { diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index f0970b1fe..49c1317f5 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -65,7 +65,7 @@ EQWParser::EQWParser() { my_perl = perl_alloc(); _empty_sv = newSV(0); if(!my_perl) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: perl_alloc failed!"); + Log.Out(Logs::Detail, Logs::World_Server, "Error: perl_alloc failed!"); else DoInit(); } @@ -182,10 +182,10 @@ void EQWParser::DoInit() { #ifdef EMBPERL_PLUGIN - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading worldui perl plugins."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading worldui perl plugins."); std::string err; if(!eval_file("world", "worldui.pl", err)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning - world.pl: %s", err.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Warning - world.pl: %s", err.c_str()); } eval_pv( diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 6ac7c6326..eac6a63f0 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -79,7 +79,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.Out(Logs::Detail, Logs::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -90,7 +90,7 @@ bool LauncherLink::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher authorization failed."); + Log.Out(Logs::Detail, Logs::World_Server, "Launcher authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -100,7 +100,7 @@ bool LauncherLink::Process() { } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(Logs::Detail, Logs::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -114,25 +114,25 @@ bool LauncherLink::Process() { break; } case ServerOP_ZAAuth: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Got authentication from %s when they are already authenticated.", m_name.c_str()); break; } case ServerOP_LauncherConnectInfo: { const LauncherConnectInfo *it = (const LauncherConnectInfo *) pack->pBuffer; if(HasName()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); + Log.Out(Logs::Detail, Logs::World_Server, "Launcher '%s' received an additional connect packet with name '%s'. Ignoring.", m_name.c_str(), it->name); break; } m_name = it->name; EQLConfig *config = launcher_list.GetConfig(m_name.c_str()); if(config == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); + Log.Out(Logs::Detail, Logs::World_Server, "Unknown launcher '%s' connected. Disconnecting.", it->name); Disconnect(); break; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); + Log.Out(Logs::Detail, Logs::World_Server, "Launcher Identified itself as '%s'. Loading zone list.", it->name); std::vector result; //database.GetLauncherZones(it->name, result); @@ -146,7 +146,7 @@ bool LauncherLink::Process() { zs.port = cur->port; zs.up = false; zs.starts = 0; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); + Log.Out(Logs::Detail, Logs::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), cur->name.c_str(), zs.port); m_states[cur->name] = zs; } @@ -162,17 +162,17 @@ bool LauncherLink::Process() { std::map::iterator res; res = m_states.find(it->short_name); if(res == m_states.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); + Log.Out(Logs::Detail, Logs::World_Server, "%s: reported state for zone %s which it does not have.", m_name.c_str(), it->short_name); break; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); + Log.Out(Logs::Detail, Logs::World_Server, "%s: %s reported state %s (%d starts)", m_name.c_str(), it->short_name, it->running?"STARTED":"STOPPED", it->start_count); res->second.up = it->running; res->second.starts = it->start_count; break; } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); + Log.Out(Logs::Detail, Logs::World_Server, "Unknown ServerOPcode from launcher 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -200,7 +200,7 @@ void LauncherLink::BootZone(const char *short_name, uint16 port) { zs.port = port; zs.up = false; zs.starts = 0; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); + Log.Out(Logs::Detail, Logs::World_Server, "%s: Loaded zone '%s' on port %d", m_name.c_str(), short_name, zs.port); m_states[short_name] = zs; StartZone(short_name); diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 0e258d78c..b00da266d 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -60,7 +60,7 @@ void LauncherList::Process() { //printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d", l->GetID()); + Log.Out(Logs::Detail, Logs::World_Server, "Removing pending launcher %d", l->GetID()); cur = m_pendingLaunchers.erase(cur); delete l; } else if(l->HasName()) { @@ -72,10 +72,10 @@ void LauncherList::Process() { std::map::iterator res; res = m_launchers.find(name); if(res != m_launchers.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Ghosting launcher %s", name.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Ghosting launcher %s", name.c_str()); delete res->second; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Removing pending launcher %d. Adding %s to active list.", l->GetID(), name.c_str()); //put the launcher in the list. m_launchers[name] = l; } else { @@ -91,7 +91,7 @@ void LauncherList::Process() { //printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); + Log.Out(Logs::Detail, Logs::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); curl = m_launchers.erase(curl); delete l; } else { @@ -131,7 +131,7 @@ LauncherLink *LauncherList::FindByZone(const char *short_name) { void LauncherList::Add(EmuTCPConnection *conn) { auto it = new LauncherLink(nextID++, conn); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Adding pending launcher %d", it->GetID()); + Log.Out(Logs::Detail, Logs::World_Server, "Adding pending launcher %d", it->GetID()); m_pendingLaunchers.push_back(it); } diff --git a/world/login_server.cpp b/world/login_server.cpp index 84a4b4ebb..0bec7cef3 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -96,7 +96,7 @@ bool LoginServer::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); + Log.Out(Logs::Detail, Logs::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { @@ -160,12 +160,12 @@ bool LoginServer::Process() { case ServerOP_LSFatalError: { #ifndef IGNORE_LS_FATAL_ERROR WorldConfig::DisableLoginserver(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError. Disabling reconnect."); + Log.Out(Logs::Detail, Logs::World_Server, "Login server responded with FatalError. Disabling reconnect."); #else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Login server responded with FatalError."); + Log.Out(Logs::Detail, Logs::World_Server, "Login server responded with FatalError."); #endif if (pack->size > 1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, " %s",pack->pBuffer); + Log.Out(Logs::Detail, Logs::World_Server, " %s",pack->pBuffer); } break; } @@ -177,18 +177,18 @@ bool LoginServer::Process() { case ServerOP_LSRemoteAddr: { if (!Config->WorldAddress.length()) { WorldConfig::SetWorldAddress((char *)pack->pBuffer); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loginserver provided %s as world address",pack->pBuffer); + Log.Out(Logs::Detail, Logs::World_Server, "Loginserver provided %s as world address",pack->pBuffer); } break; } case ServerOP_LSAccountUpdate: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); + Log.Out(Logs::Detail, Logs::World_Server, "Received ServerOP_LSAccountUpdate packet from loginserver"); CanAccountUpdate = true; break; } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); + Log.Out(Logs::Detail, Logs::World_Server, "Unknown LSOpCode: 0x%04x size=%d",(int)pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } @@ -202,10 +202,10 @@ bool LoginServer::Process() { bool LoginServer::InitLoginServer() { if(Connected() == false) { if(ConnectReady()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(Logs::Detail, Logs::World_Server, "Connecting to login server: %s:%d",LoginServerAddress,LoginServerPort); Connect(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", + Log.Out(Logs::Detail, Logs::World_Server, "Not connected but not ready to connect, this is bad: %s:%d", LoginServerAddress,LoginServerPort); } } @@ -216,29 +216,29 @@ bool LoginServer::Connect() { char tmp[25]; if(database.GetVariable("loginType",tmp,sizeof(tmp)) && strcasecmp(tmp,"MinILogin") == 0){ minilogin = true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Setting World to MiniLogin Server type"); + Log.Out(Logs::Detail, Logs::World_Server, "Setting World to MiniLogin Server type"); } else minilogin = false; if (minilogin && WorldConfig::get()->WorldAddress.length()==0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "**** For minilogin to work, you need to set the
element in the section."); + Log.Out(Logs::Detail, Logs::World_Server, "**** For minilogin to work, you need to set the
element in the section."); return false; } char errbuf[TCPConnection_ErrorBufferSize]; if ((LoginServerIP = ResolveIP(LoginServerAddress, errbuf)) == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to resolve '%s' to an IP.",LoginServerAddress); return false; } if (LoginServerIP == 0 || LoginServerPort == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(Logs::Detail, Logs::World_Server, "Connect info incomplete, cannot connect: %s:%d",LoginServerAddress,LoginServerPort); return false; } if (tcpc->ConnectIP(LoginServerIP, LoginServerPort, errbuf)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(Logs::Detail, Logs::World_Server, "Connected to Loginserver: %s:%d",LoginServerAddress,LoginServerPort); if (minilogin) SendInfo(); else @@ -248,7 +248,7 @@ bool LoginServer::Connect() { return true; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); + Log.Out(Logs::Detail, Logs::World_Server, "Could not connect to login server: %s:%d %s",LoginServerAddress,LoginServerPort,errbuf); return false; } } @@ -324,7 +324,7 @@ void LoginServer::SendStatus() { void LoginServer::SendAccountUpdate(ServerPacket* pack) { ServerLSAccountUpdate_Struct* s = (ServerLSAccountUpdate_Struct *) pack->pBuffer; if(CanUpdate()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); + Log.Out(Logs::Detail, Logs::World_Server, "Sending ServerOP_LSAccountUpdate packet to loginserver: %s:%d",LoginServerAddress,LoginServerPort); strn0cpy(s->worldaccount, LoginAccount, 30); strn0cpy(s->worldpassword, LoginPassword, 30); SendPacket(pack); diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index bcdd67aa3..e76b38b71 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -134,7 +134,7 @@ bool LoginServerList::SendPacket(ServerPacket* pack) { bool LoginServerList::SendAccountUpdate(ServerPacket* pack) { LinkedListIterator iterator(list); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); + Log.Out(Logs::Detail, Logs::World_Server, "Requested to send ServerOP_LSAccountUpdate packet to all loginservers"); iterator.Reset(); while(iterator.MoreElements()){ if(iterator.GetData()->CanUpdate()) { diff --git a/world/net.cpp b/world/net.cpp index 89544cca6..bab38026b 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -126,36 +126,36 @@ int main(int argc, char** argv) { } // Load server configuration - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration.."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading server configuration failed."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.Out(Logs::Detail, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Could not set signal handler"); + Log.Out(Logs::Detail, Logs::World_Server, "Could not set signal handler"); return 1; } #endif @@ -164,7 +164,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + Log.Out(Logs::Detail, Logs::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -172,19 +172,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + Log.Out(Logs::Detail, Logs::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connecting to MySQL..."); + Log.Out(Logs::Detail, Logs::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::Detail, Logs::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -280,56 +280,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Starting HTTP world service..."); + Log.Out(Logs::Detail, Logs::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "HTTP world service disabled."); + Log.Out(Logs::Detail, Logs::World_Server, "HTTP world service disabled."); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking Database Conversions.."); + Log.Out(Logs::Detail, Logs::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading variables.."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading variables.."); database.LoadVariables(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading zones.."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading zones.."); database.LoadZoneNames(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing groups.."); + Log.Out(Logs::Detail, Logs::World_Server, "Clearing groups.."); database.ClearGroup(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing raids.."); + Log.Out(Logs::Detail, Logs::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading items.."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading items.."); if (!database.LoadItems()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load item data. But ignoring"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading skill caps.."); + Log.Out(Logs::Detail, Logs::World_Server, "Error: Could not load item data. But ignoring"); + Log.Out(Logs::Detail, Logs::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Error: Could not load skill cap data. But ignoring"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading guilds.."); + Log.Out(Logs::Detail, Logs::World_Server, "Error: Could not load skill cap data. But ignoring"); + Log.Out(Logs::Detail, Logs::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::Detail, Logs::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(Logs::Detail, Logs::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "No rule set configured, using default rules"); + Log.Out(Logs::Detail, Logs::World_Server, "No rule set configured, using default rules"); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loaded default rule set 'default'", tmp); + Log.Out(Logs::Detail, Logs::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Clearing temporary merchant lists.."); + Log.Out(Logs::Detail, Logs::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading EQ time of day.."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading launcher list.."); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -338,45 +338,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + Log.Out(Logs::Detail, Logs::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + Log.Out(Logs::Detail, Logs::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading adventures..."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to load adventure templates."); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Purging expired instances"); + Log.Out(Logs::Detail, Logs::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Loading char create info..."); + Log.Out(Logs::Detail, Logs::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener started."); + Log.Out(Logs::Detail, Logs::World_Server,"Zone (TCP) listener started."); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server," %s",errbuf); + Log.Out(Logs::Detail, Logs::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + Log.Out(Logs::Detail, Logs::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener started."); + Log.Out(Logs::Detail, Logs::World_Server,"Client (UDP) listener started."); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to start client (UDP) listener (port 9000)"); + Log.Out(Logs::Detail, Logs::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -404,7 +404,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -417,19 +417,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + Log.Out(Logs::Detail, Logs::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + Log.Out(Logs::Detail, Logs::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + Log.Out(Logs::Detail, Logs::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -441,7 +441,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + Log.Out(Logs::Detail, Logs::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -492,16 +492,16 @@ int main(int argc, char** argv) { } Sleep(20); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"World main loop completed."); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down console connections (if any)."); + Log.Out(Logs::Detail, Logs::World_Server,"World main loop completed."); + Log.Out(Logs::Detail, Logs::World_Server,"Shutting down console connections (if any)."); console_list.KillAll(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Shutting down zone connections (if any)."); + Log.Out(Logs::Detail, Logs::World_Server,"Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone (TCP) listener stopped."); + Log.Out(Logs::Detail, Logs::World_Server,"Zone (TCP) listener stopped."); tcps.Close(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Client (UDP) listener stopped."); + Log.Out(Logs::Detail, Logs::World_Server,"Client (UDP) listener stopped."); eqsf.Close(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Signaling HTTP service to stop..."); + Log.Out(Logs::Detail, Logs::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); CheckEQEMuErrorAndPause(); @@ -509,9 +509,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Caught signal %d",sig_num); + Log.Out(Logs::Detail, Logs::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Failed to save time file."); + Log.Out(Logs::Detail, Logs::World_Server,"Failed to save time file."); RunLoops = false; } diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 3291933e8..6457d7e6c 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -23,7 +23,7 @@ void QueryServConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); + Log.Out(Logs::Detail, Logs::QS_Server, "Incoming QueryServ Connection while we were already connected to a QueryServ."); Stream->Disconnect(); } @@ -57,7 +57,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.Out(Logs::Detail, Logs::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -69,7 +69,7 @@ bool QueryServConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "QueryServ authorization failed."); + Log.Out(Logs::Detail, Logs::QS_Server, "QueryServ authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -79,7 +79,7 @@ bool QueryServConnection::Process() } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(Logs::Detail, Logs::QS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -97,7 +97,7 @@ bool QueryServConnection::Process() } case ServerOP_ZAAuth: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Got authentication from QueryServ when they are already authenticated."); + Log.Out(Logs::Detail, Logs::QS_Server, "Got authentication from QueryServ when they are already authenticated."); break; } case ServerOP_QueryServGeneric: @@ -114,7 +114,7 @@ bool QueryServConnection::Process() } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); + Log.Out(Logs::Detail, Logs::QS_Server, "Unknown ServerOPcode from QueryServ 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/ucs.cpp b/world/ucs.cpp index 178a97c1a..13032d091 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -18,7 +18,7 @@ void UCSConnection::SetConnection(EmuTCPConnection *inStream) { if(Stream) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Incoming UCS Connection while we were already connected to a UCS."); Stream->Disconnect(); } @@ -52,7 +52,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.Out(Logs::Detail, Logs::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -64,7 +64,7 @@ bool UCSConnection::Process() { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "UCS authorization failed."); + Log.Out(Logs::Detail, Logs::UCS_Server, "UCS authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -74,7 +74,7 @@ bool UCSConnection::Process() } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(Logs::Detail, Logs::UCS_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } delete pack; @@ -92,12 +92,12 @@ bool UCSConnection::Process() } case ServerOP_ZAAuth: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Got authentication from UCS when they are already authenticated."); + Log.Out(Logs::Detail, Logs::UCS_Server, "Got authentication from UCS when they are already authenticated."); break; } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); + Log.Out(Logs::Detail, Logs::UCS_Server, "Unknown ServerOPcode from UCS 0x%04x, size %d", pack->opcode, pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index a6ff8947b..1b7f8739e 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -34,7 +34,7 @@ WorldGuildManager guild_mgr; void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.Out(Logs::Detail, Logs::Guilds, "Broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); auto pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -47,7 +47,7 @@ void WorldGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, } void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Broadcasting char refresh for %d from guild %d to world", charid, guild_id); auto pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -58,7 +58,7 @@ void WorldGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, ui } void WorldGuildManager::SendGuildDelete(uint32 guild_id) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Broadcasting guild delete for guild %d to world", guild_id); auto pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -71,18 +71,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.Out(Logs::Detail, Logs::Guilds, "Received and broadcasting guild refresh for %d, changes: name=%d, motd=%d, rank=d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!RefreshGuild(s->guild_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Unable to preform local refresh on guild %d", s->guild_id); //can we do anything? } @@ -91,11 +91,11 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Received and broadcasting guild member refresh for char %d to all zones with members of guild %d", s->char_id, s->guild_id); //preform the local update client_list.UpdateClientGuild(s->char_id, s->guild_id); @@ -110,18 +110,18 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Received and broadcasting guild delete for guild %d", s->guild_id); //broadcast this packet to all zones. zoneserver_list.SendPacket(pack); //preform a local refresh. if(!LocalDeleteGuild(s->guild_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to preform local delete on guild %d", s->guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Unable to preform local delete on guild %d", s->guild_id); //can we do anything? } @@ -131,7 +131,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { case ServerOP_GuildMemberUpdate: { if(pack->size != sizeof(ServerGuildMemberUpdate_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); + Log.Out(Logs::Detail, Logs::Guilds, "Received ServerOP_GuildMemberUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildMemberUpdate_Struct)); return; } @@ -141,7 +141,7 @@ void WorldGuildManager::ProcessZonePacket(ServerPacket *pack) { } default: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); + Log.Out(Logs::Detail, Logs::Guilds, "Unknown packet 0x%x received from zone??", pack->opcode); break; } } diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 311ade1e7..5fa4313da 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,11 +298,11 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Start zone query: %s\n", query.c_str()); + Log.Out(Logs::General, Logs::Status, "Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -395,7 +395,7 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.Out(Logs::General, Logs::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -434,11 +434,11 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "SoF Start zone query: %s\n", query.c_str()); + Log.Out(Logs::General, Logs::Status, "SoF Start zone query: %s\n", query.c_str()); if (results.RowCount() == 0) { printf("No start_zones entry in database, using defaults\n"); @@ -453,7 +453,7 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Found starting location in start_zones"); + Log.Out(Logs::General, Logs::Status, "Found starting location in start_zones"); auto row = results.begin(); in_pp->x = atof(row[0]); in_pp->y = atof(row[1]); @@ -478,7 +478,7 @@ void WorldDatabase::GetLauncherList(std::vector &rl) { const std::string query = "SELECT name FROM launcher"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "WorldDatabase::GetLauncherList: %s", results.ErrorMessage().c_str()); return; } @@ -500,7 +500,7 @@ void WorldDatabase::SetMailKey(int CharID, int IPAddress, int MailKey) { MailKeyString, CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "WorldDatabase::SetMailKey(%i, %s) : %s", CharID, MailKeyString, results.ErrorMessage().c_str()); } @@ -509,7 +509,7 @@ bool WorldDatabase::GetCharacterLevel(const char *name, int &level) std::string query = StringFormat("SELECT level FROM character_data WHERE name = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "WorldDatabase::GetCharacterLevel: %s", results.ErrorMessage().c_str()); return false; } diff --git a/world/zonelist.cpp b/world/zonelist.cpp index 3045e4c6e..52879cafa 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -79,7 +79,7 @@ void ZSList::KillAll() { void ZSList::Process() { if(shutdowntimer && shutdowntimer->Check()){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); + Log.Out(Logs::Detail, Logs::World_Server, "Shutdown timer has expired. Telling all zones to shut down and exiting. (fake sigint)"); auto pack2 = new ServerPacket; pack2->opcode = ServerOP_ShutdownAll; pack2->size=0; @@ -99,10 +99,10 @@ void ZSList::Process() { ZoneServer* zs = iterator.GetData(); struct in_addr in; in.s_addr = zs->GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); + Log.Out(Logs::Detail, Logs::World_Server,"Removing zoneserver #%d at %s:%d",zs->GetID(),zs->GetCAddress(),zs->GetCPort()); zs->LSShutDownUpdate(zs->GetZoneID()); if (holdzones){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Hold Zones mode is ON - rebooting lost zone"); + Log.Out(Logs::Detail, Logs::World_Server,"Hold Zones mode is ON - rebooting lost zone"); if(!zs->IsStaticZone()) RebootZone(inet_ntoa(in),zs->GetCPort(),zs->GetCAddress(),zs->GetID()); else @@ -576,7 +576,7 @@ void ZSList::RebootZone(const char* ip1,uint16 port,const char* ip2, uint32 skip s->port = port; s->zoneid = zoneid; if(zoneid != 0) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Rebooting static zone with the ID of: %i",zoneid); + Log.Out(Logs::Detail, Logs::World_Server,"Rebooting static zone with the ID of: %i",zoneid); tmp[z]->SendPacket(pack); delete pack; safe_delete_array(tmp); diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index bf46627d4..94b1e8853 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -77,7 +77,7 @@ bool ZoneServer::SetZone(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { char* longname; if (iZoneID) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, + Log.Out(Logs::Detail, Logs::World_Server,"Setting to '%s' (%d:%d)%s",(zn) ? zn : "",iZoneID, iInstanceID, iStaticZone ? " (Static)" : ""); zoneID = iZoneID; @@ -188,7 +188,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.Out(Logs::Detail, Logs::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -199,7 +199,7 @@ bool ZoneServer::Process() { else { struct in_addr in; in.s_addr = GetIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone authorization failed."); + Log.Out(Logs::Detail, Logs::World_Server,"Zone authorization failed."); auto pack = new ServerPacket(ServerOP_ZAAuthFailed); SendPacket(pack); delete pack; @@ -209,7 +209,7 @@ bool ZoneServer::Process() { } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); + Log.Out(Logs::Detail, Logs::World_Server,"**WARNING** You have not configured a world shared key in your config file. You should add a STRING element to your element to prevent unauthroized zone access."); authenticated = true; } } @@ -541,10 +541,10 @@ bool ZoneServer::Process() { RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer; if (zoneserver_list.SendPacket(pack)){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); + Log.Out(Logs::Detail, Logs::World_Server,"Sent Rez packet for %s",sRezz->rez.your_name); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); + Log.Out(Logs::Detail, Logs::World_Server,"Could not send Rez packet for %s",sRezz->rez.your_name); } break; } @@ -589,10 +589,10 @@ bool ZoneServer::Process() { ServerConnectInfo* sci = (ServerConnectInfo*) p.pBuffer; sci->port = clientport; SendPacket(&p); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); + Log.Out(Logs::Detail, Logs::World_Server,"Auto zone port configuration. Telling zone to use port %d",clientport); } else { clientport=sci->port; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); + Log.Out(Logs::Detail, Logs::World_Server,"Zone specified port %d, must be a previously allocated zone reconnecting.",clientport); } } @@ -602,7 +602,7 @@ bool ZoneServer::Process() { const LaunchName_Struct* ln = (const LaunchName_Struct*)pack->pBuffer; launcher_name = ln->launcher_name; launched_name = ln->zone_name; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); + Log.Out(Logs::Detail, Logs::World_Server, "Zone started with name %s by launcher %s", launched_name.c_str(), launcher_name.c_str()); break; } case ServerOP_ShutdownAll: { @@ -685,12 +685,12 @@ bool ZoneServer::Process() { if(WorldConfig::get()->UpdateStats) client = client_list.FindCharacter(ztz->name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", + Log.Out(Logs::Detail, Logs::World_Server,"ZoneToZone request for %s current zone %d req zone %d\n", ztz->name, ztz->current_zone_id, ztz->requested_zone_id); /* This is a request from the egress zone */ if(GetZoneID() == ztz->current_zone_id && GetInstanceID() == ztz->current_instance_id) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); + Log.Out(Logs::Detail, Logs::World_Server,"Processing ZTZ for egress from zone for client %s\n", ztz->name); if (ztz->admin < 80 && ztz->ignorerestrictions < 2 && zoneserver_list.IsZoneLocked(ztz->requested_zone_id)) { ztz->response = 0; @@ -708,20 +708,20 @@ bool ZoneServer::Process() { /* Zone was already running*/ if(ingress_server) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Found a zone already booted for %s\n", ztz->name); + Log.Out(Logs::Detail, Logs::World_Server,"Found a zone already booted for %s\n", ztz->name); ztz->response = 1; } /* Boot the Zone*/ else { int server_id; if ((server_id = zoneserver_list.TriggerBootup(ztz->requested_zone_id, ztz->requested_instance_id))){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Successfully booted a zone for %s\n", ztz->name); + Log.Out(Logs::Detail, Logs::World_Server,"Successfully booted a zone for %s\n", ztz->name); // bootup successful, ready to rock ztz->response = 1; ingress_server = zoneserver_list.FindByID(server_id); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"FAILED to boot a zone for %s\n", ztz->name); + Log.Out(Logs::Detail, Logs::World_Server,"FAILED to boot a zone for %s\n", ztz->name); // bootup failed, send back error code 0 ztz->response = 0; } @@ -736,7 +736,7 @@ bool ZoneServer::Process() { /* Response from Ingress server, route back to egress */ else{ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); + Log.Out(Logs::Detail, Logs::World_Server,"Processing ZTZ for ingress to zone for client %s\n", ztz->name); ZoneServer *egress_server = nullptr; if(ztz->current_instance_id > 0) { egress_server = zoneserver_list.FindByInstanceID(ztz->current_instance_id); @@ -754,7 +754,7 @@ bool ZoneServer::Process() { } case ServerOP_ClientList: { if (pack->size != sizeof(ServerClientList_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_ClientList. Got: %d, Expected: %d",pack->size,sizeof(ServerClientList_Struct)); break; } client_list.ClientUpdate(this, (ServerClientList_Struct*) pack->pBuffer); @@ -763,7 +763,7 @@ bool ZoneServer::Process() { case ServerOP_ClientListKA: { ServerClientListKeepAlive_Struct* sclka = (ServerClientListKeepAlive_Struct*) pack->pBuffer; if (pack->size < 4 || pack->size != 4 + (4 * sclka->numupdates)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_ClientListKA. Got: %d, Expected: %d",pack->size, (4 + (4 * sclka->numupdates))); break; } client_list.CLEKeepAlive(sclka->numupdates, sclka->wid); @@ -868,7 +868,7 @@ bool ZoneServer::Process() { } case ServerOP_GMGoto: { if (pack->size != sizeof(ServerGMGoto_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_GMGoto. Got: %d, Expected: %d",pack->size,sizeof(ServerGMGoto_Struct)); break; } ServerGMGoto_Struct* gmg = (ServerGMGoto_Struct*) pack->pBuffer; @@ -888,7 +888,7 @@ bool ZoneServer::Process() { } case ServerOP_Lock: { if (pack->size != sizeof(ServerLock_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Lock. Got: %d, Expected: %d",pack->size,sizeof(ServerLock_Struct)); break; } ServerLock_Struct* slock = (ServerLock_Struct*) pack->pBuffer; @@ -913,7 +913,7 @@ bool ZoneServer::Process() { } case ServerOP_Motd: { if (pack->size != sizeof(ServerMotd_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Motd. Got: %d, Expected: %d",pack->size,sizeof(ServerMotd_Struct)); break; } ServerMotd_Struct* smotd = (ServerMotd_Struct*) pack->pBuffer; @@ -924,7 +924,7 @@ bool ZoneServer::Process() { } case ServerOP_Uptime: { if (pack->size != sizeof(ServerUptime_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_Uptime. Got: %d, Expected: %d",pack->size,sizeof(ServerUptime_Struct)); break; } ServerUptime_Struct* sus = (ServerUptime_Struct*) pack->pBuffer; @@ -943,7 +943,7 @@ bool ZoneServer::Process() { break; } case ServerOP_GetWorldTime: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Broadcasting a world time update"); + Log.Out(Logs::Detail, Logs::World_Server,"Broadcasting a world time update"); auto pack = new ServerPacket; pack->opcode = ServerOP_SyncWorldTime; @@ -958,17 +958,17 @@ bool ZoneServer::Process() { break; } case ServerOP_SetWorldTime: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Received SetWorldTime"); + Log.Out(Logs::Detail, Logs::World_Server,"Received SetWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zoneserver_list.worldclock.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); + Log.Out(Logs::Detail, Logs::World_Server,"New time = %d-%d-%d %d:%d (%d)\n", newtime->start_eqtime.year, newtime->start_eqtime.month, (int)newtime->start_eqtime.day, (int)newtime->start_eqtime.hour, (int)newtime->start_eqtime.minute, (int)newtime->start_realtime); zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str()); zoneserver_list.SendTimeSync(); break; } case ServerOP_IPLookup: { if (pack->size < sizeof(ServerGenericWorldQuery_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_IPLookup. Got: %d, Expected (at least): %d",pack->size,sizeof(ServerGenericWorldQuery_Struct)); break; } ServerGenericWorldQuery_Struct* sgwq = (ServerGenericWorldQuery_Struct*) pack->pBuffer; @@ -980,7 +980,7 @@ bool ZoneServer::Process() { } case ServerOP_LockZone: { if (pack->size < sizeof(ServerLockZone_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); + Log.Out(Logs::Detail, Logs::World_Server,"Wrong size on ServerOP_LockZone. Got: %d, Expected: %d",pack->size,sizeof(ServerLockZone_Struct)); break; } ServerLockZone_Struct* s = (ServerLockZone_Struct*) pack->pBuffer; @@ -1025,10 +1025,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if (zs->SendPacket(pack)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.Out(Logs::Detail, Logs::World_Server,"Sent request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); + Log.Out(Logs::Detail, Logs::World_Server,"Could not send request to spawn player corpse id %i in zone %u.",s->player_corpse_id, s->zone_id); } } break; @@ -1047,10 +1047,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(cle->instance()); if(zs) { if(zs->SendPacket(pack)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); + Log.Out(Logs::Detail, Logs::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->instance()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent operation.", s->instance_id); } } else @@ -1067,10 +1067,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } } @@ -1079,10 +1079,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(cle->zone()); if(zs) { if(zs->SendPacket(pack)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); + Log.Out(Logs::Detail, Logs::World_Server, "Sent consent packet from player %s to player %s in zone %u.", s->ownername, s->grantname, cle->zone()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent operation.", s->zone_id); } } else { @@ -1098,10 +1098,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } } @@ -1119,10 +1119,10 @@ bool ZoneServer::Process() { zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1138,10 +1138,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByInstanceID(s->instance_id); if(zs) { if(!zs->SendPacket(pack)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in instance %u.", s->ownername, zs->GetInstanceID()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for instance id %u in zoneserver list for ServerOP_Consent_Response operation.", s->instance_id); } } else @@ -1149,10 +1149,10 @@ bool ZoneServer::Process() { ZoneServer* zs = zoneserver_list.FindByZoneID(s->zone_id); if(zs) { if(!zs->SendPacket(pack)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to send consent response back to player %s in zone %s.", s->ownername, zs->GetZoneName()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); + Log.Out(Logs::Detail, Logs::World_Server, "Unable to locate zone record for zone id %u in zoneserver list for ServerOP_Consent_Response operation.", s->zone_id); } } break; @@ -1254,7 +1254,7 @@ bool ZoneServer::Process() { case ServerOP_LSAccountUpdate: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); + Log.Out(Logs::Detail, Logs::World_Server, "Received ServerOP_LSAccountUpdate packet from zone"); loginserverlist.SendAccountUpdate(pack); break; } @@ -1309,7 +1309,7 @@ bool ZoneServer::Process() { } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); + Log.Out(Logs::Detail, Logs::World_Server,"Unknown ServerOPcode from zone 0x%04x, size %d",pack->opcode,pack->size); DumpPacket(pack->pBuffer, pack->size); break; } diff --git a/zone/aa.cpp b/zone/aa.cpp index 54d2831c3..5b3b82732 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -445,7 +445,7 @@ void Client::HandleAAAction(aaID activate) { break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown AA nonspell action type %d", caa->action); + Log.Out(Logs::General, Logs::Error, "Unknown AA nonspell action type %d", caa->action); return; } @@ -501,7 +501,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); + Log.Out(Logs::General, Logs::Error, "Unknown swarm pet spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -528,7 +528,7 @@ void Mob::TemporaryPets(uint16 spell_id, Mob *targ, const char *name_override, u const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { //log write - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); + Log.Out(Logs::General, Logs::Error, "Unknown npc type for swarm pet spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -625,7 +625,7 @@ void Mob::TypesTemporaryPets(uint32 typesid, Mob *targ, const char *name_overrid const NPCType *npc_type = database.GetNPCType(typesid); if(npc_type == nullptr) { //log write - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for swarm pet type id: %d", typesid); + Log.Out(Logs::General, Logs::Error, "Unknown npc type for swarm pet type id: %d", typesid); Message(0,"Unable to find pet!"); return; } @@ -951,7 +951,7 @@ void Client::SendAAStats() { void Client::BuyAA(AA_Action* action) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Starting to buy AA %d", action->ability); + Log.Out(Logs::Detail, Logs::AA, "Starting to buy AA %d", action->ability); //find the AA information from the database SendAA_Struct* aa2 = zone->FindAA(action->ability); @@ -963,7 +963,7 @@ void Client::BuyAA(AA_Action* action) a = action->ability - i; if(a <= 0) break; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); + Log.Out(Logs::Detail, Logs::AA, "Could not find AA %d, trying potential parent %d", action->ability, a); aa2 = zone->FindAA(a); if(aa2 != nullptr) break; @@ -980,7 +980,7 @@ void Client::BuyAA(AA_Action* action) uint32 cur_level = GetAA(aa2->id); if((aa2->id + cur_level) != action->ability) { //got invalid AA - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); + Log.Out(Logs::Detail, Logs::AA, "Unable to find or match AA %d (found %d + lvl %d)", action->ability, aa2->id, cur_level); return; } @@ -1011,7 +1011,7 @@ void Client::BuyAA(AA_Action* action) if (m_pp.aapoints >= real_cost && cur_level < aa2->max_level) { SetAA(aa2->id, cur_level + 1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); + Log.Out(Logs::Detail, Logs::AA, "Set AA %d to level %d", aa2->id, cur_level + 1); m_pp.aapoints -= real_cost; @@ -1429,10 +1429,10 @@ SendAA_Struct* Zone::FindAA(uint32 id) { } void Zone::LoadAAs() { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA information..."); + Log.Out(Logs::General, Logs::Status, "Loading AA information..."); totalAAs = database.CountAAs(); if(totalAAs == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AAs!"); + Log.Out(Logs::General, Logs::Error, "Failed to load AAs!"); aas = nullptr; return; } @@ -1447,11 +1447,11 @@ void Zone::LoadAAs() { } //load AA Effects into aa_effects - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading AA Effects..."); + Log.Out(Logs::General, Logs::Status, "Loading AA Effects..."); if (database.LoadAAEffects2()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loaded %d AA Effects.", aa_effects.size()); + Log.Out(Logs::General, Logs::Status, "Loaded %d AA Effects.", aa_effects.size()); else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load AA Effects!"); + Log.Out(Logs::General, Logs::Error, "Failed to load AA Effects!"); } bool ZoneDatabase::LoadAAEffects2() { @@ -1460,12 +1460,12 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (!results.RowCount()) { //no results - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading AA Effects, none found in the database."); + Log.Out(Logs::General, Logs::Error, "Error loading AA Effects, none found in the database."); return false; } @@ -1802,7 +1802,7 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1841,7 +1841,7 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1895,7 +1895,7 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1912,7 +1912,7 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1945,14 +1945,14 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1970,7 +1970,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -1990,7 +1990,7 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } diff --git a/zone/aggro.cpp b/zone/aggro.cpp index 678cbd3a8..d0b688e29 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -342,17 +342,17 @@ bool Mob::CheckWillAggro(Mob *mob) { { //FatherNiwtit: make sure we can see them. last since it is very expensive if(CheckLosFN(mob)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); + Log.Out(Logs::Detail, Logs::Aggro, "Check aggro for %s target %s.", GetName(), mob->GetName()); return( mod_will_aggro(mob, this) ); } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Is In zone?:%d\n", mob->InZone()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Dist^2: %f\n", dist2); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Range^2: %f\n", iAggroRange2); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Faction: %d\n", fv); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Int: %d\n", GetINT()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); + Log.Out(Logs::Detail, Logs::Aggro, "Is In zone?:%d\n", mob->InZone()); + Log.Out(Logs::Detail, Logs::Aggro, "Dist^2: %f\n", dist2); + Log.Out(Logs::Detail, Logs::Aggro, "Range^2: %f\n", iAggroRange2); + Log.Out(Logs::Detail, Logs::Aggro, "Faction: %d\n", fv); + Log.Out(Logs::Detail, Logs::Aggro, "Int: %d\n", GetINT()); + Log.Out(Logs::Detail, Logs::Aggro, "Con: %d\n", GetLevelCon(mob->GetLevel())); return(false); } @@ -466,7 +466,7 @@ void EntityList::AIYellForHelp(Mob* sender, Mob* attacker) { //Father Nitwit: make sure we can see them. if(mob->CheckLosFN(sender)) { #if (EQDEBUG>=5) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", + Log.Out(Logs::General, Logs::None, "AIYellForHelp(\"%s\",\"%s\") %s attacking %s Dist %f Z %f", sender->GetName(), attacker->GetName(), mob->GetName(), attacker->GetName(), mob->DistNoRoot(*sender), fabs(sender->GetZ()+mob->GetZ())); #endif mob->AddToHateList(attacker, 1, 0, false); @@ -693,7 +693,7 @@ type', in which case, the answer is yes. } while( reverse++ == 0 ); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); + Log.Out(Logs::General, Logs::None, "Mob::IsAttackAllowed: don't have a rule for this - %s vs %s\n", this->GetName(), target->GetName()); return false; } @@ -833,7 +833,7 @@ bool Mob::IsBeneficialAllowed(Mob *target) } while( reverse++ == 0 ); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); + Log.Out(Logs::General, Logs::None, "Mob::IsBeneficialAllowed: don't have a rule for this - %s to %s\n", this->GetName(), target->GetName()); return false; } @@ -945,7 +945,7 @@ bool Mob::CheckLosFN(float posX, float posY, float posZ, float mobSize) { oloc.z = posZ + (mobSize==0.0?LOS_DEFAULT_HEIGHT:mobSize)/2 * SEE_POSITION; #if LOSDEBUG>=5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); + Log.Out(Logs::General, Logs::None, "LOS from (%.2f, %.2f, %.2f) to (%.2f, %.2f, %.2f) sizes: (%.2f, %.2f)", myloc.x, myloc.y, myloc.z, oloc.x, oloc.y, oloc.z, GetSize(), mobSize); #endif return zone->zonemap->CheckLoS(myloc, oloc); } diff --git a/zone/attack.cpp b/zone/attack.cpp index 5610a5f8f..ce97ae524 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -57,7 +57,7 @@ bool Mob::AttackAnimation(SkillUseTypes &skillinuse, int Hand, const ItemInst* w if (weapon && weapon->IsType(ItemClassCommon)) { const Item_Struct* item = weapon->GetItem(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Weapon skill : %i", item->ItemType); + Log.Out(Logs::Detail, Logs::Attack, "Weapon skill : %i", item->ItemType); switch (item->ItemType) { @@ -187,7 +187,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c if(attacker->IsNPC() && !attacker->IsPet()) chancetohit += RuleR(Combat, NPCBonusHitChance); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); + Log.Out(Logs::Detail, Logs::Attack, "CheckHitChance(%s) attacked by %s", defender->GetName(), attacker->GetName()); bool pvpmode = false; if(IsClient() && other->IsClient()) @@ -208,7 +208,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate the level difference - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit before level diff calc %.2f", chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Chance to hit before level diff calc %.2f", chancetohit); double level_difference = attacker_level - defender_level; double range = defender->GetLevel(); @@ -236,32 +236,32 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c chancetohit += (RuleR(Combat,HitBonusPerLevel) * level_difference); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after level diff calc %.2f", chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after level diff calc %.2f", chancetohit); chancetohit -= ((float)defender->GetAGI() * RuleR(Combat, AgiHitFactor)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after Agility calc %.2f", chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after Agility calc %.2f", chancetohit); if(attacker->IsClient()) { chancetohit -= (RuleR(Combat,WeaponSkillFalloff) * (attacker->CastToClient()->MaxSkill(skillinuse) - attacker->GetSkill(skillinuse))); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after agil calc %.2f", "Chance to hit after weapon falloff calc (attack) %.2f", chancetohit); } if(defender->IsClient()) { chancetohit += (RuleR(Combat,WeaponSkillFalloff) * (defender->CastToClient()->MaxSkill(SkillDefense) - defender->GetSkill(SkillDefense))); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Chance to hit after weapon falloff calc (defense) %.2f", chancetohit); } //I dont think this is 100% correct, but at least it does something... if(attacker->spellbonuses.MeleeSkillCheckSkill == skillinuse || attacker->spellbonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->spellbonuses.MeleeSkillCheck; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Applied spell melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } if(attacker->itembonuses.MeleeSkillCheckSkill == skillinuse || attacker->itembonuses.MeleeSkillCheckSkill == 255) { chancetohit += attacker->itembonuses.MeleeSkillCheck; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "Applied item melee skill bonus %d, yeilding %.2f", attacker->spellbonuses.MeleeSkillCheck, chancetohit); } //Avoidance Bonuses on defender decreases baseline hit chance by percent. @@ -308,7 +308,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //Calculate final chance to hit chancetohit += ((chancetohit * (hitBonus - avoidanceBonus)) / 100.0f); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); + Log.Out(Logs::Detail, Logs::Attack, "Chance to hit %.2f after accuracy calc %.2f and avoidance calc %.2f", chancetohit, hitBonus, avoidanceBonus); chancetohit = mod_hit_chance(chancetohit, skillinuse, attacker); @@ -327,7 +327,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c //agains a garunteed riposte (for example) discipline... for now, garunteed hit wins - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); + Log.Out(Logs::Detail, Logs::Attack, "3 FINAL calculated chance to hit is: %5.2f", chancetohit); // @@ -336,7 +336,7 @@ bool Mob::CheckHitChance(Mob* other, SkillUseTypes skillinuse, int Hand, int16 c float tohit_roll = zone->random.Real(0, 100); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); + Log.Out(Logs::Detail, Logs::Attack, "Final hit chance: %.2f%%. Hit roll %.2f", chancetohit, tohit_roll); return(tohit_roll <= chancetohit); } @@ -370,7 +370,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && other->InFrontMob(this, other->GetX(), other->GetY())) { damage = -3; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.Out(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -517,7 +517,7 @@ bool Mob::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.Out(Logs::Detail, Logs::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -690,9 +690,9 @@ void Mob::MeleeMitigation(Mob *attacker, int32 &damage, int32 minhit, ExtraAttac damage -= (myac * zone->random.Int(0, acrandom) / 10000); } if (damage<1) damage=1; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); + Log.Out(Logs::Detail, Logs::Combat, "AC Damage Reduction: fail chance %d%%. Failed. Reduction %.3f%%, random %d. Resulting damage %d.", acfail, acreduction, acrandom, damage); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); + Log.Out(Logs::Detail, Logs::Combat, "AC Damage Reduction: fail chance %d%%. Did not fail.", acfail); } } @@ -1128,14 +1128,14 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Client::Attack() for evaluation!"); return false; } if(!GetTarget()) SetTarget(other); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); + Log.Out(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other?other->GetName():"(nullptr)", Hand, bRiposte?"(this is a riposte)":""); //SetAttackTimer(); if ( @@ -1145,12 +1145,12 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b || (GetHP() < 0) || (!IsAttackAllowed(other)) ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, invalid circumstances."); + Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, invalid circumstances."); return false; // Only bards can attack while casting } if(DivineAura() && !GetGM()) {//cant attack while invulnerable unless your a gm - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect."); Message_StringID(MT_DefaultText, DIVINE_AURA_NO_ATK); //You can't attack while invulnerable! return false; } @@ -1170,19 +1170,19 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.Out(Logs::Detail, Logs::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -1200,7 +1200,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(IsBerserk() && GetClass() == BERSERKER){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.Out(Logs::Detail, Logs::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -1268,7 +1268,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b damage = mod_client_damage(damage, skillinuse, Hand, weapon, other); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.Out(Logs::Detail, Logs::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, mylevel); int hit_chance_bonus = 0; @@ -1283,7 +1283,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(this, skillinuse, Hand, hit_chance_bonus)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.Out(Logs::Detail, Logs::Combat, "Attack missed. Damage set to 0."); damage = 0; } else { //we hit, try to avoid it other->AvoidDamage(this, damage); @@ -1291,7 +1291,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b if(damage > 0) CommonOutgoingHitSuccess(other, damage, skillinuse); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.Out(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -1430,7 +1430,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att } int exploss = 0; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); + Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob ? killerMob->GetName() : "Unknown", damage, spell, attack_skill); /* #1: Send death packet to everyone @@ -1692,7 +1692,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (!other) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to NPC::Attack() for evaluation!"); return false; } @@ -1710,7 +1710,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if (other->IsClient()) other->CastToClient()->RemoveXTarget(this, false); RemoveFromHateList(other); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetName()); } return false; } @@ -1737,10 +1737,10 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //We dont factor much from the weapon into the attack. //Just the skill type so it doesn't look silly using punching animations and stuff while wielding weapons if(weapon) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); + Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d) (too bad im not using it for much)", weapon->Name, weapon->ID); if(Hand == MainSecondary && weapon->ItemType == ItemTypeShield){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack with shield canceled."); + Log.Out(Logs::Detail, Logs::Combat, "Attack with shield canceled."); return false; } @@ -1829,11 +1829,11 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //check if we're hitting above our max or below it. if((min_dmg+eleBane) != 0 && damage < (min_dmg+eleBane)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); + Log.Out(Logs::Detail, Logs::Combat, "Damage (%d) is below min (%d). Setting to min.", damage, (min_dmg+eleBane)); damage = (min_dmg+eleBane); } if((max_dmg+eleBane) != 0 && damage > (max_dmg+eleBane)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); + Log.Out(Logs::Detail, Logs::Combat, "Damage (%d) is above max (%d). Setting to max.", damage, (max_dmg+eleBane)); damage = (max_dmg+eleBane); } @@ -1846,7 +1846,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } if(other->IsClient() && other->CastToClient()->IsSitting()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); + Log.Out(Logs::Detail, Logs::Combat, "Client %s is sitting. Hitting for max damage (%d).", other->GetName(), (max_dmg+eleBane)); damage = (max_dmg+eleBane); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); @@ -1857,7 +1857,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool hate += opts->hate_flat; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list other->AddToHateList(this, hate); @@ -1881,7 +1881,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool if(damage > 0) { CommonOutgoingHitSuccess(other, damage, skillinuse); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Generating hate %d towards %s", hate, GetName()); // now add done damage to the hate list if(damage > 0) other->AddToHateList(this, hate); @@ -1890,7 +1890,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage against %s: %d", other->GetName(), damage); + Log.Out(Logs::Detail, Logs::Combat, "Final damage against %s: %d", other->GetName(), damage); if(other->IsClient() && IsPet() && GetOwner()->IsClient()) { //pets do half damage to clients in pvp @@ -1902,7 +1902,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //cant riposte a riposte if (bRiposte && damage == -3) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Riposte of riposte canceled."); + Log.Out(Logs::Detail, Logs::Combat, "Riposte of riposte canceled."); return false; } @@ -1954,7 +1954,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", other->GetName()); parse->EventNPC(EVENT_ATTACK, this, other, "", 0); } attacked_timer.Start(CombatEventTimer_expire); @@ -1991,7 +1991,7 @@ void NPC::Damage(Mob* other, int32 damage, uint16 spell_id, SkillUseTypes attack } bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack_skill) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); + Log.Out(Logs::Detail, Logs::Combat, "Fatal blow dealt by %s with %d damage, spell %d, skill %d", killerMob->GetName(), damage, spell, attack_skill); Mob *oos = nullptr; if(killerMob) { @@ -2028,7 +2028,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if (IsEngaged()) { zone->DelAggroMob(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); + Log.Out(Logs::Detail, Logs::Attack, "%s Mobs currently Aggro %i", __FUNCTION__, zone->MobsAggroCount()); } SetHP(0); SetPet(0); @@ -2580,7 +2580,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { if(DS == 0 && rev_ds == 0) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Applying Damage Shield of value %d to %s", DS, attacker->GetName()); //invert DS... spells yield negative values for a true damage shield if(DS < 0) { @@ -2625,7 +2625,7 @@ void Mob::DamageShield(Mob* attacker, bool spell_ds) { rev_ds_spell_id = spellbonuses.ReverseDamageShieldSpellID; if(rev_ds < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Applying Reverse Damage Shield of value %d to %s", rev_ds, attacker->GetName()); attacker->Damage(this, -rev_ds, rev_ds_spell_id, SkillAbjuration/*hackish*/, false); //"this" (us) will get the hate, etc. not sure how this works on Live, but it'll works for now, and tanks will love us for this //do we need to send a damage packet here also? } @@ -3137,7 +3137,7 @@ int32 Mob::ReduceDamage(int32 damage) int damage_to_reduce = damage * spellbonuses.MeleeThresholdGuard[0] / 100; if(damage_to_reduce >= buffs[slot].melee_rune) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3145,7 +3145,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" + Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MeleeThresholdGuard %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); buffs[slot].melee_rune = (buffs[slot].melee_rune - damage_to_reduce); damage -= damage_to_reduce; @@ -3164,7 +3164,7 @@ int32 Mob::ReduceDamage(int32 damage) if(spellbonuses.MitigateMeleeRune[3] && (damage_to_reduce >= buffs[slot].melee_rune)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].melee_rune); damage -= buffs[slot].melee_rune; if(!TryFadeEffect(slot)) @@ -3172,7 +3172,7 @@ int32 Mob::ReduceDamage(int32 damage) } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].melee_rune); if (spellbonuses.MitigateMeleeRune[3]) @@ -3290,7 +3290,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi if(spellbonuses.MitigateSpellRune[3] && (damage_to_reduce >= buffs[slot].magic_rune)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" + Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateSpellDamage %d damage negated, %d" " damage remaining, fading buff.", damage_to_reduce, buffs[slot].magic_rune); damage -= buffs[slot].magic_rune; if(!TryFadeEffect(slot)) @@ -3298,7 +3298,7 @@ int32 Mob::AffectMagicalDamage(int32 damage, uint16 spell_id, const bool iBuffTi } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" + Log.Out(Logs::Detail, Logs::Spells, "Mob::ReduceDamage SE_MitigateMeleeDamage %d damage negated, %d" " damage remaining.", damage_to_reduce, buffs[slot].magic_rune); if (spellbonuses.MitigateSpellRune[3]) @@ -3437,11 +3437,11 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons // This method is called with skill_used=ABJURE for Damage Shield damage. bool FromDamageShield = (skill_used == SkillAbjuration); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", + Log.Out(Logs::Detail, Logs::Combat, "Applying damage %d done by %s with skill %d and spell %d, avoidable? %s, is %sa buff tic in slot %d", damage, attacker?attacker->GetName():"NOBODY", skill_used, spell_id, avoidable?"yes":"no", iBuffTic?"":"not ", buffslot); if (GetInvul() || DivineAura()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Avoiding %d damage due to invulnerability.", damage); + Log.Out(Logs::Detail, Logs::Combat, "Avoiding %d damage due to invulnerability.", damage); damage = -5; } @@ -3493,7 +3493,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int healed = damage; healed = attacker->GetActSpellHealing(spell_id, healed); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, attacker->GetName()); attacker->HealDamage(healed); //we used to do a message to the client, but its gone now. @@ -3506,7 +3506,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (pet && !pet->IsFamiliar() && !pet->GetSpecialAbility(IMMUNE_AGGRO) && !pet->IsEngaged() && attacker && attacker != this && !attacker->IsCorpse()) { if (!pet->IsHeld()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); + Log.Out(Logs::Detail, Logs::Aggro, "Sending pet %s into battle due to attack.", pet->GetName()); pet->AddToHateList(attacker, 1); pet->SetTarget(attacker); Message_StringID(10, PET_ATTACKING, pet->GetCleanName(), attacker->GetCleanName()); @@ -3516,7 +3516,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //see if any runes want to reduce this damage if(spell_id == SPELL_UNKNOWN) { damage = ReduceDamage(damage); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee Damage reduced to %d", damage); + Log.Out(Logs::Detail, Logs::Combat, "Melee Damage reduced to %d", damage); damage = ReduceAllDamage(damage); TryTriggerThreshHold(damage, SE_TriggerMeleeThreshold, attacker); } else { @@ -3573,7 +3573,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //fade mez if we are mezzed if (IsMezzed() && attacker) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Breaking mez due to attack."); + Log.Out(Logs::Detail, Logs::Combat, "Breaking mez due to attack."); entity_list.MessageClose_StringID(this, true, 100, MT_WornOff, HAS_BEEN_AWAKENED, GetCleanName(), attacker->GetCleanName()); BuffFadeByEffect(SE_Mez); @@ -3616,7 +3616,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons int stun_resist = itembonuses.StunResist + spellbonuses.StunResist; int frontal_stun_resist = itembonuses.FrontalStunResist + spellbonuses.FrontalStunResist; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); + Log.Out(Logs::Detail, Logs::Combat, "Stun passed, checking resists. Was %d chance.", stun_chance); if (IsClient()) { stun_resist += aabonuses.StunResist; frontal_stun_resist += aabonuses.FrontalStunResist; @@ -3626,20 +3626,20 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons if (((GetBaseRace() == OGRE && IsClient()) || (frontal_stun_resist && zone->random.Roll(frontal_stun_resist))) && !attacker->BehindMob(this, attacker->GetX(), attacker->GetY())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); + Log.Out(Logs::Detail, Logs::Combat, "Frontal stun resisted. %d chance.", frontal_stun_resist); } else { // Normal stun resist check. if (stun_resist && zone->random.Roll(stun_resist)) { if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. %d chance.", stun_resist); + Log.Out(Logs::Detail, Logs::Combat, "Stun Resisted. %d chance.", stun_resist); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. %d resist chance.", stun_resist); + Log.Out(Logs::Detail, Logs::Combat, "Stunned. %d resist chance.", stun_resist); Stun(zone->random.Int(0, 2) * 1000); // 0-2 seconds } } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun failed. %d chance.", stun_chance); + Log.Out(Logs::Detail, Logs::Combat, "Stun failed. %d chance.", stun_chance); } } @@ -3653,7 +3653,7 @@ void Mob::CommonDamage(Mob* attacker, int32 &damage, const uint16 spell_id, cons //increment chances of interrupting if(IsCasting()) { //shouldnt interrupt on regular spell damage attacked_count++; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee attack while casting. Attack count %d", attacked_count); + Log.Out(Logs::Detail, Logs::Combat, "Melee attack while casting. Attack count %d", attacked_count); } } @@ -3859,7 +3859,7 @@ float Mob::GetProcChances(float ProcBonus, uint16 hand) ProcChance += ProcChance * ProcBonus / 100.0f; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.Out(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3878,7 +3878,7 @@ float Mob::GetDefensiveProcChances(float &ProcBonus, float &ProcChance, uint16 h ProcBonus += static_cast(myagi) * RuleR(Combat, DefProcPerMinAgiContrib) / 100.0f; ProcChance = ProcChance + (ProcChance * ProcBonus); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.Out(Logs::Detail, Logs::Combat, "Defensive Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -3887,7 +3887,7 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { if (!on) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TryDefensiveProc for evaluation!"); return; } @@ -3918,17 +3918,17 @@ void Mob::TryDefensiveProc(const ItemInst* weapon, Mob *on, uint16 hand) { void Mob::TryWeaponProc(const ItemInst* weapon_g, Mob *on, uint16 hand) { if(!on) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TryWeaponProc for evaluation!"); return; } if (!IsAttackAllowed(on)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preventing procing off of unattackable things."); + Log.Out(Logs::Detail, Logs::Combat, "Preventing procing off of unattackable things."); return; } if (DivineAura()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Procs canceled, Divine Aura is in effect."); + Log.Out(Logs::Detail, Logs::Combat, "Procs canceled, Divine Aura is in effect."); return; } @@ -3975,7 +3975,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on static_cast(weapon->ProcRate)) / 100.0f; if (zone->random.Roll(WPC)) { // 255 dex = 0.084 chance of proc. No idea what this number should be really. if (weapon->Proc.Level > ourlevel) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Tried to proc (%s), but our level (%d) is lower than required (%d)", weapon->Name, ourlevel, weapon->Proc.Level); if (IsPet()) { @@ -3986,7 +3986,7 @@ void Mob::TryWeaponProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on Message_StringID(13, PROC_TOOLOW); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Attacking weapon (%s) successfully procing spell %d (%.2f percent chance)", weapon->Name, weapon->Proc.Effect, WPC * 100); ExecWeaponProc(inst, weapon->Proc.Effect, on); @@ -4065,12 +4065,12 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, // Perma procs (AAs) if (PermaProcs[i].spellID != SPELL_UNKNOWN) { if (zone->random.Roll(PermaProcs[i].chance)) { // TODO: Do these get spell bonus? - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Permanent proc %d procing spell %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); ExecWeaponProc(nullptr, PermaProcs[i].spellID, on); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Permanent proc %d failed to proc %d (%d percent chance)", i, PermaProcs[i].spellID, PermaProcs[i].chance); } @@ -4080,13 +4080,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (SpellProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(SpellProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Spell proc %d procing spell %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); ExecWeaponProc(nullptr, SpellProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, SpellProcs[i].base_spellID); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Spell proc %d failed to proc %d (%.2f percent chance)", i, SpellProcs[i].spellID, chance); } @@ -4096,13 +4096,13 @@ void Mob::TrySpellProc(const ItemInst *inst, const Item_Struct *weapon, Mob *on, if (RangedProcs[i].spellID != SPELL_UNKNOWN) { float chance = ProcChance * (static_cast(RangedProcs[i].chance) / 100.0f); if (zone->random.Roll(chance)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Ranged proc %d procing spell %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); ExecWeaponProc(nullptr, RangedProcs[i].spellID, on); CheckNumHitsRemaining(NUMHIT_OffensiveSpellProcs, 0, RangedProcs[i].base_spellID); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, + Log.Out(Logs::Detail, Logs::Combat, "Ranged proc %d failed to proc %d (%.2f percent chance)", i, RangedProcs[i].spellID, chance); } @@ -4352,7 +4352,7 @@ bool Mob::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Mob::DoRiposte(Mob* defender) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.Out(Logs::Detail, Logs::Combat, "Preforming a riposte"); if (!defender) return; @@ -4370,7 +4370,7 @@ void Mob::DoRiposte(Mob* defender) { //Live AA - Double Riposte if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); + Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposed (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); if (HasDied()) return; } @@ -4381,7 +4381,7 @@ void Mob::DoRiposte(Mob* defender) { DoubleRipChance = defender->aabonuses.GiveDoubleRiposte[1]; if(DoubleRipChance && zone->random.Roll(DoubleRipChance)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); + Log.Out(Logs::Detail, Logs::Combat, "Preforming a return SPECIAL ATTACK (%d percent chance)", DoubleRipChance); if (defender->GetClass() == MONK) defender->MonkSpecialAttack(this, defender->aabonuses.GiveDoubleRiposte[2]); @@ -4398,7 +4398,7 @@ void Mob::ApplyMeleeDamageBonus(uint16 skill, int32 &damage){ int dmgbonusmod = 0; dmgbonusmod += (100*(itembonuses.STR + spellbonuses.STR))/3; dmgbonusmod += (100*(spellbonuses.ATK + itembonuses.ATK))/5; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); + Log.Out(Logs::Detail, Logs::Combat, "Damage bonus: %d percent from ATK and STR bonuses.", (dmgbonusmod/100)); damage += (damage*dmgbonusmod/10000); } } @@ -4467,7 +4467,7 @@ void Mob::TrySkillProc(Mob *on, uint16 skill, uint16 ReuseTime, bool Success, ui if (!on) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Mob::TrySkillProc for evaluation!"); return; } @@ -4692,13 +4692,13 @@ bool Mob::TryRootFadeByDamage(int buffslot, Mob* attacker) { if (!TryFadeEffect(spellbonuses.Root[1])) { BuffFadeBySlot(spellbonuses.Root[1]); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell broke root! BreakChance percent chance"); + Log.Out(Logs::Detail, Logs::Combat, "Spell broke root! BreakChance percent chance"); return true; } } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Spell did not break root. BreakChance percent chance"); + Log.Out(Logs::Detail, Logs::Combat, "Spell did not break root. BreakChance percent chance"); return false; } @@ -4770,19 +4770,19 @@ void Mob::CommonBreakInvisible() { //break invis when you attack if(invisible) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index a9d077bcf..fcb7f0ef9 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -77,9 +77,9 @@ void Client::CalcBonuses() CalcSpellBonuses(&spellbonuses); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); + Log.Out(Logs::Detail, Logs::AA, "Calculating AA Bonuses for %s.", this->GetCleanName()); CalcAABonuses(&aabonuses); //we're not quite ready for this - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); + Log.Out(Logs::Detail, Logs::AA, "Finished calculating AA Bonuses for %s.", this->GetCleanName()); RecalcWeight(); @@ -634,7 +634,7 @@ void Client::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.Out(Logs::Detail, Logs::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) diff --git a/zone/bot.cpp b/zone/bot.cpp index 7d77d8bc3..1a6264306 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -1225,7 +1225,7 @@ int32 Bot::acmod() return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); + Log.Out(Logs::General, Logs::Error, "Error in Bot::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; } @@ -1462,7 +1462,7 @@ void Bot::LoadAAs() { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadAAs()"); + Log.Out(Logs::General, Logs::Error, "Error in Bot::LoadAAs()"); return; } @@ -1564,7 +1564,7 @@ void Bot::ApplyAABonuses(uint32 aaid, uint32 slots, StatBonuses* newbon) if (effect == SE_Blank || (effect == SE_CHA && base1 == 0) || effect == SE_StackingCommand_Block || effect == SE_StackingCommand_Overwrite) continue; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); + Log.Out(Logs::Detail, Logs::AA, "Applying Effect %d from AA %u in slot %d (base1: %d, base2: %d) on %s", effect, aaid, slot, base1, base2, this->GetCleanName()); uint8 focus = IsFocusEffect(0, 0, true,effect); if (focus) @@ -2774,7 +2774,7 @@ void Bot::LoadStance() { std::string query = StringFormat("SELECT StanceID FROM botstances WHERE BotID = %u;", GetBotID()); auto results = database.QueryDatabase(query); if(!results.Success() || results.RowCount() == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadStance()"); + Log.Out(Logs::General, Logs::Error, "Error in Bot::LoadStance()"); SetDefaultBotStance(); return; } @@ -2792,7 +2792,7 @@ void Bot::SaveStance() { "VALUES(%u, %u);", GetBotID(), GetBotStance()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveStance()"); + Log.Out(Logs::General, Logs::Error, "Error in Bot::SaveStance()"); } @@ -2807,7 +2807,7 @@ void Bot::LoadTimers() { GetBotID(), DisciplineReuseStart-1, DisciplineReuseStart-1, GetClass(), GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::LoadTimers()"); + Log.Out(Logs::General, Logs::Error, "Error in Bot::LoadTimers()"); return; } @@ -2847,7 +2847,7 @@ void Bot::SaveTimers() { } if(hadError) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Bot::SaveTimers()"); + Log.Out(Logs::General, Logs::Error, "Error in Bot::SaveTimers()"); } @@ -2979,7 +2979,7 @@ void Bot::BotRangedAttack(Mob* other) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(Logs::Detail, Logs::Combat, "Bot Archery attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -2997,7 +2997,7 @@ void Bot::BotRangedAttack(Mob* other) { if(!RangeWeapon || !Ammo) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); + Log.Out(Logs::Detail, Logs::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetCleanName(), RangeWeapon->Name, RangeWeapon->ID, Ammo->Name, Ammo->ID); if(!IsAttackAllowed(other) || IsCasting() || @@ -3015,19 +3015,19 @@ void Bot::BotRangedAttack(Mob* other) { //break invis when you attack if(invisible) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -3362,7 +3362,7 @@ void Bot::AI_Process() { else if(!IsRooted()) { if(GetTarget() && GetTarget()->GetHateTop() && GetTarget()->GetHateTop() != this) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Returning to location prior to being summoned."); + Log.Out(Logs::Detail, Logs::AI, "Returning to location prior to being summoned."); CalculateNewPosition2(GetPreSummonX(), GetPreSummonY(), GetPreSummonZ(), GetRunspeed()); SetHeading(CalculateHeadingToTarget(GetPreSummonX(), GetPreSummonY())); return; @@ -3689,7 +3689,7 @@ void Bot::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -3972,7 +3972,7 @@ void Bot::PetAIProcess() { { botPet->SetRunAnimSpeed(0); if(!botPet->IsRooted()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); + Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", botPet->GetTarget()->GetCleanName()); botPet->CalculateNewPosition2(botPet->GetTarget()->GetX(), botPet->GetTarget()->GetY(), botPet->GetTarget()->GetZ(), botPet->GetOwner()->GetRunspeed()); return; } @@ -4211,7 +4211,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { ItemInst* inst = database.CreateItem(item_id, charges, aug[0], aug[1], aug[2], aug[3], aug[4]); if (!inst) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); + Log.Out(Logs::General, Logs::Error, "Warning: botid %i has an invalid item_id %i in inventory slot %i", this->GetBotID(), item_id, slot_id); continue; } @@ -4235,7 +4235,7 @@ void Bot::GetBotItems(std::string* errorMessage, Inventory &inv) { // Save ptr to item in inventory if (put_slot_id == INVALID_INDEX) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); + Log.Out(Logs::General, Logs::Error, "Warning: Invalid slot_id for item in inventory: botid=%i, item_id=%i, slot_id=%i",this->GetBotID(), item_id, slot_id); } @@ -5959,7 +5959,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ //handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds if(attacked_timer.Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Triggering EVENT_ATTACK due to attack by %s", from->GetName()); parse->EventNPC(EVENT_ATTACK, this, from, "", 0); } @@ -5972,7 +5972,7 @@ void Bot::Damage(Mob *from, int32 damage, uint16 spell_id, SkillUseTypes attack_ // if spell is lifetap add hp to the caster if (spell_id != SPELL_UNKNOWN && IsLifetapSpell(spell_id)) { int healed = GetActSpellHealing(spell_id, damage); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); + Log.Out(Logs::Detail, Logs::Combat, "Applying lifetap heal of %d to %s", healed, GetCleanName()); HealDamage(healed); entity_list.MessageClose(this, true, 300, MT_Spells, "%s beams a smile at %s", GetCleanName(), from->GetCleanName() ); } @@ -6017,14 +6017,14 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b { if (!other) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Bot::Attack for evaluation!"); return false; } if(!GetTarget() || GetTarget() != other) SetTarget(other); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); + Log.Out(Logs::Detail, Logs::Combat, "Attacking %s with hand %d %s", other?other->GetCleanName():"(nullptr)", Hand, FromRiposte?"(this is a riposte)":""); if ((IsCasting() && (GetClass() != BARD) && !IsFromSpell) || other == nullptr || @@ -6036,13 +6036,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b entity_list.MessageClose(this, 1, 200, 10, "%s says, '%s is not a legal target master.'", this->GetCleanName(), this->GetTarget()->GetCleanName()); if(other) { RemoveFromHateList(other); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am not allowed to attack %s", other->GetCleanName()); + Log.Out(Logs::Detail, Logs::Combat, "I am not allowed to attack %s", other->GetCleanName()); } return false; } if(DivineAura()) {//cant attack while invulnerable - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Divine Aura is in effect."); + Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Divine Aura is in effect."); return false; } @@ -6068,19 +6068,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(weapon != nullptr) { if (!weapon->IsWeapon()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(Logs::Detail, Logs::Combat, "Attack canceled, Item %s (%d) is not a weapon.", weapon->GetItem()->Name, weapon->GetID()); return(false); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); + Log.Out(Logs::Detail, Logs::Combat, "Attacking with weapon: %s (%d)", weapon->GetItem()->Name, weapon->GetID()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking without a weapon."); + Log.Out(Logs::Detail, Logs::Combat, "Attacking without a weapon."); } // calculate attack_skill and skillinuse depending on hand and weapon // also send Packet to near clients SkillUseTypes skillinuse; AttackAnimation(skillinuse, Hand, weapon); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); + Log.Out(Logs::Detail, Logs::Combat, "Attacking with %s in slot %d using skill %d", weapon?weapon->GetItem()->Name:"Fist", Hand, skillinuse); /// Now figure out damage int damage = 0; @@ -6098,7 +6098,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b if(berserk && (GetClass() == BERSERKER)){ int bonus = 3 + GetLevel()/10; //unverified weapon_damage = weapon_damage * (100+bonus) / 100; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); + Log.Out(Logs::Detail, Logs::Combat, "Berserker damage bonus increases DMG to %d", weapon_damage); } //try a finishing blow.. if successful end the attack @@ -6163,7 +6163,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b else damage = zone->random.Int(min_hit, max_hit); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", + Log.Out(Logs::Detail, Logs::Combat, "Damage calculated to %d (min %d, max %d, str %d, skill %d, DMG %d, lv %d)", damage, min_hit, max_hit, GetSTR(), GetSkill(skillinuse), weapon_damage, GetLevel()); if(opts) { @@ -6175,7 +6175,7 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //check to see if we hit.. if(!other->CheckHitChance(other, skillinuse, Hand)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Attack missed. Damage set to 0."); + Log.Out(Logs::Detail, Logs::Combat, "Attack missed. Damage set to 0."); damage = 0; other->AddToHateList(this, 0); } else { //we hit, try to avoid it @@ -6185,13 +6185,13 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b ApplyMeleeDamageBonus(skillinuse, damage); damage += (itembonuses.HeroicSTR / 10) + (damage * other->GetSkillDmgTaken(skillinuse) / 100) + GetSkillDmgAmt(skillinuse); TryCriticalHit(other, skillinuse, damage, opts); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Generating hate %d towards %s", hate, GetCleanName()); + Log.Out(Logs::Detail, Logs::Combat, "Generating hate %d towards %s", hate, GetCleanName()); // now add done damage to the hate list //other->AddToHateList(this, hate); } else other->AddToHateList(this, 0); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all reductions: %d", damage); + Log.Out(Logs::Detail, Logs::Combat, "Final damage after all reductions: %d", damage); } //riposte @@ -6253,19 +6253,19 @@ bool Bot::Attack(Mob* other, int Hand, bool FromRiposte, bool IsStrikethrough, b //break invis when you attack if(invisible) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility due to melee attack."); BuffFadeByEffect(SE_Invisibility); BuffFadeByEffect(SE_Invisibility2); invisible = false; } if(invisible_undead) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. undead due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. undead due to melee attack."); BuffFadeByEffect(SE_InvisVsUndead); BuffFadeByEffect(SE_InvisVsUndead2); invisible_undead = false; } if(invisible_animals){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Removing invisibility vs. animals due to melee attack."); + Log.Out(Logs::Detail, Logs::Combat, "Removing invisibility vs. animals due to melee attack."); BuffFadeByEffect(SE_InvisVsAnimals); invisible_animals = false; } @@ -7028,7 +7028,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel return 0; break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.Out(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -7335,7 +7335,7 @@ int32 Bot::CalcBotFocusEffect(BotfocusType bottype, uint16 focus_id, uint16 spel //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.Out(Logs::General, Logs::Spells, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); } } //Check for spell skill limits. @@ -7378,7 +7378,7 @@ float Bot::GetProcChances(float ProcBonus, uint16 hand) { ProcChance += ProcChance*ProcBonus / 100.0f; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); + Log.Out(Logs::Detail, Logs::Combat, "Proc chance %.2f (%.2f from bonuses)", ProcChance, ProcBonus); return ProcChance; } @@ -7414,7 +7414,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) ///////////////////////////////////////////////////////// if (IsEnraged() && !other->BehindMob(this, other->GetX(), other->GetY())) { damage = -3; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "I am enraged, riposting frontal attack."); + Log.Out(Logs::Detail, Logs::Combat, "I am enraged, riposting frontal attack."); } ///////////////////////////////////////////////////////// @@ -7556,7 +7556,7 @@ bool Bot::AvoidDamage(Mob* other, int32 &damage, bool CanRiposte) } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Final damage after all avoidances: %d", damage); + Log.Out(Logs::Detail, Logs::Combat, "Final damage after all avoidances: %d", damage); if (damage < 0) return true; @@ -7609,14 +7609,14 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) uint16 levelreq = aabonuses.FinishingBlowLvl[0]; if(defender->GetLevel() <= levelreq && (chance >= zone->random.Int(0, 1000))){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.Out(Logs::Detail, Logs::Combat, "Landed a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); defender->Damage(this, damage, SPELL_UNKNOWN, skillinuse); return true; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); + Log.Out(Logs::Detail, Logs::Combat, "FAILED a finishing blow: levelreq at %d, other level %d", levelreq , defender->GetLevel()); return false; } } @@ -7624,7 +7624,7 @@ bool Bot::TryFinishingBlow(Mob *defender, SkillUseTypes skillinuse) } void Bot::DoRiposte(Mob* defender) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a riposte"); + Log.Out(Logs::Detail, Logs::Combat, "Preforming a riposte"); if (!defender) return; @@ -7637,7 +7637,7 @@ void Bot::DoRiposte(Mob* defender) { defender->GetItemBonuses().GiveDoubleRiposte[0]; if(DoubleRipChance && (DoubleRipChance >= zone->random.Int(0, 100))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); + Log.Out(Logs::Detail, Logs::Combat, "Preforming a double riposte (%d percent chance)", DoubleRipChance); defender->Attack(this, MainPrimary, true); } @@ -8207,7 +8207,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { float AttackerChance = 0.20f + ((float)(rangerLevel - 51) * 0.005f); float DefenderChance = (float)zone->random.Real(0.00f, 1.00f); if(AttackerChance > DefenderChance) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.Out(Logs::Detail, Logs::Combat, "Landed a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); // WildcardX: At the time I wrote this, there wasnt a string id for something like HEADSHOT_BLOW //entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, FINISHING_BLOW, GetName()); entity_list.MessageClose(this, false, 200, MT_CritMelee, "%s has scored a leathal HEADSHOT!", GetName()); @@ -8215,7 +8215,7 @@ bool Bot::TryHeadShot(Mob* defender, SkillUseTypes skillInUse) { Result = true; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); + Log.Out(Logs::Detail, Logs::Combat, "FAILED a headshot: Attacker chance was %f and Defender chance was %f.", AttackerChance, DefenderChance); } } } @@ -8441,11 +8441,11 @@ void Bot::ProcessGuildInvite(Client* guildOfficer, Bot* botToGuild) { return; } - // Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); + // Log.Out(Logs::Detail, Logs::Guilds, "Inviting %s (%d) into guild %s (%d)", botToGuild->GetName(), botToGuild->GetBotID(), guild_mgr.GetGuildName(client->GuildID()), client->GuildID()); SetBotGuildMembership(botToGuild->GetBotID(), guildOfficer->GuildID(), GUILD_MEMBER); - //Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID(); + //Log.LogDebugType(Logs::Detail, Logs::Guilds, "Sending char refresh for BOT %s from guild %d to world", botToGuild->GetName(), guildOfficer->GuildID(); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -8548,7 +8548,7 @@ int32 Bot::CalcMaxMana() { } default: { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -9076,7 +9076,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(zone && !zone->IsSpellBlocked(spell_id, GetX(), GetY(), GetZ())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.Out(Logs::Detail, Logs::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -9084,7 +9084,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t if(GetClass() != BARD) { if(!IsValidSpell(spell_id) || casting_spell_id || delaytimer || spellend_timer.Enabled() || IsStunned() || IsFeared() || IsMezzed() || (IsSilenced() && !IsDiscipline(spell_id)) || (IsAmnesiad() && IsDiscipline(spell_id))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", + Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -9105,7 +9105,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t //cannot cast under deivne aura if(DivineAura()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -9119,7 +9119,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -9127,7 +9127,7 @@ bool Bot::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_t } if (HasActiveSong()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); + Log.Out(Logs::Detail, Logs::Spells, "Casting a new spell/song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client //_StopSong(); bardsong = 0; @@ -9256,7 +9256,7 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(caster->IsBot()) { if(spells[spell_id].targettype == ST_Undead) { if((GetBodyType() != BT_SummonedUndead) && (GetBodyType() != BT_Undead) && (GetBodyType() != BT_Vampire)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not an undead."); + Log.Out(Logs::Detail, Logs::Spells, "Bot's target is not an undead."); return true; } } @@ -9266,13 +9266,13 @@ bool Bot::IsImmuneToSpell(uint16 spell_id, Mob *caster) { && (GetBodyType() != BT_Summoned2) && (GetBodyType() != BT_Summoned3) ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bot's target is not a summoned creature."); + Log.Out(Logs::Detail, Logs::Spells, "Bot's target is not a summoned creature."); return true; } } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No bot immunities to spell %d found.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "No bot immunities to spell %d found.", spell_id); } } @@ -15454,7 +15454,7 @@ bool EntityList::Bot_AICheckCloseBeneficialSpells(Bot* caster, uint8 iChance, fl // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Out(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } diff --git a/zone/botspellsai.cpp b/zone/botspellsai.cpp index 8f8e977a2..4c8609b6b 100644 --- a/zone/botspellsai.cpp +++ b/zone/botspellsai.cpp @@ -950,7 +950,7 @@ bool Bot::AI_PursueCastCheck() { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.Out(Logs::Detail, Logs::AI, "Bot Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), 100, SpellType_Snare)) { if(!AICastSpell(GetTarget(), 100, SpellType_Lifetap)) { @@ -1055,7 +1055,7 @@ bool Bot::AI_EngagedCastCheck() { BotStanceType botStance = GetBotStance(); bool mayGetAggro = HasOrMayGetAggro(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); + Log.Out(Logs::Detail, Logs::AI, "Engaged autocast check triggered (BOTS). Trying to cast healing spells then maybe offensive spells."); if(botClass == CLERIC) { if(!AICastSpell(GetTarget(), GetChanceToCastBySpellType(SpellType_Escape), SpellType_Escape)) { diff --git a/zone/client.cpp b/zone/client.cpp index 8bf63010e..d7b34f2b9 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -340,7 +340,7 @@ Client::~Client() { ToggleBuyerMode(false); if(conn_state != ClientConnectFinished) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); + Log.Out(Logs::General, Logs::None, "Client '%s' was destroyed before reaching the connected state:", GetName()); ReportConnectingState(); } @@ -438,31 +438,31 @@ void Client::SendLogoutPackets() { void Client::ReportConnectingState() { switch(conn_state) { case NoPacketsReceived: //havent gotten anything - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client has not sent us an initial zone entry packet."); + Log.Out(Logs::General, Logs::None, "Client has not sent us an initial zone entry packet."); break; case ReceivedZoneEntry: //got the first packet, loading up PP - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client sent initial zone packet, but we never got their player info from the database."); + Log.Out(Logs::General, Logs::None, "Client sent initial zone packet, but we never got their player info from the database."); break; case PlayerProfileLoaded: //our DB work is done, sending it - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); + Log.Out(Logs::General, Logs::None, "We were sending the player profile, tributes, tasks, spawns, time and weather, but never finished."); break; case ZoneInfoSent: //includes PP, tributes, tasks, spawns, time and weather - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We successfully sent player info and spawns, waiting for client to request new zone."); + Log.Out(Logs::General, Logs::None, "We successfully sent player info and spawns, waiting for client to request new zone."); break; case NewZoneRequested: //received and sent new zone request - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We received client's new zone request, waiting for client spawn request."); + Log.Out(Logs::General, Logs::None, "We received client's new zone request, waiting for client spawn request."); break; case ClientSpawnRequested: //client sent ReqClientSpawn - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); + Log.Out(Logs::General, Logs::None, "We received the client spawn request, and were sending objects, doors, zone points and some other stuff, but never finished."); break; case ZoneContentsSent: //objects, doors, zone points - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); + Log.Out(Logs::General, Logs::None, "The rest of the zone contents were successfully sent, waiting for client ready notification."); break; case ClientReadyReceived: //client told us its ready, send them a bunch of crap like guild MOTD, etc - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "We received client ready notification, but never finished Client::CompleteConnect"); + Log.Out(Logs::General, Logs::None, "We received client ready notification, but never finished Client::CompleteConnect"); break; case ClientConnectFinished: //client finally moved to finished state, were done here - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client is successfully connected."); + Log.Out(Logs::General, Logs::None, "Client is successfully connected."); break; }; } @@ -650,7 +650,7 @@ bool Client::SendAllPackets() { if(eqs) eqs->FastQueuePacket((EQApplicationPacket **)&cp->app, cp->ack_req); iterator.RemoveCurrent(); - Log.Out(EQEmuLogSys::Moderate, EQEmuLogSys::Client_Server_Packet, "Transmitting a packet"); + Log.Out(Logs::Moderate, Logs::Client_Server_Packet, "Transmitting a packet"); } return true; } @@ -698,7 +698,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s char message[4096]; strn0cpy(message, orig_message, sizeof(message)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); + Log.Out(Logs::Detail, Logs::Zone_Server, "Client::ChannelMessageReceived() Channel:%i message:'%s'", chan_num, message); if (targetname == nullptr) { targetname = (!GetTarget()) ? "" : GetTarget()->GetName(); @@ -1506,7 +1506,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - Log.Out(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); + Log.Out(Logs::Moderate, Logs::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); @@ -1911,7 +1911,7 @@ void Client::ReadBook(BookRequest_Struct *book) { if (booktxt2[0] != '\0') { #if EQDEBUG >= 6 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); + Log.Out(Logs::General, Logs::Normal, "Client::ReadBook() textfile:%s Text:%s", txtfile, booktxt2.c_str()); #endif EQApplicationPacket* outapp = new EQApplicationPacket(OP_ReadBook, length + sizeof(BookText_Struct)); @@ -2105,7 +2105,7 @@ void Client::AddMoneyToPP(uint64 copper, bool updateclient){ SaveCurrency(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); + Log.Out(Logs::General, Logs::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); } void Client::EVENT_ITEM_ScriptStopReturn(){ @@ -2145,7 +2145,7 @@ void Client::AddMoneyToPP(uint32 copper, uint32 silver, uint32 gold, uint32 plat SaveCurrency(); #if (EQDEBUG>=5) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", + Log.Out(Logs::General, Logs::None, "Client::AddMoneyToPP() %s should have: plat:%i gold:%i silver:%i copper:%i", GetName(), m_pp.platinum, m_pp.gold, m_pp.silver, m_pp.copper); #endif } @@ -2235,13 +2235,13 @@ bool Client::CheckIncreaseSkill(SkillUseTypes skillid, Mob *against_who, int cha if(zone->random.Real(0, 99) < Chance) { SetSkill(skillid, GetRawSkill(skillid) + 1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.Out(Logs::Detail, Logs::Skills, "Skill %d at value %d successfully gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); return true; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); + Log.Out(Logs::Detail, Logs::Skills, "Skill %d at value %d failed to gain with %.4f%%chance (mod %d)", skillid, skillval, Chance, chancemodi); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); + Log.Out(Logs::Detail, Logs::Skills, "Skill %d at value %d cannot increase due to maxmum %d", skillid, skillval, maxskill); } return false; } @@ -2262,10 +2262,10 @@ void Client::CheckLanguageSkillIncrease(uint8 langid, uint8 TeacherSkill) { if(zone->random.Real(0,100) < Chance) { // if they make the roll IncreaseLanguageSkill(langid); // increase the language skill by 1 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); + Log.Out(Logs::Detail, Logs::Skills, "Language %d at value %d successfully gain with %.4f%%chance", langid, LangSkill, Chance); } else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); + Log.Out(Logs::Detail, Logs::Skills, "Language %d at value %d failed to gain with %.4f%%chance", langid, LangSkill, Chance); } } @@ -2364,7 +2364,7 @@ uint16 Client::GetMaxSkillAfterSpecializationRules(SkillUseTypes skillid, uint16 Save(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Reset %s's caster specialization skills to 1. " + Log.Out(Logs::General, Logs::Normal, "Reset %s's caster specialization skills to 1. " "Too many specializations skills were above 50.", GetCleanName()); } @@ -4544,14 +4544,14 @@ void Client::HandleLDoNOpen(NPC *target) { if(target->GetClass() != LDON_TREASURE) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was not a treasure chest.", + Log.Out(Logs::General, Logs::None, "%s tried to open %s but %s was not a treasure chest.", GetName(), target->GetName(), target->GetName()); return; } if(DistNoRootNoZ(*target) > RuleI(Adventure, LDoNTrapDistanceUse)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s tried to open %s but %s was out of range", + Log.Out(Logs::General, Logs::None, "%s tried to open %s but %s was out of range", GetName(), target->GetName(), target->GetName()); Message(13, "Treasure chest out of range."); return; @@ -5294,7 +5294,7 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -5362,7 +5362,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -5389,7 +5389,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " @@ -5397,7 +5397,7 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); @@ -6211,7 +6211,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid PetRecord record; if(!database.GetPetEntry(spells[spell_id].teleport_zone, &record)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); + Log.Out(Logs::General, Logs::Error, "Unknown doppelganger spell id: %d, check pets table", spell_id); Message(13, "Unable to find data for pet %s", spells[spell_id].teleport_zone); return; } @@ -6225,7 +6225,7 @@ void Client::Doppelganger(uint16 spell_id, Mob *target, const char *name_overrid const NPCType *npc_type = database.GetNPCType(pet.npc_id); if(npc_type == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); + Log.Out(Logs::General, Logs::Error, "Unknown npc type for doppelganger spell id: %d", spell_id); Message(0,"Unable to find pet!"); return; } @@ -8149,7 +8149,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, EATING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Eating from slot:%i", (int)slot); + Log.Out(Logs::General, Logs::None, "Eating from slot:%i", (int)slot); #endif } else @@ -8166,7 +8166,7 @@ void Client::Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_ entity_list.MessageClose_StringID(this, true, 50, 0, DRINKING_MESSAGE, GetName(), item->Name); #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking from slot:%i", (int)slot); + Log.Out(Logs::General, Logs::None, "Drinking from slot:%i", (int)slot); #endif } } @@ -8289,11 +8289,11 @@ std::string Client::TextLink::GenerateLink() if ((m_Link.length() == 0) || (m_Link.length() > 250)) { m_Error = true; m_Link = ""; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", + Log.Out(Logs::General, Logs::Error, "TextLink::GenerateLink() failed to generate a useable text link (LinkType: %i, Lengths: {link: %u, body: %u, text: %u})", m_LinkType, m_Link.length(), m_LinkBody.length(), m_LinkText.length()); #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkBody: %s", m_LinkBody.c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ">> LinkText: %s", m_LinkText.c_str()); + Log.Out(Logs::General, Logs::Error, ">> LinkBody: %s", m_LinkBody.c_str()); + Log.Out(Logs::General, Logs::Error, ">> LinkText: %s", m_LinkText.c_str()); #endif } diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index ff7c44010..f3c17a4d2 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -826,7 +826,7 @@ int32 Client::acmod() { return (65 + ((agility-300) / 21)); } #if EQDEBUG >= 11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); + Log.Out(Logs::General, Logs::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; @@ -935,7 +935,7 @@ int32 Client::CalcMaxMana() break; } default: { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -956,7 +956,7 @@ int32 Client::CalcMaxMana() } #if EQDEBUG >= 11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.Out(Logs::General, Logs::None, "Client::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1046,14 +1046,14 @@ int32 Client::CalcBaseMana() break; } default: { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_m = 0; break; } } #if EQDEBUG >= 11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); + Log.Out(Logs::General, Logs::None, "Client::CalcBaseMana() called for %s - returning %d", GetName(), max_m); #endif return max_m; } @@ -1896,7 +1896,7 @@ uint32 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", + Log.Out(Logs::Detail, Logs::Spells, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 188ada287..1347fa2d5 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -401,7 +401,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) if(is_log_enabled(CLIENT__NET_IN_TRACE)) { char buffer[64]; app->build_header_dump(buffer); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Dispatch opcode: %s", buffer); + Log.Out(Logs::Detail, Logs::Client_Server_Packet, "Dispatch opcode: %s", buffer); } EmuOpcode opcode = app->GetOpcode(); @@ -416,7 +416,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) #ifdef SOLAR if(0 && opcode != OP_ClientUpdate) { - Log.LogDebug(EQEmuLogSys::General,"HandlePacket() OPCODE debug enabled client %s", GetName()); + Log.LogDebug(Logs::General,"HandlePacket() OPCODE debug enabled client %s", GetName()); std::cerr << "OPCODE: " << std::hex << std::setw(4) << std::setfill('0') << opcode << std::dec << ", size: " << app->size << std::endl; DumpPacket(app); } @@ -431,7 +431,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 1, &args); #if EQDEBUG >= 10 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" + Log.Out(Logs::General, Logs::Error, "HandlePacket() Opcode error: Unexpected packet during CLIENT_CONNECTING: opcode:" " %s (#%d eq=0x%04x), size: %i", OpcodeNames[opcode], opcode, 0, app->size); DumpPacket(app); #endif @@ -460,8 +460,8 @@ int Client::HandlePacket(const EQApplicationPacket *app) parse->EventPlayer(EVENT_UNHANDLED_OPCODE, this, "", 0, &args); char buffer[64]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); - if (Log.log_settings[EQEmuLogSys::Client_Server_Packet].log_to_console > 0){ + Log.Out(Logs::Detail, Logs::Client_Server_Packet, "Unhandled incoming opcode: %s - 0x%04x", OpcodeManager::EmuToName(app->GetOpcode()), app->GetOpcode()); + if (Log.log_settings[Logs::Client_Server_Packet].log_to_console > 0){ app->build_header_dump(buffer); if (app->size < 1000) DumpPacket(app, app->size); @@ -483,7 +483,7 @@ int Client::HandlePacket(const EQApplicationPacket *app) case CLIENT_LINKDEAD: break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown client_state: %d\n", client_state); + Log.Out(Logs::General, Logs::None, "Unknown client_state: %d\n", client_state); break; } @@ -759,7 +759,7 @@ void Client::CompleteConnect() //enforce some rules.. if (!CanBeInZone()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Kicking char from zone, not allowed here"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Kicking char from zone, not allowed here"); GoToSafeCoords(database.GetZoneID("arena"), 0); return; } @@ -966,7 +966,7 @@ return; void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) { if (app->size != sizeof(ApproveZone_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_ApproveZone: Expected %i, Got %i", sizeof(ApproveZone_Struct), app->size); return; } @@ -979,14 +979,14 @@ void Client::Handle_Connect_OP_ApproveZone(const EQApplicationPacket *app) void Client::Handle_Connect_OP_ClientError(const EQApplicationPacket *app) { if (app->size != sizeof(ClientError_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_ClientError: Expected %i, Got %i", sizeof(ClientError_Struct), app->size); return; } // Client reporting error to server ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message: %s", error->message); + Log.Out(Logs::General, Logs::Error, "Client error: %s", error->character_name); + Log.Out(Logs::General, Logs::Error, "Error message: %s", error->message); Message(13, error->message); #if (EQDEBUG>=5) DumpPacket(app); @@ -1180,7 +1180,7 @@ void Client::Handle_Connect_OP_SendTributes(const EQApplicationPacket *app) void Client::Handle_Connect_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_SetServerFilter"); + Log.Out(Logs::General, Logs::Error, "Received invalid sized OP_SetServerFilter"); DumpPacket(app); return; } @@ -1197,7 +1197,7 @@ void Client::Handle_Connect_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_Connect_OP_TGB(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TGB: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_TGB: Expected %i, Got %i", sizeof(uint32), app->size); return; } @@ -1317,14 +1317,14 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) ClientVersionBit = 0; bool siv = m_inv.SetInventoryVersion(ClientVersion); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); + Log.Out(Logs::General, Logs::None, "%s inventory version to %s(%i)", (siv ? "Succeeded in setting" : "Failed to set"), EQClientVersionName(ClientVersion), ClientVersion); /* Antighost code tmp var is so the search doesnt find this object */ Client* client = entity_list.GetClientByName(cze->char_name); if (!zone->GetAuth(ip, cze->char_name, &WID, &account_id, &character_id, &admin, lskey, &tellsoff)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetAuth() returned false kicking client"); + Log.Out(Logs::General, Logs::Error, "GetAuth() returned false kicking client"); if (client != 0) { client->Save(); client->Kick(); @@ -1340,7 +1340,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) struct in_addr ghost_addr; ghost_addr.s_addr = eqs->GetRemoteIP(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", + Log.Out(Logs::General, Logs::Error, "Ghosting client: Account ID:%i Name:%s Character:%s IP:%s", client->AccountID(), client->AccountName(), client->GetName(), inet_ntoa(ghost_addr)); client->Save(); client->Disconnect(); @@ -1729,7 +1729,7 @@ void Client::Handle_Connect_OP_ZoneEntry(const EQApplicationPacket *app) p_timers.SetCharID(CharacterID()); if (!p_timers.Load(&database)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); + Log.Out(Logs::General, Logs::Error, "Unable to load ability timers from the database for %s (%i)!", GetCleanName(), CharacterID()); } /* Load Spell Slot Refresh from Currently Memoried Spells */ @@ -1899,7 +1899,7 @@ void Client::Handle_0x0193(const EQApplicationPacket *app) void Client::Handle_OP_AAAction(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Received OP_AAAction"); + Log.Out(Logs::Detail, Logs::AA, "Received OP_AAAction"); if (app->size != sizeof(AA_Action)){ printf("Error! OP_AAAction size didnt match!\n"); @@ -1908,7 +1908,7 @@ void Client::Handle_OP_AAAction(const EQApplicationPacket *app) AA_Action* action = (AA_Action*)app->pBuffer; if (action->action == aaActionActivate) {//AA Hotkey - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Activating AA %d", action->ability); + Log.Out(Logs::Detail, Logs::AA, "Activating AA %d", action->ability); ActivateAA((aaID)action->ability); } else if (action->action == aaActionBuy) { @@ -1940,7 +1940,7 @@ void Client::Handle_OP_AcceptNewTask(const EQApplicationPacket *app) { if (app->size != sizeof(AcceptNewTask_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_AcceptNewTask expected %i got %i", sizeof(AcceptNewTask_Struct), app->size); DumpPacket(app); return; @@ -1955,7 +1955,7 @@ void Client::Handle_OP_AdventureInfoRequest(const EQApplicationPacket *app) { if (app->size < sizeof(EntityId_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); + Log.Out(Logs::General, Logs::Error, "Handle_OP_AdventureInfoRequest had a packet that was too small."); return; } EntityId_Struct* ent = (EntityId_Struct*)app->pBuffer; @@ -2010,7 +2010,7 @@ void Client::Handle_OP_AdventureMerchantPurchase(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Purchase_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_AdventureMerchantPurchase expected:%i got:%i", sizeof(Adventure_Purchase_Struct), app->size); return; } @@ -2190,7 +2190,7 @@ void Client::Handle_OP_AdventureMerchantRequest(const EQApplicationPacket *app) { if (app->size != sizeof(AdventureMerchant_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_AdventureMerchantRequest expected:%i got:%i", sizeof(AdventureMerchant_Struct), app->size); return; } std::stringstream ss(std::stringstream::in | std::stringstream::out); @@ -2280,7 +2280,7 @@ void Client::Handle_OP_AdventureMerchantSell(const EQApplicationPacket *app) { if (app->size != sizeof(Adventure_Sell_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", + Log.Out(Logs::General, Logs::None, "Size mismatch on OP_AdventureMerchantSell: got %u expected %u", app->size, sizeof(Adventure_Sell_Struct)); DumpPacket(app); return; @@ -2412,7 +2412,7 @@ void Client::Handle_OP_AdventureRequest(const EQApplicationPacket *app) { if (app->size < sizeof(AdventureRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Handle_OP_AdventureRequest had a packet that was too small."); + Log.Out(Logs::General, Logs::Error, "Handle_OP_AdventureRequest had a packet that was too small."); return; } @@ -2938,7 +2938,7 @@ void Client::Handle_OP_AltCurrencySellSelection(const EQApplicationPacket *app) void Client::Handle_OP_Animation(const EQApplicationPacket *app) { if (app->size != sizeof(Animation_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.Out(Logs::General, Logs::Error, "Received invalid sized " "OP_Animation: got %d, expected %d", app->size, sizeof(Animation_Struct)); DumpPacket(app); @@ -2957,7 +2957,7 @@ void Client::Handle_OP_Animation(const EQApplicationPacket *app) void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) { if (app->size != sizeof(ApplyPoison_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_ApplyPoison, size=%i, expected %i", app->size, sizeof(ApplyPoison_Struct)); DumpPacket(app); return; } @@ -2971,7 +2971,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) if (!IsPoison) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " + Log.Out(Logs::Detail, Logs::Spells, "Item used to cast spell effect from a poison item was missing from inventory slot %d " "after casting, or is not a poison!", ApplyPoisonData->inventorySlot); Message(0, "Error: item not found for inventory slot #%i or is not a poison", ApplyPoisonData->inventorySlot); @@ -2994,7 +2994,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) DeleteItemInInventory(ApplyPoisonData->inventorySlot, 1, true); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); + Log.Out(Logs::General, Logs::None, "Chance to Apply Poison was %f. Roll was %f. Result is %u.", SuccessChance, ChanceRoll, ApplyPoisonSuccessResult); } } @@ -3009,7 +3009,7 @@ void Client::Handle_OP_ApplyPoison(const EQApplicationPacket *app) void Client::Handle_OP_Assist(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_Assist expected %i got %i", sizeof(EntityId_Struct), app->size); return; } @@ -3039,7 +3039,7 @@ void Client::Handle_OP_Assist(const EQApplicationPacket *app) void Client::Handle_OP_AssistGroup(const EQApplicationPacket *app) { if (app->size != sizeof(EntityId_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_AssistGroup expected %i got %i", sizeof(EntityId_Struct), app->size); return; } QueuePacket(app); @@ -3052,7 +3052,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) // Some clients this seems to nuke the charm text (ex. Adventurer's Stone) if (app->size != sizeof(AugmentInfo_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AugmentInfo expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_AugmentInfo expected %i got %i", sizeof(AugmentInfo_Struct), app->size); DumpPacket(app); return; @@ -3071,7 +3071,7 @@ void Client::Handle_OP_AugmentInfo(const EQApplicationPacket *app) void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) { if (app->size != sizeof(AugmentItem_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for AugmentItem_Struct: Expected: %i, Got: %i", sizeof(AugmentItem_Struct), app->size); return; } @@ -3228,7 +3228,7 @@ void Client::Handle_OP_AugmentItem(const EQApplicationPacket *app) void Client::Handle_OP_AutoAttack(const EQApplicationPacket *app) { if (app->size != 4) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_AutoAttack expected:4 got:%i", app->size); return; } @@ -3295,7 +3295,7 @@ void Client::Handle_OP_AutoAttack2(const EQApplicationPacket *app) void Client::Handle_OP_AutoFire(const EQApplicationPacket *app) { if (app->size != sizeof(bool)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_AutoFire expected %i got %i", sizeof(bool), app->size); DumpPacket(app); return; } @@ -3311,7 +3311,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) // Although there are three different structs for OP_Bandolier, they are all the same size. // if (app->size != sizeof(BandolierCreate_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Bandolier expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_Bandolier expected %i got %i", sizeof(BandolierCreate_Struct), app->size); DumpPacket(app); return; @@ -3330,7 +3330,7 @@ void Client::Handle_OP_Bandolier(const EQApplicationPacket *app) SetBandolier(app); break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Uknown Bandolier action %i", bs->action); + Log.Out(Logs::General, Logs::None, "Uknown Bandolier action %i", bs->action); } } @@ -3339,7 +3339,7 @@ void Client::Handle_OP_BankerChange(const EQApplicationPacket *app) { if (app->size != sizeof(BankerChange_Struct) && app->size != 4) //Titanium only sends 4 Bytes for this { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_BankerChange expected %i got %i", sizeof(BankerChange_Struct), app->size); DumpPacket(app); return; } @@ -3424,7 +3424,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) if (app->size < 4) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); + Log.Out(Logs::General, Logs::None, "OP_Barter packet below minimum expected size. The packet was %i bytes.", app->size); DumpPacket(app); return; } @@ -3572,7 +3572,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) default: Message(13, "Unrecognised Barter action."); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unrecognised Barter Action %i", Action); + Log.Out(Logs::Detail, Logs::Trading, "Unrecognised Barter Action %i", Action); } } @@ -3580,7 +3580,7 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) { if (app->size != sizeof(BazaarInspect_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for BazaarInspect_Struct: Expected %i, Got %i", sizeof(BazaarInspect_Struct), app->size); return; } @@ -3635,8 +3635,8 @@ void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) return; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); + Log.Out(Logs::Detail, Logs::Trading, "Malformed BazaarSearch_Struct packe, Action %it received, ignoring..."); + Log.Out(Logs::General, Logs::Error, "Malformed BazaarSearch_Struct packet received, ignoring...\n"); } return; @@ -3721,16 +3721,16 @@ void Client::Handle_OP_Begging(const EQApplicationPacket *app) void Client::Handle_OP_Bind_Wound(const EQApplicationPacket *app) { if (app->size != sizeof(BindWound_Struct)){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Bind wound packet"); + Log.Out(Logs::General, Logs::Error, "Size mismatch for Bind wound packet"); DumpPacket(app); } BindWound_Struct* bind_in = (BindWound_Struct*)app->pBuffer; Mob* bindmob = entity_list.GetMob(bind_in->to); if (!bindmob){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); + Log.Out(Logs::General, Logs::Error, "Bindwound on non-exsistant mob from %s", this->GetName()); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); + Log.Out(Logs::General, Logs::None, "BindWound in: to:\'%s\' from=\'%s\'", bindmob->GetName(), GetName()); BindWound(bindmob, true); } return; @@ -3743,7 +3743,7 @@ void Client::Handle_OP_BlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_BlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -3838,7 +3838,7 @@ void Client::Handle_OP_BoardBoat(const EQApplicationPacket *app) // this sends unclean mob name, so capped at 64 // a_boat006 if (app->size <= 5 || app->size > 64) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); + Log.Out(Logs::General, Logs::Error, "Size mismatch in OP_BoardBoad. Expected greater than 5 less than 64, got %i", app->size); DumpPacket(app); return; } @@ -3859,14 +3859,14 @@ void Client::Handle_OP_Buff(const EQApplicationPacket *app) { if (app->size != sizeof(SpellBuffFade_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "Size mismatch in OP_Buff. expected %i got %i", sizeof(SpellBuffFade_Struct), app->size); DumpPacket(app); return; } SpellBuffFade_Struct* sbf = (SpellBuffFade_Struct*)app->pBuffer; uint32 spid = sbf->spellid; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Client requested that buff with spell id %d be canceled.", spid); + Log.Out(Logs::Detail, Logs::Spells, "Client requested that buff with spell id %d be canceled.", spid); //something about IsDetrimentalSpell() crashes this portion of code.. //tbh we shouldn't use it anyway since this is a simple red vs blue buff check and @@ -3941,7 +3941,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTask_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_CancelTask expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_CancelTask expected %i got %i", sizeof(CancelTask_Struct), app->size); DumpPacket(app); return; @@ -3955,7 +3955,7 @@ void Client::Handle_OP_CancelTask(const EQApplicationPacket *app) void Client::Handle_OP_CancelTrade(const EQApplicationPacket *app) { if (app->size != sizeof(CancelTrade_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_CancelTrade, size=%i, expected %i", app->size, sizeof(CancelTrade_Struct)); return; } Mob* with = trade->With(); @@ -4006,16 +4006,16 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) targetring_z = castspell->z_pos; #ifdef _EQDEBUG - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.Out(Logs::General, Logs::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[0], castspell->cs_unknown[0]); + Log.Out(Logs::General, Logs::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[1], castspell->cs_unknown[1]); + Log.Out(Logs::General, Logs::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[2], castspell->cs_unknown[2]); + Log.Out(Logs::General, Logs::None, "cs_unknown2: %u %i", (uint8)castspell->cs_unknown[3], castspell->cs_unknown[3]); + Log.Out(Logs::General, Logs::None, "cs_unknown2: 32 %p %u", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.Out(Logs::General, Logs::None, "cs_unknown2: 32 %p %i", &castspell->cs_unknown, *(uint32*)castspell->cs_unknown); + Log.Out(Logs::General, Logs::None, "cs_unknown2: 16 %p %u %u", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); + Log.Out(Logs::General, Logs::None, "cs_unknown2: 16 %p %i %i", &castspell->cs_unknown, *(uint16*)castspell->cs_unknown, *(uint16*)castspell->cs_unknown + sizeof(uint16)); #endif - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); + Log.Out(Logs::General, Logs::None, "OP CastSpell: slot=%d, spell=%d, target=%d, inv=%lx", castspell->slot, castspell->spell_id, castspell->target_id, (unsigned long)castspell->inventoryslot); std::cout << "OP_CastSpell " << castspell->slot << " spell " << castspell->spell_id << " inventory slot " << castspell->inventoryslot << "\n" << std::endl; @@ -4047,7 +4047,7 @@ void Client::Handle_OP_CastSpell(const EQApplicationPacket *app) //discipline, using the item spell slot if (castspell->inventoryslot == INVALID_INDEX) { if (!UseDiscipline(castspell->spell_id, castspell->target_id)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); + Log.Out(Logs::General, Logs::None, "Unknown ability being used by %s, spell being cast is: %i\n", GetName(), castspell->spell_id); InterruptSpell(castspell->spell_id); } return; @@ -4190,7 +4190,7 @@ void Client::Handle_OP_ClearBlockedBuffs(const EQApplicationPacket *app) if (app->size != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_ClearBlockedBuffs expected 1 got %i", app->size); DumpPacket(app); @@ -4212,7 +4212,7 @@ void Client::Handle_OP_ClearNPCMarks(const EQApplicationPacket *app) if (app->size != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_ClearNPCMarks expected 0 got %i", app->size); DumpPacket(app); @@ -4234,7 +4234,7 @@ void Client::Handle_OP_ClearSurname(const EQApplicationPacket *app) void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) { if (app->size != sizeof(ClickDoor_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_ClickDoor, size=%i, expected %i", app->size, sizeof(ClickDoor_Struct)); return; } ClickDoor_Struct* cd = (ClickDoor_Struct*)app->pBuffer; @@ -4259,7 +4259,7 @@ void Client::Handle_OP_ClickDoor(const EQApplicationPacket *app) void Client::Handle_OP_ClickObject(const EQApplicationPacket *app) { if (app->size != sizeof(ClickObject_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on ClickObject_Struct: Expected %i, Got %i", sizeof(ClickObject_Struct), app->size); return; } @@ -4310,7 +4310,7 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) else { if (app->size != sizeof(ClickObjectAction_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_ClickObjectAction: Expected %i, Got %i", sizeof(ClickObjectAction_Struct), app->size); return; } @@ -4323,11 +4323,11 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) object->Close(); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); + Log.Out(Logs::General, Logs::Error, "Unsupported action %d in OP_ClickObjectAction", oos->open); } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); + Log.Out(Logs::General, Logs::Error, "Invalid object %d in OP_ClickObjectAction", oos->drop_id); } } @@ -4344,8 +4344,8 @@ void Client::Handle_OP_ClickObjectAction(const EQApplicationPacket *app) void Client::Handle_OP_ClientError(const EQApplicationPacket *app) { ClientError_Struct* error = (ClientError_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client error: %s", error->character_name); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error message:%s", error->message); + Log.Out(Logs::General, Logs::Error, "Client error: %s", error->character_name); + Log.Out(Logs::General, Logs::Error, "Error message:%s", error->message); return; } @@ -4366,7 +4366,7 @@ void Client::Handle_OP_ClientUpdate(const EQApplicationPacket *app) if (app->size != sizeof(PlayerPositionUpdateClient_Struct) && app->size != (sizeof(PlayerPositionUpdateClient_Struct)+1) ) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_ClientUpdate expected:%i got:%i", sizeof(PlayerPositionUpdateClient_Struct), app->size); return; } PlayerPositionUpdateClient_Struct* ppu = (PlayerPositionUpdateClient_Struct*)app->pBuffer; @@ -4718,7 +4718,7 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in Consider expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4812,7 +4812,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) { if (app->size != sizeof(Consider_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in Consider corpse expected %i got %i", sizeof(Consider_Struct), app->size); return; } Consider_Struct* conin = (Consider_Struct*)app->pBuffer; @@ -4872,7 +4872,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) { if (app->size != sizeof(Consume_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_Consume expected:%i got:%i", sizeof(Consume_Struct), app->size); return; } Consume_Struct* pcs = (Consume_Struct*)app->pBuffer; @@ -4909,7 +4909,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) ItemInst *myitem = GetInv().GetItem(pcs->slot); if (myitem == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Consuming from empty slot %d", pcs->slot); + Log.Out(Logs::General, Logs::Error, "Consuming from empty slot %d", pcs->slot); return; } @@ -4921,7 +4921,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) Consume(eat_item, ItemTypeDrink, pcs->slot, (pcs->auto_consumed == 0xffffffff)); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); + Log.Out(Logs::General, Logs::Error, "OP_Consume: unknown type, type:%i", (int)pcs->type); return; } if (m_pp.hunger_level > 50000) @@ -4942,7 +4942,7 @@ void Client::Handle_OP_Consume(const EQApplicationPacket *app) void Client::Handle_OP_ControlBoat(const EQApplicationPacket *app) { if (app->size != sizeof(ControlBoat_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_ControlBoat, size=%i, expected %i", app->size, sizeof(ControlBoat_Struct)); return; } ControlBoat_Struct* cbs = (ControlBoat_Struct*)app->pBuffer; @@ -5098,7 +5098,7 @@ void Client::Handle_OP_CrystalReclaim(const EQApplicationPacket *app) void Client::Handle_OP_Damage(const EQApplicationPacket *app) { if (app->size != sizeof(CombatDamage_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, + Log.Out(Logs::General, Logs::Error, "Received invalid sized OP_Damage: got %d, expected %d", app->size, sizeof(CombatDamage_Struct)); DumpPacket(app); return; @@ -5136,7 +5136,7 @@ void Client::Handle_OP_DelegateAbility(const EQApplicationPacket *app) if (app->size != sizeof(DelegateAbility_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DelegateAbility expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_DelegateAbility expected %i got %i", sizeof(DelegateAbility_Struct), app->size); DumpPacket(app); @@ -5311,7 +5311,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) if (app->size != sizeof(DoGroupLeadershipAbility_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_DoGroupLeadershipAbility expected %i got %i", sizeof(DoGroupLeadershipAbility_Struct), app->size); DumpPacket(app); @@ -5363,7 +5363,7 @@ void Client::Handle_OP_DoGroupLeadershipAbility(const EQApplicationPacket *app) } default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", + Log.Out(Logs::General, Logs::None, "Got unhandled OP_DoGroupLeadershipAbility Ability: %d Parameter: %d", dglas->Ability, dglas->Parameter); break; } @@ -5445,7 +5445,7 @@ void Client::Handle_OP_Dye(const EQApplicationPacket *app) void Client::Handle_OP_Emote(const EQApplicationPacket *app) { if (app->size != sizeof(Emote_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.Out(Logs::General, Logs::Error, "Received invalid sized " "OP_Emote: got %d, expected %d", app->size, sizeof(Emote_Struct)); DumpPacket(app); @@ -5536,7 +5536,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) } if (app->size != sizeof(EnvDamage2_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, + Log.Out(Logs::General, Logs::Error, "Received invalid sized OP_EnvDamage: got %d, expected %d", app->size, sizeof(EnvDamage2_Struct)); DumpPacket(app); return; @@ -5591,7 +5591,7 @@ void Client::Handle_OP_EnvDamage(const EQApplicationPacket *app) void Client::Handle_OP_FaceChange(const EQApplicationPacket *app) { if (app->size != sizeof(FaceChange_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for OP_FaceChange: Expected: %i, Got: %i", sizeof(FaceChange_Struct), app->size); return; } @@ -5832,7 +5832,7 @@ void Client::Handle_OP_FriendsWho(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildMOTD"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GetGuildMOTD"); SendGuildMOTD(true); @@ -5845,7 +5845,7 @@ void Client::Handle_OP_GetGuildMOTD(const EQApplicationPacket *app) void Client::Handle_OP_GetGuildsList(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GetGuildsList"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GetGuildsList"); SendGuildList(); } @@ -5858,7 +5858,7 @@ void Client::Handle_OP_GMBecomeNPC(const EQApplicationPacket *app) return; } if (app->size != sizeof(BecomeNPC_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GMBecomeNPC, size=%i, expected %i", app->size, sizeof(BecomeNPC_Struct)); return; } //entity_list.QueueClients(this, app, false); @@ -5910,7 +5910,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMEmoteZone_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GMEmoteZone, size=%i, expected %i", app->size, sizeof(GMEmoteZone_Struct)); return; } GMEmoteZone_Struct* gmez = (GMEmoteZone_Struct*)app->pBuffer; @@ -5927,7 +5927,7 @@ void Client::Handle_OP_GMEmoteZone(const EQApplicationPacket *app) void Client::Handle_OP_GMEndTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainEnd_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_GMEndTraining expected %i got %i", sizeof(GMTrainEnd_Struct), app->size); DumpPacket(app); return; } @@ -5943,7 +5943,7 @@ void Client::Handle_OP_GMFind(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMSummon_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GMFind, size=%i, expected %i", app->size, sizeof(GMSummon_Struct)); return; } //Break down incoming @@ -6008,7 +6008,7 @@ void Client::Handle_OP_GMHideMe(const EQApplicationPacket *app) return; } if (app->size != sizeof(SpawnAppearance_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GMHideMe, size=%i, expected %i", app->size, sizeof(SpawnAppearance_Struct)); return; } SpawnAppearance_Struct* sa = (SpawnAppearance_Struct*)app->pBuffer; @@ -6058,7 +6058,7 @@ void Client::Handle_OP_GMKill(const EQApplicationPacket *app) return; } if (app->size != sizeof(GMKill_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GMKill, size=%i, expected %i", app->size, sizeof(GMKill_Struct)); return; } GMKill_Struct* gmk = (GMKill_Struct *)app->pBuffer; @@ -6125,7 +6125,7 @@ void Client::Handle_OP_GMLastName(const EQApplicationPacket *app) void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) { if (app->size != sizeof(GMName_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GMNameChange, size=%i, expected %i", app->size, sizeof(GMName_Struct)); return; } const GMName_Struct* gmn = (const GMName_Struct *)app->pBuffer; @@ -6135,7 +6135,7 @@ void Client::Handle_OP_GMNameChange(const EQApplicationPacket *app) return; } Client* client = entity_list.GetClientByName(gmn->oldname); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); + Log.Out(Logs::General, Logs::Status, "GM(%s) changeing players name. Old:%s New:%s", GetName(), gmn->oldname, gmn->newname); bool usedname = database.CheckUsedName((const char*)gmn->newname); if (client == 0) { Message(13, "%s not found for name change. Operation failed!", gmn->oldname); @@ -6177,7 +6177,7 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) if (app->size < sizeof(GMSearchCorpse_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", + Log.Out(Logs::General, Logs::None, "OP_GMSearchCorpse size lower than expected: got %u expected at least %u", app->size, sizeof(GMSearchCorpse_Struct)); DumpPacket(app); return; @@ -6300,7 +6300,7 @@ void Client::Handle_OP_GMToggle(const EQApplicationPacket *app) void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) { if (app->size != sizeof(GMTrainee_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_GMTraining expected %i got %i", sizeof(GMTrainee_Struct), app->size); DumpPacket(app); return; } @@ -6311,7 +6311,7 @@ void Client::Handle_OP_GMTraining(const EQApplicationPacket *app) void Client::Handle_OP_GMTrainSkill(const EQApplicationPacket *app) { if (app->size != sizeof(GMSkillChange_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_GMTrainSkill expected %i got %i", sizeof(GMSkillChange_Struct), app->size); DumpPacket(app); return; } @@ -6379,7 +6379,7 @@ void Client::Handle_OP_GMZoneRequest2(const EQApplicationPacket *app) return; } if (app->size < sizeof(uint32)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_GMZoneRequest2 expected:%i got:%i", sizeof(uint32), app->size); return; } @@ -6396,7 +6396,7 @@ void Client::Handle_OP_GroupAcknowledge(const EQApplicationPacket *app) void Client::Handle_OP_GroupCancelInvite(const EQApplicationPacket *app) { if (app->size != sizeof(GroupCancel_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for OP_GroupCancelInvite: Expected: %i, Got: %i", sizeof(GroupCancel_Struct), app->size); return; } @@ -6440,12 +6440,12 @@ void Client::Handle_OP_GroupDelete(const EQApplicationPacket *app) void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for GroupGeneric_Struct: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member Disband Request from %s\n", GetName()); + Log.Out(Logs::General, Logs::None, "Member Disband Request from %s\n", GetName()); GroupGeneric_Struct* gd = (GroupGeneric_Struct*)app->pBuffer; @@ -6587,7 +6587,7 @@ void Client::Handle_OP_GroupDisband(const EQApplicationPacket *app) } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); + Log.Out(Logs::General, Logs::Error, "Failed to remove player from group. Unable to find player named %s in player group", gd->name2); } } if (LFP) @@ -6607,7 +6607,7 @@ void Client::Handle_OP_GroupFollow(const EQApplicationPacket *app) void Client::Handle_OP_GroupFollow2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupGeneric_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for OP_GroupFollow: Expected: %i, Got: %i", sizeof(GroupGeneric_Struct), app->size); return; } @@ -6656,7 +6656,7 @@ void Client::Handle_OP_GroupInvite(const EQApplicationPacket *app) void Client::Handle_OP_GroupInvite2(const EQApplicationPacket *app) { if (app->size != sizeof(GroupInvite_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for OP_GroupInvite: Expected: %i, Got: %i", sizeof(GroupInvite_Struct), app->size); return; } @@ -6725,7 +6725,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) if (g->IsLeader(this)) g->ChangeLeader(NewLeader); else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.Out(Logs::General, Logs::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6734,7 +6734,7 @@ void Client::Handle_OP_GroupMakeLeader(const EQApplicationPacket *app) void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) { if (app->size != sizeof(GroupMentor_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GroupMentor, size=%i, expected %i", app->size, sizeof(GroupMentor_Struct)); DumpPacket(app); return; } @@ -6770,7 +6770,7 @@ void Client::Handle_OP_GroupMentor(const EQApplicationPacket *app) void Client::Handle_OP_GroupRoles(const EQApplicationPacket *app) { if (app->size != sizeof(GroupRole_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GroupRoles, size=%i, expected %i", app->size, sizeof(GroupRole_Struct)); DumpPacket(app); return; } @@ -6816,7 +6816,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(GroupUpdate_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", + Log.Out(Logs::General, Logs::None, "Size mismatch on OP_GroupUpdate: got %u expected %u", app->size, sizeof(GroupUpdate_Struct)); DumpPacket(app); return; @@ -6835,7 +6835,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) if (group->IsLeader(this)) group->ChangeLeader(newleader); else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Group /makeleader request originated from non-leader member: %s", GetName()); + Log.Out(Logs::General, Logs::None, "Group /makeleader request originated from non-leader member: %s", GetName()); DumpPacket(app); } } @@ -6844,7 +6844,7 @@ void Client::Handle_OP_GroupUpdate(const EQApplicationPacket *app) default: { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); + Log.Out(Logs::General, Logs::None, "Received unhandled OP_GroupUpdate requesting action %u", gu->action); DumpPacket(app); return; } @@ -6864,7 +6864,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) } if (app->size < sizeof(uint32)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_GuildBank, size=%i, expected %i", app->size, sizeof(uint32)); DumpPacket(app); return; } @@ -6889,7 +6889,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { if ((Action != GuildBankDeposit) && (Action != GuildBankViewItem) && (Action != GuildBankWithdraw)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected hacking attempt on guild bank from %s", GetName()); + Log.Out(Logs::General, Logs::Error, "Suspected hacking attempt on guild bank from %s", GetName()); GuildBankAck(); @@ -7050,7 +7050,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) if (!IsGuildBanker() && !GuildBanks->AllowedToWithdraw(GuildID(), gbwis->Area, gbwis->SlotID, GetName())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Suspected attempted hack on the guild bank from %s", GetName()); + Log.Out(Logs::General, Logs::Error, "Suspected attempted hack on the guild bank from %s", GetName()); GuildBankAck(); @@ -7121,7 +7121,7 @@ void Client::Handle_OP_GuildBank(const EQApplicationPacket *app) { Message(13, "Unexpected GuildBank action."); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); + Log.Out(Logs::General, Logs::Error, "Received unexpected guild bank action code %i from %s", Action, GetName()); } } } @@ -7192,7 +7192,7 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) uint32 NewGuildID = guild_mgr.CreateGuild(GuildName, CharacterID()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Creating guild %s with leader %d via UF+ GUI. It was given id %lu.", GetName(), GuildName, CharacterID(), (unsigned long)NewGuildID); if (NewGuildID == GUILD_NONE) @@ -7214,12 +7214,12 @@ void Client::Handle_OP_GuildCreate(const EQApplicationPacket *app) void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDelete"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildDelete"); if (!IsInAGuild() || !guild_mgr.IsGuildLeader(GuildID(), CharacterID())) Message(0, "You are not a guild leader or not in a guild."); else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); + Log.Out(Logs::Detail, Logs::Guilds, "Deleting guild %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID()); if (!guild_mgr.DeleteGuild(GuildID())) Message(0, "Guild delete failed."); else { @@ -7230,10 +7230,10 @@ void Client::Handle_OP_GuildDelete(const EQApplicationPacket *app) void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildDemote"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildDemote"); if (app->size != sizeof(GuildDemoteStruct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); + Log.Out(Logs::Detail, Logs::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildDemoteStruct)); return; } @@ -7263,7 +7263,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) uint8 rank = gci.rank - 1; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Demoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", demote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7281,7 +7281,7 @@ void Client::Handle_OP_GuildDemote(const EQApplicationPacket *app) void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInvite"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildInvite"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildInvite, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7322,7 +7322,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) //we could send this to the member and prompt them to see if they want to //be demoted (I guess), but I dont see a point in that. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "%s (%d) is demoting %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7341,7 +7341,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "%s (%d) is asking to promote %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), client->GetName(), client->CharacterID(), gc->officer, @@ -7353,7 +7353,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); + Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildInvite for promotion to %s, length %d", client->GetName(), app->size); client->QueuePacket(app); } @@ -7376,7 +7376,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Inviting %s (%d) into guild %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Inviting %s (%d) into guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7386,7 +7386,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) if (gc->guildeqid == 0) gc->guildeqid = GuildID(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); + Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildInvite for invite to %s, length %d", client->GetName(), app->size); client->SetPendingGuildInvitation(true); client->QueuePacket(app); @@ -7409,7 +7409,7 @@ void Client::Handle_OP_GuildInvite(const EQApplicationPacket *app) void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildInviteAccept"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildInviteAccept"); SetPendingGuildInvitation(false); @@ -7445,7 +7445,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) else if (!worldserver.Connected()) Message(0, "Error: World server disconnected"); else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", + Log.Out(Logs::Detail, Logs::Guilds, "Guild Invite Accept: guild %d, response %d, inviter %s, person %s", gj->guildeqid, gj->response, gj->inviter, gj->newmember); //we dont really care a lot about what this packet means, as long as @@ -7459,7 +7459,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) if (gj->guildeqid == GuildID()) { //only need to change rank. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Changing guild rank of %s (%d) to rank %d in guild %s (%d)", GetName(), CharacterID(), gj->response, guild_mgr.GetGuildName(GuildID()), GuildID()); @@ -7471,7 +7471,7 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", + Log.Out(Logs::Detail, Logs::Guilds, "Adding %s (%d) to guild %s (%d) at rank %d", GetName(), CharacterID(), guild_mgr.GetGuildName(gj->guildeqid), gj->guildeqid, gj->response); @@ -7500,10 +7500,10 @@ void Client::Handle_OP_GuildInviteAccept(const EQApplicationPacket *app) void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildLeader"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildLeader"); if (app->size < 2) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Invalid length %d on OP_GuildLeader", app->size); + Log.Out(Logs::Detail, Logs::Guilds, "Invalid length %d on OP_GuildLeader", app->size); return; } @@ -7522,7 +7522,7 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) Client* newleader = entity_list.GetClientByName(gml->target); if (newleader) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Transfering leadership of %s (%d) to %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Transfering leadership of %s (%d) to %s (%d)", guild_mgr.GetGuildName(GuildID()), GuildID(), newleader->GetName(), newleader->CharacterID()); @@ -7543,9 +7543,9 @@ void Client::Handle_OP_GuildLeader(const EQApplicationPacket *app) void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildManageBanker of len %d", app->size); + Log.Out(Logs::Detail, Logs::Guilds, "Got OP_GuildManageBanker of len %d", app->size); if (app->size != sizeof(GuildManageBanker_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); + Log.Out(Logs::Detail, Logs::Guilds, "Error: app size of %i != size of OP_GuildManageBanker of %i\n", app->size, sizeof(GuildManageBanker_Struct)); return; } GuildManageBanker_Struct* gmb = (GuildManageBanker_Struct*)app->pBuffer; @@ -7620,16 +7620,16 @@ void Client::Handle_OP_GuildManageBanker(const EQApplicationPacket *app) void Client::Handle_OP_GuildPeace(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildPeace of len %d", app->size); + Log.Out(Logs::Detail, Logs::Guilds, "Got OP_GuildPeace of len %d", app->size); return; } void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPromote"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildPromote"); if (app->size != sizeof(GuildPromoteStruct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); + Log.Out(Logs::Detail, Logs::Guilds, "Error: app size of %i != size of GuildDemoteStruct of %i\n", app->size, sizeof(GuildPromoteStruct)); return; } @@ -7658,7 +7658,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Promoting %s (%d) from rank %s (%d) to %s (%d) in %s (%d)", promote->target, gci.char_id, guild_mgr.GetRankName(GuildID(), gci.rank), gci.rank, guild_mgr.GetRankName(GuildID(), rank), rank, @@ -7675,7 +7675,7 @@ void Client::Handle_OP_GuildPromote(const EQApplicationPacket *app) void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildPublicNote"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildPublicNote"); if (app->size < sizeof(GuildUpdate_PublicNote)) { // client calls for a motd on login even if they arent in a guild @@ -7694,7 +7694,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", + Log.Out(Logs::Detail, Logs::Guilds, "Setting public note on %s (%d) in guild %s (%d) to: %s", gpn->target, gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID(), gpn->note); @@ -7711,7 +7711,7 @@ void Client::Handle_OP_GuildPublicNote(const EQApplicationPacket *app) void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_GuildRemove"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_GuildRemove"); if (app->size != sizeof(GuildCommand_Struct)) { std::cout << "Wrong size: OP_GuildRemove, size=" << app->size << ", expected " << sizeof(GuildCommand_Struct) << std::endl; @@ -7741,7 +7741,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = client->CharacterID(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing %s (%d) from guild %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Removing %s (%d) from guild %s (%d)", client->GetName(), client->CharacterID(), guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7757,7 +7757,7 @@ void Client::Handle_OP_GuildRemove(const EQApplicationPacket *app) } char_id = gci.char_id; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", + Log.Out(Logs::Detail, Logs::Guilds, "Removing remote/offline %s (%d) into guild %s (%d)", gci.char_name.c_str(), gci.char_id, guild_mgr.GetGuildName(GuildID()), GuildID()); } @@ -7782,7 +7782,7 @@ void Client::Handle_OP_GuildStatus(const EQApplicationPacket *app) { if (app->size != sizeof(GuildStatus_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildStatus expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_GuildStatus expected %i got %i", sizeof(GuildStatus_Struct), app->size); DumpPacket(app); @@ -7839,7 +7839,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) { if (app->size != sizeof(GuildUpdateURLAndChannel_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_GuildUpdateURLAndChannel expected %i got %i", sizeof(GuildUpdateURLAndChannel_Struct), app->size); DumpPacket(app); @@ -7867,7 +7867,7 @@ void Client::Handle_OP_GuildUpdateURLAndChannel(const EQApplicationPacket *app) void Client::Handle_OP_GuildWar(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Got OP_GuildWar of len %d", app->size); + Log.Out(Logs::Detail, Logs::Guilds, "Got OP_GuildWar of len %d", app->size); return; } @@ -7943,7 +7943,7 @@ void Client::Handle_OP_HideCorpse(const EQApplicationPacket *app) // if (app->size != sizeof(HideCorpse_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_HideCorpse expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_HideCorpse expected %i got %i", sizeof(HideCorpse_Struct), app->size); DumpPacket(app); @@ -7972,7 +7972,7 @@ void Client::Handle_OP_Ignore(const EQApplicationPacket *app) void Client::Handle_OP_Illusion(const EQApplicationPacket *app) { if (app->size != sizeof(Illusion_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, + Log.Out(Logs::General, Logs::Error, "Received invalid sized OP_Illusion: got %d, expected %d", app->size, sizeof(Illusion_Struct)); DumpPacket(app); return; @@ -8002,7 +8002,7 @@ void Client::Handle_OP_InspectAnswer(const EQApplicationPacket *app) { if (app->size != sizeof(InspectResponse_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_InspectAnswer, size=%i, expected %i", app->size, sizeof(InspectResponse_Struct)); return; } @@ -8057,7 +8057,7 @@ void Client::Handle_OP_InspectMessageUpdate(const EQApplicationPacket *app) { if (app->size != sizeof(InspectMessage_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_InspectMessageUpdate, size=%i, expected %i", app->size, sizeof(InspectMessage_Struct)); return; } @@ -8071,7 +8071,7 @@ void Client::Handle_OP_InspectRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Inspect_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_InspectRequest, size=%i, expected %i", app->size, sizeof(Inspect_Struct)); return; } @@ -8108,7 +8108,7 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) { if (app->size != sizeof(ItemViewRequest_Struct)){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size on OP_ItemLinkClick. Got: %i, Expected: %i", app->size, sizeof(ItemViewRequest_Struct)); DumpPacket(app); return; } @@ -8208,7 +8208,7 @@ void Client::Handle_OP_ItemLinkClick(const EQApplicationPacket *app) void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) { if (app->size != sizeof(LDONItemViewRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_ItemLinkResponse expected:%i got:%i", sizeof(LDONItemViewRequest_Struct), app->size); return; } LDONItemViewRequest_Struct* item = (LDONItemViewRequest_Struct*)app->pBuffer; @@ -8223,7 +8223,7 @@ void Client::Handle_OP_ItemLinkResponse(const EQApplicationPacket *app) void Client::Handle_OP_ItemName(const EQApplicationPacket *app) { if (app->size != sizeof(ItemNamePacket_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for ItemNamePacket_Struct: Expected: %i, Got: %i", sizeof(ItemNamePacket_Struct), app->size); return; } @@ -8421,7 +8421,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (app->size != sizeof(ItemVerifyRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_ItemVerifyRequest expected:%i got:%i", sizeof(ItemVerifyRequest_Struct), app->size); return; } @@ -8449,7 +8449,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } if (slot_id < 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); + Log.Out(Logs::General, Logs::None, "Unknown slot being used by %s, slot being used is: %i", GetName(), request->slot); return; } @@ -8492,7 +8492,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); + Log.Out(Logs::General, Logs::None, "OP ItemVerifyRequest: spell=%i, target=%i, inv=%i", spell_id, target_id, slot_id); if (m_inv.SupportsClickCasting(slot_id) || ((item->ItemType == ItemTypePotion || item->PotionBelt) && m_inv.SupportsPotionBeltCasting(slot_id))) // sanity check { @@ -8530,7 +8530,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) if ((spell_id <= 0) && (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol && item->ItemType != ItemTypeSpell)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Item with no effect right clicked by %s", GetName()); + Log.Out(Logs::General, Logs::None, "Item with no effect right clicked by %s", GetName()); } else if (inst->IsType(ItemClassCommon)) { @@ -8603,7 +8603,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) { if (item->ItemType != ItemTypeFood && item->ItemType != ItemTypeDrink && item->ItemType != ItemTypeAlcohol) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.Out(Logs::General, Logs::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } else { @@ -8619,7 +8619,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) else if (item->ItemType == ItemTypeAlcohol) { #if EQDEBUG >= 1 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Drinking Alcohol from slot:%i", slot_id); + Log.Out(Logs::General, Logs::None, "Drinking Alcohol from slot:%i", slot_id); #endif // This Seems to be handled in OP_DeleteItem handling //DeleteItemInInventory(slot_id, 1, false); @@ -8646,7 +8646,7 @@ void Client::Handle_OP_ItemVerifyRequest(const EQApplicationPacket *app) } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); + Log.Out(Logs::General, Logs::None, "Error: unknown item->Click.Type (%i)", item->Click.Type); } } } @@ -8787,7 +8787,7 @@ void Client::Handle_OP_LDoNSenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_LeadershipExpToggle(const EQApplicationPacket *app) { if (app->size != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -8874,7 +8874,7 @@ void Client::Handle_OP_LFGGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFGGetMatchesRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_LFGGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFGGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9034,7 +9034,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) { if (app->size != sizeof(LFP_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_LFPCommand, size=%i, expected %i", app->size, sizeof(LFP_Struct)); DumpPacket(app); return; } @@ -9071,7 +9071,7 @@ void Client::Handle_OP_LFPCommand(const EQApplicationPacket *app) // This should not happen. The client checks if you are in a group and will not let you put LFP on if // you are not the leader. if (!g->IsLeader(this)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); + Log.Out(Logs::General, Logs::Error, "Client sent LFP on for character %s who is grouped but not leader.", GetName()); return; } // Fill the LFPMembers array with the rest of the group members, excluding ourself @@ -9096,7 +9096,7 @@ void Client::Handle_OP_LFPGetMatchesRequest(const EQApplicationPacket *app) { if (app->size != sizeof(LFPGetMatchesRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_LFPGetMatchesRequest, size=%i, expected %i", app->size, sizeof(LFPGetMatchesRequest_Struct)); DumpPacket(app); return; } @@ -9136,7 +9136,7 @@ void Client::Handle_OP_LoadSpellSet(const EQApplicationPacket *app) void Client::Handle_OP_Logout(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "%s sent a logout packet.", GetName()); + Log.Out(Logs::Detail, Logs::None, "%s sent a logout packet.", GetName()); SendLogoutPackets(); @@ -9150,7 +9150,7 @@ void Client::Handle_OP_Logout(const EQApplicationPacket *app) void Client::Handle_OP_LootItem(const EQApplicationPacket *app) { if (app->size != sizeof(LootingItem_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_LootItem, size=%i, expected %i", app->size, sizeof(LootingItem_Struct)); return; } @@ -9327,7 +9327,7 @@ void Client::Handle_OP_MercenaryCommand(const EQApplicationPacket *app) if (app->size != sizeof(MercenaryCommand_Struct)) { Message(13, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenaryCommand expected %i got %i", sizeof(MercenaryCommand_Struct), app->size); DumpPacket(app); return; } @@ -9384,7 +9384,7 @@ void Client::Handle_OP_MercenaryDataRequest(const EQApplicationPacket *app) // The payload is 4 bytes. The EntityID of the Mercenary Liason which are of class 71. if (app->size != sizeof(MercenaryMerchantShopRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenaryDataRequest expected 4 got %i", app->size); DumpPacket(app); @@ -9519,7 +9519,7 @@ void Client::Handle_OP_MercenaryDataUpdateRequest(const EQApplicationPacket *app if (app->size != 0) { Message(13, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenaryDataUpdateRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9539,7 +9539,7 @@ void Client::Handle_OP_MercenaryDismiss(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenaryDismiss expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9564,7 +9564,7 @@ void Client::Handle_OP_MercenaryHire(const EQApplicationPacket *app) // The payload is 16 bytes. First four bytes are the Merc ID (Template ID) if (app->size != sizeof(MercenaryMerchantRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenaryHire expected %i got %i", sizeof(MercenaryMerchantRequest_Struct), app->size); DumpPacket(app); @@ -9636,7 +9636,7 @@ void Client::Handle_OP_MercenarySuspendRequest(const EQApplicationPacket *app) if (app->size != sizeof(SuspendMercenary_Struct)) { Message(13, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenarySuspendRequest expected %i got %i", sizeof(SuspendMercenary_Struct), app->size); DumpPacket(app); return; } @@ -9660,7 +9660,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) if (app->size > 1) { Message(13, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_MercenaryTimerRequest expected 0 got %i", app->size); DumpPacket(app); return; } @@ -9698,7 +9698,7 @@ void Client::Handle_OP_MercenaryTimerRequest(const EQApplicationPacket *app) void Client::Handle_OP_MoveCoin(const EQApplicationPacket *app) { if (app->size != sizeof(MoveCoin_Struct)){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size on OP_MoveCoin. Got: %i, Expected: %i", app->size, sizeof(MoveCoin_Struct)); DumpPacket(app); return; } @@ -9714,7 +9714,7 @@ void Client::Handle_OP_MoveItem(const EQApplicationPacket *app) } if (app->size != sizeof(MoveItem_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_MoveItem, size=%i, expected %i", app->size, sizeof(MoveItem_Struct)); return; } @@ -9797,7 +9797,7 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9829,7 +9829,7 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) @@ -9856,7 +9856,7 @@ void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) { if (app->size < 2) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_PDeletePetition, size=%i, expected %i", app->size, 2); return; } if (petition_list.DeletePetitionByCharName((char*)app->pBuffer)) @@ -9869,7 +9869,7 @@ void Client::Handle_OP_PDeletePetition(const EQApplicationPacket *app) void Client::Handle_OP_PetCommands(const EQApplicationPacket *app) { if (app->size != sizeof(PetCommand_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_PetCommands, size=%i, expected %i", app->size, sizeof(PetCommand_Struct)); return; } char val1[20] = { 0 }; @@ -10332,7 +10332,7 @@ void Client::Handle_OP_PetitionBug(const EQApplicationPacket *app) void Client::Handle_OP_PetitionCheckIn(const EQApplicationPacket *app) { if (app->size != sizeof(Petition_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_PetitionCheckIn, size=%i, expected %i", app->size, sizeof(Petition_Struct)); return; } Petition_Struct* inpet = (Petition_Struct*)app->pBuffer; @@ -10376,7 +10376,7 @@ void Client::Handle_OP_PetitionCheckout(const EQApplicationPacket *app) void Client::Handle_OP_PetitionDelete(const EQApplicationPacket *app) { if (app->size != sizeof(PetitionUpdate_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_PetitionDelete, size=%i, expected %i", app->size, sizeof(PetitionUpdate_Struct)); return; } EQApplicationPacket* outapp = new EQApplicationPacket(OP_PetitionUpdate, sizeof(PetitionUpdate_Struct)); @@ -10446,7 +10446,7 @@ void Client::Handle_OP_PickPocket(const EQApplicationPacket *app) { if (app->size != sizeof(PickPocket_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Size mismatch for Pick Pocket packet"); + Log.Out(Logs::General, Logs::Error, "Size mismatch for Pick Pocket packet"); DumpPacket(app); } @@ -10516,7 +10516,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) { if (app->size != sizeof(PopupResponse_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PopupResponse expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_PopupResponse expected %i got %i", sizeof(PopupResponse_Struct), app->size); DumpPacket(app); return; @@ -10551,7 +10551,7 @@ void Client::Handle_OP_PopupResponse(const EQApplicationPacket *app) void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) { if (app->size != sizeof(MovePotionToBelt_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PotionBelt expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_PotionBelt expected %i got %i", sizeof(MovePotionToBelt_Struct), app->size); DumpPacket(app); return; @@ -10559,7 +10559,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) MovePotionToBelt_Struct *mptbs = (MovePotionToBelt_Struct*)app->pBuffer; if(!EQEmu::ValueWithin(mptbs->SlotNumber, 0U, 3U)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); + Log.Out(Logs::General, Logs::None, "Client::Handle_OP_PotionBelt mptbs->SlotNumber out of range."); return; } @@ -10582,7 +10582,7 @@ void Client::Handle_OP_PotionBelt(const EQApplicationPacket *app) void Client::Handle_OP_PurchaseLeadershipAA(const EQApplicationPacket *app) { if (app->size != sizeof(uint32)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_LeadershipExpToggle expected %i got %i", 1, app->size); DumpPacket(app); return; } @@ -10672,7 +10672,7 @@ void Client::Handle_OP_PVPLeaderBoardDetailsRequest(const EQApplicationPacket *a // if (app->size != sizeof(PVPLeaderBoardDetailsRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_PVPLeaderBoardDetailsRequest expected %i got %i", sizeof(PVPLeaderBoardDetailsRequest_Struct), app->size); DumpPacket(app); @@ -10699,7 +10699,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) // if (app->size != sizeof(PVPLeaderBoardRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_PVPLeaderBoardRequest expected %i got %i", sizeof(PVPLeaderBoardRequest_Struct), app->size); DumpPacket(app); @@ -10720,7 +10720,7 @@ void Client::Handle_OP_PVPLeaderBoardRequest(const EQApplicationPacket *app) void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) { if (app->size < sizeof(RaidGeneral_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_RaidCommand, size=%i, expected at least %i", app->size, sizeof(RaidGeneral_Struct)); DumpPacket(app); return; } @@ -11305,7 +11305,7 @@ void Client::Handle_OP_RaidCommand(const EQApplicationPacket *app) void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) { if (app->size != sizeof(RandomReq_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_RandomReq, size=%i, expected %i", app->size, sizeof(RandomReq_Struct)); return; } const RandomReq_Struct* rndq = (const RandomReq_Struct*)app->pBuffer; @@ -11334,7 +11334,7 @@ void Client::Handle_OP_RandomReq(const EQApplicationPacket *app) void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) { if (app->size != sizeof(BookRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_ReadBook, size=%i, expected %i", app->size, sizeof(BookRequest_Struct)); return; } BookRequest_Struct* book = (BookRequest_Struct*)app->pBuffer; @@ -11350,7 +11350,7 @@ void Client::Handle_OP_ReadBook(const EQApplicationPacket *app) void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) { if (app->size != sizeof(RecipeAutoCombine_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for RecipeAutoCombine_Struct: Expected: %i, Got: %i", sizeof(RecipeAutoCombine_Struct), app->size); return; } @@ -11364,7 +11364,7 @@ void Client::Handle_OP_RecipeAutoCombine(const EQApplicationPacket *app) void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) { if (app->size < sizeof(uint32)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for RecipeDetails Request: Expected: %i, Got: %i", sizeof(uint32), app->size); return; } @@ -11378,14 +11378,14 @@ void Client::Handle_OP_RecipeDetails(const EQApplicationPacket *app) void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) { if (app->size != sizeof(TradeskillFavorites_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for TradeskillFavorites_Struct: Expected: %i, Got: %i", sizeof(TradeskillFavorites_Struct), app->size); return; } TradeskillFavorites_Struct* tsf = (TradeskillFavorites_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); + Log.Out(Logs::General, Logs::None, "Requested Favorites for: %d - %d\n", tsf->object_type, tsf->some_id); // results show that object_type is combiner type // some_id = 0 if world combiner, item number otherwise @@ -11437,7 +11437,7 @@ void Client::Handle_OP_RecipesFavorite(const EQApplicationPacket *app) void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) { if (app->size != sizeof(RecipesSearch_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for RecipesSearch_Struct: Expected: %i, Got: %i", sizeof(RecipesSearch_Struct), app->size); return; } @@ -11446,7 +11446,7 @@ void Client::Handle_OP_RecipesSearch(const EQApplicationPacket *app) rss->query[55] = '\0'; //just to be sure. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); + Log.Out(Logs::General, Logs::None, "Requested search recipes for: %d - %d\n", rss->object_type, rss->some_id); // make where clause segment for container(s) char containers[30]; @@ -11506,7 +11506,7 @@ void Client::Handle_OP_RemoveBlockedBuffs(const EQApplicationPacket *app) if (app->size != sizeof(BlockedBuffs_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_RemoveBlockedBuffs expected %i got %i", sizeof(BlockedBuffs_Struct), app->size); DumpPacket(app); @@ -11669,7 +11669,7 @@ void Client::Handle_OP_RespawnWindow(const EQApplicationPacket *app) // if (app->size != 4) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_RespawnWindow expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_RespawnWindow expected %i got %i", 4, app->size); DumpPacket(app); return; @@ -11697,7 +11697,7 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) const Resurrect_Struct* ra = (const Resurrect_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", + Log.Out(Logs::Detail, Logs::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); _pkt(SPELLS__REZ, app); @@ -11720,14 +11720,14 @@ void Client::Handle_OP_Sacrifice(const EQApplicationPacket *app) { if (app->size != sizeof(Sacrifice_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_Sacrifice expected %i got %i", sizeof(Sacrifice_Struct), app->size); DumpPacket(app); return; } Sacrifice_Struct *ss = (Sacrifice_Struct*)app->pBuffer; if (!PendingSacrifice) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected OP_Sacrifice reply"); + Log.Out(Logs::General, Logs::Error, "Unexpected OP_Sacrifice reply"); DumpPacket(app); return; } @@ -11765,13 +11765,13 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_SelectTribute of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_SelectTribute of length %d", app->size); _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. if (app->size != sizeof(SelectTributeReq_Struct)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_SelectTribute packet"); + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_SelectTribute packet"); else { SelectTributeReq_Struct *t = (SelectTributeReq_Struct *)app->pBuffer; SendTributeDetails(t->client_id, t->tribute_id); @@ -11848,7 +11848,7 @@ void Client::Handle_OP_SenseTraps(const EQApplicationPacket *app) void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received OP_SetGuildMOTD"); + Log.Out(Logs::Detail, Logs::Guilds, "Received OP_SetGuildMOTD"); if (app->size != sizeof(GuildMOTD_Struct)) { // client calls for a motd on login even if they arent in a guild @@ -11866,7 +11866,7 @@ void Client::Handle_OP_SetGuildMOTD(const EQApplicationPacket *app) GuildMOTD_Struct* gmotd = (GuildMOTD_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Setting MOTD for %s (%d) to: %s - %s", + Log.Out(Logs::Detail, Logs::Guilds, "Setting MOTD for %s (%d) to: %s - %s", guild_mgr.GetGuildName(GuildID()), GuildID(), GetName(), gmotd->motd); if (!guild_mgr.SetGuildMOTD(GuildID(), gmotd->motd, GetName())) { @@ -11884,7 +11884,7 @@ void Client::Handle_OP_SetRunMode(const EQApplicationPacket *app) void Client::Handle_OP_SetServerFilter(const EQApplicationPacket *app) { if (app->size != sizeof(SetServerFilter_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received invalid sized " + Log.Out(Logs::General, Logs::Error, "Received invalid sized " "OP_SetServerFilter: got %d, expected %d", app->size, sizeof(SetServerFilter_Struct)); DumpPacket(app); @@ -11904,7 +11904,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) } if (app->size < 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_SetStartCity, size=%i, expected %i", app->size, 1); DumpPacket(app); return; } @@ -11918,7 +11918,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) m_pp.class_, m_pp.deity, m_pp.race); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No valid start zones found for /setstartcity"); + Log.Out(Logs::General, Logs::Error, "No valid start zones found for /setstartcity"); return; } @@ -11969,7 +11969,7 @@ void Client::Handle_OP_SetStartCity(const EQApplicationPacket *app) void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) { if (app->size != sizeof(SetTitle_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_SetTitle expected %i got %i", sizeof(SetTitle_Struct), app->size); DumpPacket(app); return; } @@ -11993,7 +11993,7 @@ void Client::Handle_OP_SetTitle(const EQApplicationPacket *app) void Client::Handle_OP_Shielding(const EQApplicationPacket *app) { if (app->size != sizeof(Shielding_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_Shielding expected:%i got:%i", sizeof(Shielding_Struct), app->size); return; } if (GetClass() != WARRIOR) @@ -12090,7 +12090,7 @@ void Client::Handle_OP_ShopEnd(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Sell_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_ShopPlayerBuy: Expected %i, Got %i", sizeof(Merchant_Sell_Struct), app->size); return; } @@ -12098,7 +12098,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) t1.start(); Merchant_Sell_Struct* mp = (Merchant_Sell_Struct*)app->pBuffer; #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s, purchase item..", GetName()); + Log.Out(Logs::General, Logs::None, "%s, purchase item..", GetName()); DumpPacket(app); #endif @@ -12258,7 +12258,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) SendItemPacket(freeslotid, inst, ItemPacketTrade); } else if (!stacked){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); + Log.Out(Logs::General, Logs::Error, "OP_ShopPlayerBuy: item->ItemClass Unknown! Type: %i", item->ItemClass); } QueuePacket(outapp); if (inst && tmpmer_used){ @@ -12348,7 +12348,7 @@ void Client::Handle_OP_ShopPlayerBuy(const EQApplicationPacket *app) void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Purchase_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_ShopPlayerSell: Expected %i, Got %i", sizeof(Merchant_Purchase_Struct), app->size); return; } @@ -12504,7 +12504,7 @@ void Client::Handle_OP_ShopPlayerSell(const EQApplicationPacket *app) void Client::Handle_OP_ShopRequest(const EQApplicationPacket *app) { if (app->size != sizeof(Merchant_Click_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_ShopRequest, size=%i, expected %i", app->size, sizeof(Merchant_Click_Struct)); return; } @@ -12797,7 +12797,7 @@ void Client::Handle_OP_SpawnAppearance(const EQApplicationPacket *app) void Client::Handle_OP_Split(const EQApplicationPacket *app) { if (app->size != sizeof(Split_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_Split, size=%i, expected %i", app->size, sizeof(Split_Struct)); return; } // The client removes the money on its own, but we have to @@ -12834,7 +12834,7 @@ void Client::Handle_OP_Surname(const EQApplicationPacket *app) { if (app->size != sizeof(Surname_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in Surname expected %i got %i", sizeof(Surname_Struct), app->size); return; } @@ -12924,7 +12924,7 @@ void Client::Handle_OP_SwapSpell(const EQApplicationPacket *app) void Client::Handle_OP_TargetCommand(const EQApplicationPacket *app) { if (app->size != sizeof(ClientTarget_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); + Log.Out(Logs::General, Logs::Error, "OP size error: OP_TargetMouse expected:%i got:%i", sizeof(ClientTarget_Struct), app->size); return; } @@ -13149,7 +13149,7 @@ void Client::Handle_OP_TaskHistoryRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TaskHistoryRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_TaskHistoryRequest expected %i got %i", sizeof(TaskHistoryRequest_Struct), app->size); DumpPacket(app); return; @@ -13202,7 +13202,7 @@ void Client::Handle_OP_Track(const EQApplicationPacket *app) CheckIncreaseSkill(SkillTracking, nullptr, 15); if (!entity_list.MakeTrackPacket(this)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to generate OP_Track packet requested by client."); + Log.Out(Logs::General, Logs::Error, "Unable to generate OP_Track packet requested by client."); return; } @@ -13216,7 +13216,7 @@ void Client::Handle_OP_TrackTarget(const EQApplicationPacket *app) if (app->size != sizeof(TrackTarget_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for OP_TrackTarget: Expected: %i, Got: %i", sizeof(TrackTarget_Struct), app->size); return; } @@ -13369,7 +13369,7 @@ void Client::Handle_OP_TradeAcceptClick(const EQApplicationPacket *app) void Client::Handle_OP_TradeBusy(const EQApplicationPacket *app) { if (app->size != sizeof(TradeBusy_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_TradeBusy, size=%i, expected %i", app->size, sizeof(TradeBusy_Struct)); return; } // Trade request recipient is cancelling the trade due to being busy @@ -13417,7 +13417,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) if (c) c->WithCustomer(0); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.Out(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); break; } @@ -13426,7 +13426,7 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) break; } default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); + Log.Out(Logs::Detail, Logs::Trading, "Unhandled action code in OP_Trader ShowItems_Struct"); break; } } @@ -13512,10 +13512,10 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", + Log.Out(Logs::Detail, Logs::Trading, "Client::Handle_OP_Trader: Unknown TraderStruct code of: %i\n", ints->Code); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown TraderStruct code of: %i\n", ints->Code); + Log.Out(Logs::General, Logs::Error, "Unknown TraderStruct code of: %i\n", ints->Code); } } @@ -13524,8 +13524,8 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) HandleTraderPriceUpdate(app); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unknown size for OP_Trader: %i\n", app->size); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown size for OP_Trader: %i\n", app->size); + Log.Out(Logs::Detail, Logs::Trading, "Unknown size for OP_Trader: %i\n", app->size); + Log.Out(Logs::General, Logs::Error, "Unknown size for OP_Trader: %i\n", app->size); DumpPacket(app); return; } @@ -13550,11 +13550,11 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) BuyTraderItem(tbs, Trader, app); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); + Log.Out(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderBuy: Null Client Pointer"); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); + Log.Out(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderBuy: Struct size mismatch"); } return; @@ -13563,7 +13563,7 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_TradeRequest, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Client requesting a trade session from an npc/client @@ -13599,7 +13599,7 @@ void Client::Handle_OP_TradeRequest(const EQApplicationPacket *app) void Client::Handle_OP_TradeRequestAck(const EQApplicationPacket *app) { if (app->size != sizeof(TradeRequest_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size: OP_TradeRequestAck, size=%i, expected %i", app->size, sizeof(TradeRequest_Struct)); return; } // Trade request recipient is acknowledging they are able to trade @@ -13628,7 +13628,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (app->size != sizeof(TraderClick_Struct)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); + Log.Out(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderShop: Returning due to struct size mismatch"); return; } @@ -13642,7 +13642,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) if (Customer) outtcs->Approval = Customer->WithCustomer(GetID()); else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" + Log.Out(Logs::Detail, Logs::Trading, "Client::Handle_OP_TraderShop: entity_list.GetClientByID(tcs->traderid)" " returned a nullptr pointer"); return; } @@ -13670,7 +13670,7 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) void Client::Handle_OP_TradeSkillCombine(const EQApplicationPacket *app) { if (app->size != sizeof(NewCombine_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", + Log.Out(Logs::General, Logs::Error, "Invalid size for NewCombine_Struct: Expected: %i, Got: %i", sizeof(NewCombine_Struct), app->size); return; } @@ -13691,7 +13691,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) { if (app->size != sizeof(Translocate_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_Translocate expected %i got %i", sizeof(Translocate_Struct), app->size); DumpPacket(app); return; } @@ -13739,7 +13739,7 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeItem of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeItem of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates an item... @@ -13758,7 +13758,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute item reply with %d points", t->tribute_points); + Log.Out(Logs::Detail, Logs::Tribute, "Sending tribute item reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13768,7 +13768,7 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeMoney of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeMoney of length %d", app->size); _pkt(TRIBUTE__IN, app); //player donates money @@ -13787,7 +13787,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Sending tribute money reply with %d points", t->tribute_points); + Log.Out(Logs::Detail, Logs::Tribute, "Sending tribute money reply with %d points", t->tribute_points); _pkt(TRIBUTE__OUT, app); QueuePacket(app); @@ -13797,7 +13797,7 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeNPC of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeNPC of length %d", app->size); _pkt(TRIBUTE__IN, app); return; @@ -13805,11 +13805,11 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeToggle of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeToggle of length %d", app->size); _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeToggle packet"); + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_TributeToggle packet"); else { uint32 *val = (uint32 *)app->pBuffer; ToggleTribute(*val ? true : false); @@ -13819,12 +13819,12 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tribute, "Received OP_TributeUpdate of length %d", app->size); + Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeUpdate of length %d", app->size); _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Invalid size on OP_TributeUpdate packet"); + Log.Out(Logs::General, Logs::Error, "Invalid size on OP_TributeUpdate packet"); else { TributeInfo_Struct *t = (TributeInfo_Struct *)app->pBuffer; ChangeTributeSettings(t); @@ -13836,7 +13836,7 @@ void Client::Handle_OP_VetClaimRequest(const EQApplicationPacket *app) { if (app->size < sizeof(VeteranClaimRequest)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); + Log.Out(Logs::General, Logs::None, "OP_VetClaimRequest size lower than expected: got %u expected at least %u", app->size, sizeof(VeteranClaimRequest)); DumpPacket(app); return; } @@ -13876,7 +13876,7 @@ void Client::Handle_OP_VoiceMacroIn(const EQApplicationPacket *app) if (app->size != sizeof(VoiceMacroIn_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_VoiceMacroIn expected %i got %i", sizeof(VoiceMacroIn_Struct), app->size); DumpPacket(app); @@ -13927,7 +13927,7 @@ void Client::Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app) { if (app->size != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_XTargetAutoAddHaters, expected 1, got %i", app->size); DumpPacket(app); return; } @@ -13939,7 +13939,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) { if (app->size < 12) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); + Log.Out(Logs::General, Logs::None, "Size mismatch in OP_XTargetRequest, expected at least 12, got %i", app->size); DumpPacket(app); return; } @@ -14162,7 +14162,7 @@ void Client::Handle_OP_XTargetRequest(const EQApplicationPacket *app) } default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unhandled XTarget Type %i", Type); + Log.Out(Logs::General, Logs::None, "Unhandled XTarget Type %i", Type); break; } diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 27a8587c0..52d1c900c 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -799,7 +799,7 @@ void Client::OnDisconnect(bool hard_disconnect) { Mob *Other = trade->With(); if(Other) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client disconnected during a trade. Returning their items."); + Log.Out(Logs::Detail, Logs::Trading, "Client disconnected during a trade. Returning their items."); FinishTrade(this); if(Other->IsClient()) @@ -836,7 +836,7 @@ void Client::BulkSendInventoryItems() { if(inst) { bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Incomplete Trade Transaction: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -1037,7 +1037,7 @@ void Client::BulkSendMerchantInventory(int merchant_id, int npcid) { // Account for merchant lists with gaps. if (ml.slot >= i) { if (ml.slot > i) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); + Log.Out(Logs::General, Logs::None, "(WARNING) Merchantlist contains gap at slot %d. Merchant: %d, NPC: %d", i, merchant_id, npcid); i = ml.slot + 1; } } @@ -1129,7 +1129,7 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ Client* c = entity_list.GetClientByID(CustomerID); if(!c) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Previous customer has gone away."); + Log.Out(Logs::Detail, Logs::Trading, "Previous customer has gone away."); CustomerID = NewCustomer; return 1; } @@ -1141,7 +1141,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I { if(PendingRezzXP < 0) { // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); + Log.Out(Logs::Detail, Logs::Spells, "Unexpected OP_RezzAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } @@ -1151,7 +1151,7 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // corpse is in has shutdown since the rez spell was cast. database.MarkCorpseAsRezzed(PendingRezzDBID); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + Log.Out(Logs::Detail, Logs::Spells, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); @@ -1201,7 +1201,7 @@ void Client::OPMemorizeSpell(const EQApplicationPacket* app) { if(app->size != sizeof(MemorizeSpell_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); + Log.Out(Logs::General, Logs::Error, "Wrong size on OP_MemorizeSpell. Got: %i, Expected: %i", app->size, sizeof(MemorizeSpell_Struct)); DumpPacket(app); return; } @@ -1723,12 +1723,12 @@ void Client::OPGMTrainSkill(const EQApplicationPacket *app) SkillUseTypes skill = (SkillUseTypes) gmskill->skill_id; if(!CanHaveSkill(skill)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, which is not allowed.", skill); + Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, which is not allowed.", skill); return; } if(MaxSkill(skill) == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); + Log.Out(Logs::Detail, Logs::Skills, "Tried to train skill %d, but training is not allowed at this level.", skill); return; } @@ -2122,7 +2122,7 @@ void Client::HandleRespawnFromHover(uint32 Option) { if (PendingRezzXP < 0 || PendingRezzSpellID == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unexpected Rezz from hover request."); + Log.Out(Logs::Detail, Logs::Spells, "Unexpected Rezz from hover request."); return; } SetHP(GetMaxHP() / 5); @@ -2155,10 +2155,10 @@ void Client::HandleRespawnFromHover(uint32 Option) if (corpse && corpse->IsCorpse()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Hover Rez in zone %s for corpse %s", + Log.Out(Logs::Detail, Logs::Spells, "Hover Rez in zone %s for corpse %s", zone->GetShortName(), PendingRezzCorpseName.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.Out(Logs::Detail, Logs::Spells, "Found corpse. Marking corpse as rezzed."); corpse->IsRezzed(true); corpse->CompleteResurrection(); diff --git a/zone/command.cpp b/zone/command.cpp index 32a910842..d0882a687 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -443,13 +443,13 @@ int command_init(void) { if ((itr=command_settings.find(cur->first))!=command_settings.end()) { cur->second->access = itr->second; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); + Log.Out(Logs::General, Logs::Commands, "command_init(): - Command '%s' set to access level %d.", cur->first.c_str(), itr->second); } else { #ifdef COMMANDS_WARNINGS if(cur->second->access == 0) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); + Log.Out(Logs::General, Logs::Status, "command_init(): Warning: Command '%s' defaulting to access level 0!" , cur->first.c_str()); #endif } } @@ -494,7 +494,7 @@ int command_add(const char *command_string, const char *desc, int access, CmdFun std::string cstr(command_string); if(commandlist.count(cstr) != 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); + Log.Out(Logs::General, Logs::Error, "command_add() - Command '%s' is a duplicate - check command.cpp." , command_string); return(-1); } @@ -568,12 +568,12 @@ int command_realdispatch(Client *c, const char *message) #ifdef COMMANDS_LOGGING if(cur->access >= COMMANDS_LOGGING_MIN_STATUS) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); + Log.Out(Logs::General, Logs::Commands, "%s (%s) used command: %s (target=%s)", c->GetName(), c->AccountName(), message, c->GetTarget()?c->GetTarget()->GetName():"NONE"); } #endif if(cur->function == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Command '%s' has a null function\n", cstr.c_str()); + Log.Out(Logs::General, Logs::Error, "Command '%s' has a null function\n", cstr.c_str()); return(-1); } else { //dispatch C++ command @@ -1292,7 +1292,7 @@ void command_viewpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); + Log.Out(Logs::General, Logs::Normal, "View petition request from %s, petition number: %i", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1317,7 +1317,7 @@ void command_petitioninfo(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.Out(Logs::General, Logs::Normal, "Petition information request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); if (results.RowCount() == 0) { c->Message(13,"There was an error in your request: ID not found! Please check the Id and try again."); @@ -1343,7 +1343,7 @@ void command_delpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); + Log.Out(Logs::General, Logs::Normal, "Delete petition request from %s, petition number:", c->GetName(), atoi(sep->argplus[1]) ); } @@ -1566,7 +1566,7 @@ void command_permaclass(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's class...Sending to char select.", t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Out(Logs::General, Logs::Normal, "Class change request from %s for %s, requested class:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseClass(atoi(sep->arg[1])); t->Save(); t->Kick(); @@ -1588,7 +1588,7 @@ void command_permarace(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's race - zone to take effect",t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Out(Logs::General, Logs::Normal, "Permanant race change request from %s for %s, requested race:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); uint32 tmp = Mob::GetDefaultGender(atoi(sep->arg[1]), t->GetBaseGender()); t->SetBaseRace(atoi(sep->arg[1])); t->SetBaseGender(tmp); @@ -1612,7 +1612,7 @@ void command_permagender(Client *c, const Seperator *sep) c->Message(0,"Target is not a client."); else { c->Message(0, "Setting %s's gender - zone to take effect",t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); + Log.Out(Logs::General, Logs::Normal, "Permanant gender change request from %s for %s, requested gender:%i", c->GetName(), t->GetName(), atoi(sep->arg[1]) ); t->SetBaseGender(atoi(sep->arg[1])); t->Save(); t->SendIllusionPacket(atoi(sep->arg[1])); @@ -1954,7 +1954,7 @@ void command_dbspawn2(Client *c, const Seperator *sep) { if (sep->IsNumber(1) && sep->IsNumber(2) && sep->IsNumber(3)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Spawning database spawn"); + Log.Out(Logs::General, Logs::Normal, "Spawning database spawn"); uint16 cond = 0; int16 cond_min = 0; if(sep->IsNumber(4)) { @@ -2274,7 +2274,7 @@ void command_setlanguage(Client *c, const Seperator *sep) } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.Out(Logs::General, Logs::Normal, "Set language request from %s, target:%s lang_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); uint8 langid = (uint8)atoi(sep->arg[1]); uint8 value = (uint8)atoi(sep->arg[2]); c->GetTarget()->CastToClient()->SetLanguageSkill( langid, value ); @@ -2299,7 +2299,7 @@ void command_setskill(Client *c, const Seperator *sep) c->Message(0, " x = 0 to %d", HIGHEST_CAN_SET_SKILL); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); + Log.Out(Logs::General, Logs::Normal, "Set skill request from %s, target:%s skill_id:%i value:%i", c->GetName(), c->GetTarget()->GetName(), atoi(sep->arg[1]), atoi(sep->arg[2]) ); int skill_num = atoi(sep->arg[1]); uint16 skill_value = atoi(sep->arg[2]); if(skill_num < HIGHEST_SKILL) @@ -2319,7 +2319,7 @@ void command_setskillall(Client *c, const Seperator *sep) } else { if (c->Admin() >= commandSetSkillsOther || c->GetTarget()==c || c->GetTarget()==0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); + Log.Out(Logs::General, Logs::Normal, "Set ALL skill request from %s, target:%s", c->GetName(), c->GetTarget()->GetName()); uint16 level = atoi(sep->arg[1]); for(SkillUseTypes skill_num=Skill1HBlunt;skill_num <= HIGHEST_SKILL;skill_num=(SkillUseTypes)(skill_num+1)) { c->GetTarget()->CastToClient()->SetSkill(skill_num, level); @@ -2409,7 +2409,7 @@ void command_spawn(Client *c, const Seperator *sep) } } #if EQDEBUG >= 11 - Log.LogDebug(EQEmuLogSys::General,"#spawn Spawning:"); + Log.LogDebug(Logs::General,"#spawn Spawning:"); #endif NPC* npc = NPC::SpawnNPC(sep->argplus[1], c->GetX(), c->GetY(), c->GetZ(), c->GetHeading(), c); @@ -3114,7 +3114,7 @@ void command_listpetition(Client *c, const Seperator *sep) if (!results.Success()) return; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Petition list requested by %s", c->GetName()); + Log.Out(Logs::General, Logs::Normal, "Petition list requested by %s", c->GetName()); if (results.RowCount() == 0) return; @@ -3771,7 +3771,7 @@ void command_lastname(Client *c, const Seperator *sep) if(c->GetTarget() && c->GetTarget()->IsClient()) t=c->GetTarget()->CastToClient(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); + Log.Out(Logs::General, Logs::Normal, "#lastname request from %s for %s", c->GetName(), t->GetName()); if(strlen(sep->arg[1]) <= 70) t->ChangeLastName(sep->arg[1]); @@ -4394,7 +4394,7 @@ void command_time(Client *c, const Seperator *sep) ); c->Message(13, "It is now %s.", timeMessage); #if EQDEBUG >= 11 - Log.LogDebug(EQEmuLogSys::General,"Recieved timeMessage:%s", timeMessage); + Log.LogDebug(Logs::General,"Recieved timeMessage:%s", timeMessage); #endif } } @@ -4545,10 +4545,10 @@ void command_guild(Client *c, const Seperator *sep) } if(guild_id == GUILD_NONE) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Removing %s (%d) from guild with GM command.", c->GetName(), sep->arg[2], charid); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Putting %s (%d) into guild %s (%d) with GM command.", c->GetName(), sep->arg[2], charid, guild_mgr.GetGuildName(guild_id), guild_id); } @@ -4597,7 +4597,7 @@ void command_guild(Client *c, const Seperator *sep) return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Setting %s (%d)'s guild rank to %d with GM command.", c->GetName(), sep->arg[2], charid, rank); if(!guild_mgr.SetGuildRank(charid, rank)) @@ -4639,7 +4639,7 @@ void command_guild(Client *c, const Seperator *sep) uint32 id = guild_mgr.CreateGuild(sep->argplus[3], leader); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Creating guild %s with leader %d with GM command. It was given id %lu.", c->GetName(), sep->argplus[3], leader, (unsigned long)id); if (id == GUILD_NONE) @@ -4678,7 +4678,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Deleting guild %s (%d) with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id); if (!guild_mgr.DeleteGuild(id)) @@ -4712,7 +4712,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Renaming guild %s (%d) to '%s' with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, sep->argplus[3]); if (!guild_mgr.RenameGuild(id, sep->argplus[3])) @@ -4763,7 +4763,7 @@ void command_guild(Client *c, const Seperator *sep) } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), + Log.Out(Logs::Detail, Logs::Guilds, "%s: Setting leader of guild %s (%d) to %d with GM command.", c->GetName(), guild_mgr.GetGuildName(id), id, leader); if(!guild_mgr.SetGuildLeader(id, leader)) @@ -4869,7 +4869,7 @@ void command_manaburn(Client *c, const Seperator *sep) target->Damage(c, nukedmg, 2751, SkillAbjuration/*hackish*/); c->Message(4,"You unleash an enormous blast of magical energies."); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); + Log.Out(Logs::General, Logs::Normal, "Manaburn request from %s, damage: %d", c->GetName(), nukedmg); } } else @@ -5221,7 +5221,7 @@ void command_scribespells(Client *c, const Seperator *sep) t->Message(0, "Scribing spells to spellbook."); if(t != c) c->Message(0, "Scribing spells for %s.", t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.Out(Logs::General, Logs::Normal, "Scribe spells request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, book_slot = t->GetNextAvailableSpellBookSlot(), count = 0; curspell < SPDAT_RECORDS && book_slot < MAX_PP_SPELLBOOK; curspell++, book_slot = t->GetNextAvailableSpellBookSlot(book_slot)) { @@ -5278,7 +5278,7 @@ void command_scribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Scribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.Out(Logs::General, Logs::Normal, "Scribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); if (spells[spell_id].classes[WARRIOR] != 0 && spells[spell_id].skill != 52 && spells[spell_id].classes[t->GetPP().class_ - 1] > 0 && !IsDiscipline(spell_id)) { book_slot = t->GetNextAvailableSpellBookSlot(); @@ -5325,7 +5325,7 @@ void command_unscribespell(Client *c, const Seperator *sep) { if(t != c) c->Message(0, "Unscribing spell: %s (%i) for %s.", spells[spell_id].name, spell_id, t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); + Log.Out(Logs::General, Logs::Normal, "Unscribe spell: %s (%i) request for %s from %s.", spells[spell_id].name, spell_id, t->GetName(), c->GetName()); } else { t->Message(13, "Unable to unscribe spell: %s (%i) from your spellbook. This spell is not scribed.", spells[spell_id].name, spell_id); @@ -7862,7 +7862,7 @@ void command_traindisc(Client *c, const Seperator *sep) t->Message(0, "Training disciplines"); if(t != c) c->Message(0, "Training disciplines for %s.", t->GetName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); + Log.Out(Logs::General, Logs::Normal, "Train disciplines request for %s from %s, levels: %u -> %u", t->GetName(), c->GetName(), min_level, max_level); for(curspell = 0, count = 0; curspell < SPDAT_RECORDS; curspell++) { @@ -10394,7 +10394,7 @@ void command_logtest(Client *c, const Seperator *sep){ if (sep->IsNumber(1)){ uint32 i = 0; for (i = 0; i < atoi(sep->arg[1]); i++){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.Out(Logs::General, Logs::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } } \ No newline at end of file diff --git a/zone/corpse.cpp b/zone/corpse.cpp index a3e116ae2..81d77651f 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -842,7 +842,7 @@ bool Corpse::Process() { spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); + Log.Out(Logs::General, Logs::None, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); corpse_db_id = 0; } @@ -872,10 +872,10 @@ bool Corpse::Process() { Save(); player_corpse_depop = true; corpse_db_id = 0; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Tagged %s player corpse has burried.", this->GetName()); + Log.Out(Logs::General, Logs::None, "Tagged %s player corpse has burried.", this->GetName()); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to bury %s player corpse.", this->GetName()); + Log.Out(Logs::General, Logs::Error, "Unable to bury %s player corpse.", this->GetName()); return true; } } @@ -1083,7 +1083,7 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); + Log.Out(Logs::General, Logs::None, "Corpse Looting: %s was not sent to client loot window (corpse_dbid: %i, charname: %s(%s))", item->Name, GetCorpseDBID(), client->GetName(), client->GetGM() ? "GM" : "Owner"); client->Message(0, "Inaccessable Corpse Item: %s", item->Name); } } diff --git a/zone/doors.cpp b/zone/doors.cpp index de2feed63..227c8c7af 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -145,9 +145,9 @@ bool Doors::Process() void Doors::HandleClick(Client* sender, uint8 trigger) { //door debugging info dump - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); + Log.Out(Logs::Detail, Logs::Doors, "%s clicked door %s (dbid %d, eqid %d) at (%.4f,%.4f,%.4f @%.4f)", sender->GetName(), door_name, db_id, door_id, pos_x, pos_y, pos_z, heading); + Log.Out(Logs::Detail, Logs::Doors, " incline %d, opentype %d, lockpick %d, key %d, nokeyring %d, trigger %d type %d, param %d", incline, opentype, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param); + Log.Out(Logs::Detail, Logs::Doors, " size %d, invert %d, dest: %s (%.4f,%.4f,%.4f @%.4f)", size, invert_state, dest_zone, dest_x, dest_y, dest_z, dest_heading); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoveDoor, sizeof(MoveDoor_Struct)); MoveDoor_Struct* md = (MoveDoor_Struct*)outapp->pBuffer; @@ -303,7 +303,7 @@ void Doors::HandleClick(Client* sender, uint8 trigger) sender->CheckIncreaseSkill(SkillPickLock, nullptr, 1); #if EQDEBUG>=5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Client has lockpicks: skill=%f", modskill); + Log.Out(Logs::General, Logs::None, "Client has lockpicks: skill=%f", modskill); #endif if(GetLockpick() <= modskill) @@ -560,13 +560,13 @@ void Doors::ToggleState(Mob *sender) } void Doors::DumpDoor(){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, + Log.Out(Logs::General, Logs::None, "db_id:%i door_id:%i zone_name:%s door_name:%s pos_x:%f pos_y:%f pos_z:%f heading:%f", db_id, door_id, zone_name, door_name, pos_x, pos_y, pos_z, heading); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, + Log.Out(Logs::General, Logs::None, "opentype:%i guild_id:%i lockpick:%i keyitem:%i nokeyring:%i trigger_door:%i trigger_type:%i door_param:%i open:%s", opentype, guild_id, lockpick, keyitem, nokeyring, trigger_door, trigger_type, door_param, (isopen) ? "open":"closed"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, + Log.Out(Logs::General, Logs::None, "dest_zone:%s dest_x:%f dest_y:%f dest_z:%f dest_heading:%f", dest_zone, dest_x, dest_y, dest_z, dest_heading); } @@ -645,7 +645,7 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) } bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name, int16 version) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Doors from database..."); + Log.Out(Logs::General, Logs::Status, "Loading Doors from database..."); // Door tmpDoor; diff --git a/zone/effects.cpp b/zone/effects.cpp index 5671460ec..8ec921ae3 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -461,7 +461,7 @@ bool Client::TrainDiscipline(uint32 itemid) { const Item_Struct *item = database.GetItem(itemid); if(item == nullptr) { Message(13, "Unable to find the tome you turned in!"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); + Log.Out(Logs::General, Logs::Error, "Unable to find turned in tome id %lu\n", (unsigned long)itemid); return(false); } diff --git a/zone/embparser.cpp b/zone/embparser.cpp index 7692151c2..e18dcfd39 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -140,7 +140,7 @@ void PerlembParser::ReloadQuests() { perl = nullptr; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Error re-initializing perlembed: %s", e.what()); + Log.Out(Logs::General, Logs::Status, "Error re-initializing perlembed: %s", e.what()); throw e.what(); } diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 35856db8b..99698fe72 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -3519,7 +3519,7 @@ EXTERN_C XS(boot_quest) file[255] = '\0'; if(items != 1) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_quest does not take any arguments."); + Log.Out(Logs::General, Logs::Error, "boot_quest does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 0a33a2d4a..167e92711 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -140,12 +140,12 @@ void Embperl::DoInit() { catch(const char *err) { //remember... lasterr() is no good if we crap out here, in construction - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "perl error: %s", err); + Log.Out(Logs::General, Logs::Quests, "perl error: %s", err); throw "failed to install eval_file hook"; } #ifdef EMBPERL_IO_CAPTURE - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Tying perl output to eqemu logs"); + Log.Out(Logs::General, Logs::Quests, "Tying perl output to eqemu logs"); //make a tieable class to capture IO and pass it into EQEMuLog eval_pv( "package EQEmuIO; " @@ -170,14 +170,14 @@ void Embperl::DoInit() { ,FALSE ); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Loading perlemb plugins."); + Log.Out(Logs::General, Logs::Quests, "Loading perlemb plugins."); try { eval_pv("main::eval_file('plugin', 'plugin.pl');", FALSE); } catch(const char *err) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Warning - plugin.pl: %s", err); + Log.Out(Logs::General, Logs::Quests, "Warning - plugin.pl: %s", err); } try { @@ -195,7 +195,7 @@ void Embperl::DoInit() { } catch(const char *err) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Perl warning: %s", err); + Log.Out(Logs::General, Logs::Quests, "Perl warning: %s", err); } #endif //EMBPERL_PLUGIN in_use = false; diff --git a/zone/embxs.cpp b/zone/embxs.cpp index e3ad58229..5e387022e 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -64,7 +64,7 @@ EXTERN_C XS(boot_qc) file[255] = '\0'; if(items != 1) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "boot_qc does not take any arguments."); + Log.Out(Logs::General, Logs::Error, "boot_qc does not take any arguments."); char buf[128]; //shouldent have any function names longer than this. @@ -100,7 +100,7 @@ XS(XS_EQEmuIO_PRINT) int len = 0; for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.Out(Logs::Detail, Logs::Quests, str); len = 0; pos = i+1; } else { @@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Quests, str); + Log.Out(Logs::Detail, Logs::Quests, str); } } diff --git a/zone/entity.cpp b/zone/entity.cpp index 86d2423e4..8fb5e541c 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -371,7 +371,7 @@ void EntityList::CheckGroupList (const char *fname, const int fline) { if (*it == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr group, %s:%i", fname, fline); + Log.Out(Logs::General, Logs::Error, "nullptr group, %s:%i", fname, fline); } } } @@ -520,12 +520,12 @@ void EntityList::MobProcess() zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); if(g) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a group."); + Log.Out(Logs::General, Logs::Error, "About to delete a client still in a group."); g->DelMember(mob); } Raid *r = entity_list.GetRaidByClient(mob->CastToClient()); if(r) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "About to delete a client still in a raid."); + Log.Out(Logs::General, Logs::Error, "About to delete a client still in a raid."); r->MemberZoned(mob->CastToClient()); } entity_list.RemoveClient(id); @@ -557,7 +557,7 @@ void EntityList::AddGroup(Group *group) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.Out(Logs::General, Logs::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -586,7 +586,7 @@ void EntityList::AddRaid(Raid *raid) uint32 gid = worldserver.NextGroupID(); if (gid == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, + Log.Out(Logs::General, Logs::Error, "Unable to get new group ID from world server. group is going to be broken."); return; } @@ -2509,7 +2509,7 @@ char *EntityList::MakeNameUnique(char *name) return name; } } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); + Log.Out(Logs::General, Logs::Error, "Fatal error in EntityList::MakeNameUnique: Unable to find unique name for '%s'", name); char tmp[64] = "!"; strn0cpy(&tmp[1], name, sizeof(tmp) - 1); strcpy(name, tmp); @@ -3397,7 +3397,7 @@ void EntityList::ReloadAllClientsTaskState(int TaskID) // If we have been passed a TaskID, only reload the client state if they have // that Task active. if ((!TaskID) || (TaskID && client->IsTaskActive(TaskID))) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] Reloading Task State For Client %s", client->GetName()); client->RemoveClientTaskState(); client->LoadClientTaskState(); taskmanager->SendActiveTasksToClient(client); diff --git a/zone/exp.cpp b/zone/exp.cpp index 66cb7855b..53f015b8a 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -240,7 +240,7 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { } void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); + Log.Out(Logs::Detail, Logs::None, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -308,7 +308,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { //figure out how many AA points we get from the exp were setting m_pp.aapoints = set_aaxp / max_AAXP; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); + Log.Out(Logs::Detail, Logs::None, "Calculating additional AA Points from AAXP for %s: %u / %u = %.1f points", this->GetCleanName(), set_aaxp, max_AAXP, (float)set_aaxp / (float)max_AAXP); //get remainder exp points, set in PP below set_aaxp = set_aaxp - (max_AAXP * m_pp.aapoints); @@ -430,7 +430,7 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetLevel(uint8 set_level, bool command) { if (GetEXPForLevel(set_level) == 0xFFFFFFFF) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); + Log.Out(Logs::General, Logs::Error, "Client::SetLevel() GetEXPForLevel(%i) = 0xFFFFFFFF", set_level); return; } @@ -488,7 +488,7 @@ void Client::SetLevel(uint8 set_level, bool command) safe_delete(outapp); this->SendAppearancePacket(AT_WhoLevel, set_level); // who level change - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Setting Level for %s to %i", GetName(), set_level); + Log.Out(Logs::General, Logs::Normal, "Setting Level for %s to %i", GetName(), set_level); CalcBonuses(); diff --git a/zone/fearpath.cpp b/zone/fearpath.cpp index 2729203ce..f531941be 100644 --- a/zone/fearpath.cpp +++ b/zone/fearpath.cpp @@ -167,11 +167,11 @@ void Mob::CalculateNewFearpoint() fear_walkto_z = Loc.z; curfp = true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); + Log.Out(Logs::Detail, Logs::None, "Feared to node %i (%8.3f, %8.3f, %8.3f)", Node, Loc.x, Loc.y, Loc.z); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No path found to selected node. Falling through to old fear point selection."); + Log.Out(Logs::Detail, Logs::None, "No path found to selected node. Falling through to old fear point selection."); } int loop = 0; diff --git a/zone/forage.cpp b/zone/forage.cpp index bb4e6643e..427f28b10 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -70,7 +70,7 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { item[index] = atoi(row[0]); chance[index] = atoi(row[1]) + chancepool; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); + Log.Out(Logs::General, Logs::Error, "Possible Forage: %d with a %d chance", item[index], chance[index]); chancepool = chance[index]; } @@ -389,7 +389,7 @@ void Client::ForageItem(bool guarantee) { const Item_Struct* food_item = database.GetItem(foragedfood); if(!food_item) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "nullptr returned from database.GetItem in ClientForageItem"); + Log.Out(Logs::General, Logs::Error, "nullptr returned from database.GetItem in ClientForageItem"); return; } diff --git a/zone/groups.cpp b/zone/groups.cpp index 6e146f104..d1a310c92 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -768,7 +768,7 @@ void Group::CastGroupSpell(Mob* caster, uint16 spell_id) { caster->SpellOnTarget(spell_id, members[z]->GetPet()); #endif } else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Group spell: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } @@ -807,7 +807,7 @@ void Group::GroupBardPulse(Mob* caster, uint16 spell_id) { members[z]->GetPet()->BardPulse(spell_id, caster); #endif } else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z]->GetName(), range, distance, caster->GetName()); } } } @@ -1069,7 +1069,7 @@ bool Group::LearnMembers() { return false; if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting group members for group %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return false; } @@ -1098,7 +1098,7 @@ void Group::VerifyGroup() { for (i = 0; i < MAX_GROUP_MEMBERS; i++) { if (membername[i][0] == '\0') { #if EQDEBUG >= 7 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); + Log.Out(Logs::General, Logs::None, "Group %lu: Verify %d: Empty.\n", (unsigned long)GetID(), i); #endif members[i] = nullptr; continue; @@ -1107,7 +1107,7 @@ void Group::VerifyGroup() { Mob *them = entity_list.GetMob(membername[i]); if(them == nullptr && members[i] != nullptr) { //they aren't in zone #if EQDEBUG >= 6 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); + Log.Out(Logs::General, Logs::None, "Member of group %lu named '%s' has disappeared!!", (unsigned long)GetID(), membername[i]); #endif membername[i][0] = '\0'; members[i] = nullptr; @@ -1116,13 +1116,13 @@ void Group::VerifyGroup() { if(them != nullptr && members[i] != them) { //our pointer is out of date... not so good. #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); + Log.Out(Logs::General, Logs::None, "Member of group %lu named '%s' had an out of date pointer!!", (unsigned long)GetID(), membername[i]); #endif members[i] = them; continue; } #if EQDEBUG >= 8 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); + Log.Out(Logs::General, Logs::None, "Member of group %lu named '%s' is valid.", (unsigned long)GetID(), membername[i]); #endif } } @@ -1457,7 +1457,7 @@ void Group::DelegateMainTank(const char *NewMainTankName, uint8 toggle) MainTankName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to set group main tank: %s\n", results.ErrorMessage().c_str()); } } @@ -1503,7 +1503,7 @@ void Group::DelegateMainAssist(const char *NewMainAssistName, uint8 toggle) MainAssistName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to set group main assist: %s\n", results.ErrorMessage().c_str()); } } @@ -1550,7 +1550,7 @@ void Group::DelegatePuller(const char *NewPullerName, uint8 toggle) PullerName.c_str(), GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to set group main puller: %s\n", results.ErrorMessage().c_str()); } @@ -1701,7 +1701,7 @@ void Group::UnDelegateMainTank(const char *OldMainTankName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET maintank = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to clear group main tank: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1750,7 +1750,7 @@ void Group::UnDelegateMainAssist(const char *OldMainAssistName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET assist = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to clear group main assist: %s\n", results.ErrorMessage().c_str()); if(!toggle) { @@ -1778,7 +1778,7 @@ void Group::UnDelegatePuller(const char *OldPullerName, uint8 toggle) std::string query = StringFormat("UPDATE group_leaders SET puller = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to clear group main puller: %s\n", results.ErrorMessage().c_str()); if(!toggle) { for(uint32 i = 0; i < MAX_GROUP_MEMBERS; ++i) { @@ -1861,7 +1861,7 @@ void Group::SetGroupMentor(int percent, char *name) mentoree_name.c_str(), mentor_percent, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to set group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::ClearGroupMentor() @@ -1872,7 +1872,7 @@ void Group::ClearGroupMentor() std::string query = StringFormat("UPDATE group_leaders SET mentoree = '', mentor_percent = 0 WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to clear group mentor: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyAssistTarget(Client *c) @@ -1942,7 +1942,7 @@ void Group::DelegateMarkNPC(const char *NewNPCMarkerName) NewNPCMarkerName, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to set group mark npc: %s\n", results.ErrorMessage().c_str()); } void Group::NotifyMarkNPC(Client *c) @@ -2023,7 +2023,7 @@ void Group::UnDelegateMarkNPC(const char *OldNPCMarkerName) std::string query = StringFormat("UPDATE group_leaders SET marknpc = '' WHERE gid = %i LIMIT 1", GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to clear group marknpc: %s\n", results.ErrorMessage().c_str()); } @@ -2040,7 +2040,7 @@ void Group::SaveGroupLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } diff --git a/zone/guild.cpp b/zone/guild.cpp index e1ce7b654..271d835a0 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -56,7 +56,7 @@ void Client::SendGuildMOTD(bool GetGuildMOTDReply) { } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); + Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildMOTD of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -144,10 +144,10 @@ void Client::SendGuildSpawnAppearance() { if (!IsInAGuild()) { // clear guildtag SendAppearancePacket(AT_GuildID, GUILD_NONE); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for no guild tag."); + Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for no guild tag."); } else { uint8 rank = guild_mgr.GetDisplayedRank(GuildID(), GuildRank(), CharacterID()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); + Log.Out(Logs::Detail, Logs::Guilds, "Sending spawn appearance for guild %d at rank %d", GuildID(), rank); SendAppearancePacket(AT_GuildID, GuildID()); if(GetClientVersion() >= EQClientRoF) { @@ -171,11 +171,11 @@ void Client::SendGuildList() { //ask the guild manager to build us a nice guild list packet outapp->pBuffer = guild_mgr.MakeGuildList(/*GetName()*/"", outapp->size); if(outapp->pBuffer == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to make guild list!"); + Log.Out(Logs::Detail, Logs::Guilds, "Unable to make guild list!"); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); + Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_ZoneGuildList of length %d", outapp->size); FastQueuePacket(&outapp); } @@ -192,7 +192,7 @@ void Client::SendGuildMembers() { outapp->pBuffer = data; data = nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); + Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildMemberList of length %d", outapp->size); FastQueuePacket(&outapp); @@ -223,7 +223,7 @@ void Client::RefreshGuildInfo() CharGuildInfo info; if(!guild_mgr.GetCharInfo(CharacterID(), info)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); + Log.Out(Logs::Detail, Logs::Guilds, "Unable to obtain guild char info for %s (%d)", GetName(), CharacterID()); return; } @@ -335,7 +335,7 @@ void Client::SendGuildJoin(GuildJoin_Struct* gj){ outgj->rank = gj->rank; outgj->zoneid = gj->zoneid; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); + Log.Out(Logs::Detail, Logs::Guilds, "Sending OP_GuildManageAdd for join of length %d", outapp->size); FastQueuePacket(&outapp); @@ -409,7 +409,7 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -429,7 +429,7 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 76f2e3f8a..0df3fe929 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -32,7 +32,7 @@ extern WorldServer worldserver; extern volatile bool ZoneLoaded; void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, bool rank, bool relation) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); + Log.Out(Logs::Detail, Logs::Guilds, "Sending guild refresh for %d to world, changes: name=%d, motd=%d, rank=d, relation=%d", guild_id, name, motd, rank, relation); ServerPacket* pack = new ServerPacket(ServerOP_RefreshGuild, sizeof(ServerGuildRefresh_Struct)); ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -46,7 +46,7 @@ void ZoneGuildManager::SendGuildRefresh(uint32 guild_id, bool name, bool motd, b void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uint32 charid) { if(guild_id == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Guild lookup for char %d when sending char refresh.", charid); + Log.Out(Logs::Detail, Logs::Guilds, "Guild lookup for char %d when sending char refresh.", charid); CharGuildInfo gci; if(!GetCharInfo(charid, gci)) { @@ -56,7 +56,7 @@ void ZoneGuildManager::SendCharRefresh(uint32 old_guild_id, uint32 guild_id, uin } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Sending char refresh for %d from guild %d to world", charid, guild_id); ServerPacket* pack = new ServerPacket(ServerOP_GuildCharRefresh, sizeof(ServerGuildCharRefresh_Struct)); ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; @@ -89,7 +89,7 @@ void ZoneGuildManager::SendRankUpdate(uint32 CharID) } void ZoneGuildManager::SendGuildDelete(uint32 guild_id) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Sending guild delete for guild %d to world", guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Sending guild delete for guild %d to world", guild_id); ServerPacket* pack = new ServerPacket(ServerOP_DeleteGuild, sizeof(ServerGuildID_Struct)); ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; s->guild_id = guild_id; @@ -261,12 +261,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { switch(pack->opcode) { case ServerOP_RefreshGuild: { if(pack->size != sizeof(ServerGuildRefresh_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); + Log.Out(Logs::General, Logs::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRefresh_Struct)); return; } ServerGuildRefresh_Struct *s = (ServerGuildRefresh_Struct *) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); + Log.Out(Logs::Detail, Logs::Guilds, "Received guild refresh from world for %d, changes: name=%d, motd=%d, rank=%d, relation=%d", s->guild_id, s->name_change, s->motd_change, s->rank_change, s->relation_change); //reload all the guild details from the database. RefreshGuild(s->guild_id); @@ -295,12 +295,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_GuildCharRefresh: { if(pack->size != sizeof(ServerGuildCharRefresh_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); + Log.Out(Logs::General, Logs::Error, "Received ServerOP_RefreshGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildCharRefresh_Struct)); return; } ServerGuildCharRefresh_Struct *s = (ServerGuildCharRefresh_Struct *) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Received guild member refresh from world for char %d from guild %d", s->char_id, s->guild_id); Client *c = entity_list.GetClientByCharID(s->char_id); @@ -338,7 +338,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { { if(pack->size != sizeof(ServerGuildRankUpdate_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", + Log.Out(Logs::General, Logs::Error, "Received ServerOP_RankUpdate of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildRankUpdate_Struct)); return; @@ -364,12 +364,12 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { case ServerOP_DeleteGuild: { if(pack->size != sizeof(ServerGuildID_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); + Log.Out(Logs::General, Logs::Error, "Received ServerOP_DeleteGuild of incorrect size %d, expected %d", pack->size, sizeof(ServerGuildID_Struct)); return; } ServerGuildID_Struct *s = (ServerGuildID_Struct *) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds, "Received guild delete from world for guild %d", s->guild_id); + Log.Out(Logs::Detail, Logs::Guilds, "Received guild delete from world for guild %d", s->guild_id); //clear all the guild tags. entity_list.RefreshAllGuildInfo(s->guild_id); @@ -417,10 +417,10 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { if (!c || !c->IsInAGuild()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Invalid Client or not in guild. ID=%i", FromID); + Log.Out(Logs::Detail, Logs::Guilds,"Invalid Client or not in guild. ID=%i", FromID); break; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); + Log.Out(Logs::Detail, Logs::Guilds,"Processing ServerOP_OnlineGuildMembersResponse"); EQApplicationPacket *outapp = new EQApplicationPacket(OP_GuildMemberUpdate, sizeof(GuildMemberUpdate_Struct)); GuildMemberUpdate_Struct *gmus = (GuildMemberUpdate_Struct*)outapp->pBuffer; char Name[64]; @@ -433,7 +433,7 @@ void ZoneGuildManager::ProcessWorldPacket(ServerPacket *pack) { VARSTRUCT_DECODE_STRING(Name, Buffer); strn0cpy(gmus->MemberName, Name, sizeof(gmus->MemberName)); gmus->ZoneID = VARSTRUCT_DECODE_TYPE(uint32, Buffer); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); + Log.Out(Logs::Detail, Logs::Guilds,"Sending OP_GuildMemberUpdate to %i. Name=%s ZoneID=%i",FromID,Name,gmus->ZoneID); c->QueuePacket(outapp); } safe_delete(outapp); @@ -603,7 +603,7 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -684,7 +684,7 @@ void GuildBankManager::SendGuildBank(Client *c) if(Iterator == Banks.end()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); + Log.Out(Logs::General, Logs::Error, "Unable to find guild bank for guild ID %i", c->GuildID()); return; } @@ -800,7 +800,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Iterator == Banks.end()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find guild bank for guild ID %i", GuildID); + Log.Out(Logs::General, Logs::Error, "Unable to find guild bank for guild ID %i", GuildID); return false; } @@ -846,7 +846,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 if(Slot < 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No space to add item to the guild bank."); + Log.Out(Logs::General, Logs::Error, "No space to add item to the guild bank."); return false; } @@ -857,7 +857,7 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -922,7 +922,7 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } @@ -974,7 +974,7 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1124,7 +1124,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1136,7 +1136,7 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1299,7 +1299,7 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/horse.cpp b/zone/horse.cpp index e5241f528..cfc0174d2 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,12 +73,12 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "No Database entry for mount: %s, check the horses table", fileName); + Log.Out(Logs::General, Logs::Error, "No Database entry for mount: %s, check the horses table", fileName); return nullptr; } @@ -121,7 +121,7 @@ void Client::SummonHorse(uint16 spell_id) { return; } if(!Horse::IsHorseSpell(spell_id)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); + Log.Out(Logs::General, Logs::Error, "%s tried to summon an unknown horse, spell id %d", GetName(), spell_id); return; } diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 71a9da32a..d498e22f9 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -200,7 +200,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // make sure the item exists if(item == nullptr) { Message(13, "Item %u does not exist.", item_id); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item_id, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -215,7 +215,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check to make sure we are augmenting an augmentable item else if (((item->ItemClass != ItemClassCommon) || (item->AugType > 0)) && (aug1 | aug2 | aug3 | aug4 | aug5 | aug6)) { Message(13, "You can not augment an augment or a non-common class item."); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an augment or a non-common class item.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug5: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -229,7 +229,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(item->MinStatus && ((this->Admin() < item->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this item."); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create a GM-only item with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u, MinStatus: %u)\n", GetName(), account_name, this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -252,7 +252,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(augtest == nullptr) { if(augments[iter]) { Message(13, "Augment %u (Aug%i) does not exist.", augments[iter], iter + 1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an augment (Aug%i) with an invalid id.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -269,7 +269,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check that augment is an actual augment else if(augtest->AugType == 0) { Message(13, "%s (%u) (Aug%i) is not an actual augment.", augtest->Name, augtest->ID, iter + 1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to use a non-augment item (Aug%i) as an augment.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, (iter + 1), aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -281,7 +281,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, /* else if(augtest->MinStatus && ((this->Admin() < augtest->MinStatus) || (this->Admin() < RuleI(GM, MinStatusToSummonItem)))) { Message(13, "You are not a GM or do not have the status to summon this augment."); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create a GM-only augment (Aug%i) with a status of %i.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, MinStatus: %u)\n", GetName(), account_name, (iter + 1), this->Admin(), item->ID, aug1, aug2, aug3, aug4, aug5, aug6, item->MinStatus); return false; @@ -292,7 +292,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(enforcewear) { if((item->AugSlotType[iter] == AugTypeNone) || !(((uint32)1 << (item->AugSlotType[iter] - 1)) & augtest->AugType)) { Message(13, "Augment %u (Aug%i) is not acceptable wear on Item %u.", augments[iter], iter + 1, item->ID); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an item with an unacceptable augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -300,7 +300,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(item->AugSlotVisible[iter] == 0) { Message(13, "Item %u has not evolved enough to accept Augment %u (Aug%i).", item->ID, augments[iter], iter + 1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an unevolved item with augment type (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -477,7 +477,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(restrictfail) { Message(13, "Augment %u (Aug%i) is restricted from wear on Item %u.", augments[iter], (iter + 1), item->ID); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to augment an item with a restricted augment (Aug%i).\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, (iter + 1), item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -488,7 +488,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for class usability if(item->Classes && !(classes &= augtest->Classes)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any class.", augments[iter], (iter + 1)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item unusable by any class.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -497,7 +497,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for race usability if(item->Races && !(races &= augtest->Races)) { Message(13, "Augment %u (Aug%i) will result in an item not usable by any race.", augments[iter], (iter + 1)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item unusable by any race.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -506,7 +506,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, // check for slot usability if(item->Slots && !(slots &= augtest->Slots)) { Message(13, "Augment %u (Aug%i) will result in an item not usable in any slot.", augments[iter], (iter + 1)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to create an item unusable in any slot.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -533,7 +533,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(inst == nullptr) { Message(13, "An unknown server error has occurred and your item was not created."); // this goes to logfile since this is a major error - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::General, Logs::Error, "Player %s on account %s encountered an unknown item creation error.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); return false; @@ -559,7 +559,7 @@ bool Client::SummonItem(uint32 item_id, int16 charges, uint32 aug1, uint32 aug2, if(!(slots & ((uint32)1 << slottest))) { Message(0, "This item is not equipable at slot %u - moving to cursor.", to_slot); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", + Log.Out(Logs::Detail, Logs::Inventory, "Player %s on account %s attempted to equip an item unusable in slot %u - moved to cursor.\n(Item: %u, Aug1: %u, Aug2: %u, Aug3: %u, Aug4: %u, Aug5: %u, Aug6: %u)\n", GetName(), account_name, to_slot, item->ID, aug1, aug2, aug3, aug4, aug5, aug6); to_slot = MainCursor; @@ -700,7 +700,7 @@ void Client::SendCursorBuffer() { // Remove item from inventory void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_update, bool update_db) { #if (EQDEBUG >= 5) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); + Log.Out(Logs::General, Logs::None, "DeleteItemInInventory(%i, %i, %s)", slot_id, quantity, (client_update) ? "true":"false"); #endif // Added 'IsSlotValid(slot_id)' check to both segments of client packet processing. @@ -815,7 +815,7 @@ void Client::DeleteItemInInventory(int16 slot_id, int8 quantity, bool client_upd bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); + Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) on the cursor", inst.GetItem()->Name, inst.GetItem()->ID); m_inv.PushCursor(inst); if (client_update) { @@ -831,7 +831,7 @@ bool Client::PushItemOnCursor(const ItemInst& inst, bool client_update) // (Also saves changes back to the database: this may be optimized in the future) // client_update: Sends packet to client bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client_update) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Putting item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); if (slot_id == MainCursor) return PushItemOnCursor(inst, client_update); @@ -858,7 +858,7 @@ bool Client::PutItemInInventory(int16 slot_id, const ItemInst& inst, bool client void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootItem_Struct** bag_item_data) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Putting loot item %s (%d) into slot %d", inst.GetItem()->Name, inst.GetItem()->ID, slot_id); m_inv.PutItem(slot_id, inst); SendLootItemInPacket(&inst, slot_id); @@ -879,7 +879,7 @@ void Client::PutLootInInventory(int16 slot_id, const ItemInst &inst, ServerLootI continue; const ItemInst *bagitem = database.CreateItem(bag_item_data[i]->item_id, bag_item_data[i]->charges, bag_item_data[i]->aug_1, bag_item_data[i]->aug_2, bag_item_data[i]->aug_3, bag_item_data[i]->aug_4, bag_item_data[i]->aug_5, bag_item_data[i]->aug_6, bag_item_data[i]->attuned); interior_slot = Inventory::CalcSlotId(slot_id, i); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); + Log.Out(Logs::Detail, Logs::Inventory, "Putting bag loot item %s (%d) into slot %d (bag slot %d)", inst.GetItem()->Name, inst.GetItem()->ID, interior_slot, i); PutLootInInventory(interior_slot, *bagitem); safe_delete(bagitem); } @@ -1313,7 +1313,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.Out(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1321,7 +1321,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // SoF+ sends a Unix timestamp (should be int32) for src and dst slots every 10 minutes for some reason. if(src_slot_check < 2147483647) Message(13, "Warning: Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); + Log.Out(Logs::Detail, Logs::Inventory, "Invalid slot move from slot %u to slot %u with %u charges!", src_slot_check, dst_slot_check, stack_count_check); return false; } @@ -1334,7 +1334,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->to_slot == (uint32)INVALID_INDEX) { if (move_in->from_slot == (uint32)MainCursor) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); + Log.Out(Logs::Detail, Logs::Inventory, "Client destroyed item from cursor slot %d", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit ItemInst *inst = m_inv.GetItem(MainCursor); @@ -1348,7 +1348,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return true; // Item destroyed by client } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); + Log.Out(Logs::Detail, Logs::Inventory, "Deleted item from slot %d as a result of an inventory container tradeskill combine.", move_in->from_slot); if(RuleB(QueryServ, PlayerLogMoves)) { QSSwapItemAuditor(move_in); } // QS Audit DeleteItemInInventory(move_in->from_slot); return true; // Item deletion @@ -1388,7 +1388,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { ItemInst* src_inst = m_inv.GetItem(src_slot_id); ItemInst* dst_inst = m_inv.GetItem(dst_slot_id); if (src_inst){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); + Log.Out(Logs::Detail, Logs::Inventory, "Src slot %d has item %s (%d) with %d charges in it.", src_slot_id, src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_inst->GetCharges()); srcitemid = src_inst->GetItem()->ID; //SetTint(dst_slot_id,src_inst->GetColor()); if (src_inst->GetCharges() > 0 && (src_inst->GetCharges() < (int16)move_in->number_in_stack || move_in->number_in_stack > src_inst->GetItem()->StackSize)) @@ -1398,7 +1398,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } } if (dst_inst) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); + Log.Out(Logs::Detail, Logs::Inventory, "Dest slot %d has item %s (%d) with %d charges in it.", dst_slot_id, dst_inst->GetItem()->Name, dst_inst->GetItem()->ID, dst_inst->GetCharges()); dstitemid = dst_inst->GetItem()->ID; } if (Trader && srcitemid>0){ @@ -1435,7 +1435,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { move_in->from_slot = dst_slot_check; move_in->to_slot = src_slot_check; move_in->number_in_stack = dst_inst->GetCharges(); - if(!SwapItem(move_in)) { Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } + if(!SwapItem(move_in)) { Log.Out(Logs::Detail, Logs::Inventory, "Recursive SwapItem call failed due to non-existent destination item (charid: %i, fromslot: %i, toslot: %i)", CharacterID(), src_slot_id, dst_slot_id); } } return false; @@ -1443,7 +1443,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { //verify shared bank transactions in the database if(src_inst && src_slot_id >= EmuConstants::SHARED_BANK_BEGIN && src_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, src_slot_id, src_inst)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); + Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploiting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(dst_slot_id,0,true); return(false); } @@ -1458,7 +1458,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { } if(dst_inst && dst_slot_id >= EmuConstants::SHARED_BANK_BEGIN && dst_slot_id <= EmuConstants::SHARED_BANK_BAGS_END) { if(!database.VerifyInventory(account_id, dst_slot_id, dst_inst)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); + Log.Out(Logs::General, Logs::Error, "Player %s on account %s was found exploting the shared bank.\n", GetName(), account_name); DeleteItemInInventory(src_slot_id,0,true); return(false); } @@ -1577,7 +1577,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { return false; } if (with) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); + Log.Out(Logs::Detail, Logs::Inventory, "Trade item move from slot %d to slot %d (trade with %s)", src_slot_id, dst_slot_id, with->GetName()); // Fill Trade list with items from cursor if (!m_inv[MainCursor]) { Message(13, "Error: Cursor item not located on server!"); @@ -1610,18 +1610,18 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if (move_in->number_in_stack > 0) { // Determine if charged items can stack if(src_inst && !src_inst->IsStackable()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); + Log.Out(Logs::Detail, Logs::Inventory, "Move from %d to %d with stack size %d. %s is not a stackable item. (charname: %s)", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetItem()->Name, GetName()); return false; } if (dst_inst) { if(src_inst->GetID() != dst_inst->GetID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); + Log.Out(Logs::Detail, Logs::Inventory, "Move from %d to %d with stack size %d. Incompatible item types: %d != %d", src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetID(), dst_inst->GetID()); return(false); } if(dst_inst->GetCharges() < dst_inst->GetItem()->StackSize) { //we have a chance of stacking. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); + Log.Out(Logs::Detail, Logs::Inventory, "Move from %d to %d with stack size %d. dest has %d/%d charges", src_slot_id, dst_slot_id, move_in->number_in_stack, dst_inst->GetCharges(), dst_inst->GetItem()->StackSize); // Charges can be emptied into dst uint16 usedcharges = dst_inst->GetItem()->StackSize - dst_inst->GetCharges(); if (usedcharges > move_in->number_in_stack) @@ -1633,15 +1633,15 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { // Depleted all charges? if (src_inst->GetCharges() < 1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); + Log.Out(Logs::Detail, Logs::Inventory, "Dest (%d) now has %d charges, source (%d) was entirely consumed. (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, usedcharges); database.SaveInventory(CharacterID(),nullptr,src_slot_id); m_inv.DeleteItem(src_slot_id); all_to_stack = true; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); + Log.Out(Logs::Detail, Logs::Inventory, "Dest (%d) now has %d charges, source (%d) has %d (%d moved)", dst_slot_id, dst_inst->GetCharges(), src_slot_id, src_inst->GetCharges(), usedcharges); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); + Log.Out(Logs::Detail, Logs::Inventory, "Move from %d to %d with stack size %d. Exceeds dest maximum stack size: %d/%d", src_slot_id, dst_slot_id, move_in->number_in_stack, (src_inst->GetCharges()+dst_inst->GetCharges()), dst_inst->GetItem()->StackSize); return false; } } @@ -1650,12 +1650,12 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { if ((int16)move_in->number_in_stack >= src_inst->GetCharges()) { // Move entire stack if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); + Log.Out(Logs::Detail, Logs::Inventory, "Move entire stack from %d to %d with stack size %d. Dest empty.", src_slot_id, dst_slot_id, move_in->number_in_stack); } else { // Split into two src_inst->SetCharges(src_inst->GetCharges() - move_in->number_in_stack); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); + Log.Out(Logs::Detail, Logs::Inventory, "Split stack of %s (%d) from slot %d to %d with stack size %d. Src keeps %d.", src_inst->GetItem()->Name, src_inst->GetItem()->ID, src_slot_id, dst_slot_id, move_in->number_in_stack, src_inst->GetCharges()); ItemInst* inst = database.CreateItem(src_inst->GetItem(), move_in->number_in_stack); m_inv.PutItem(dst_slot_id, *inst); safe_delete(inst); @@ -1680,7 +1680,7 @@ bool Client::SwapItem(MoveItem_Struct* move_in) { SetMaterial(dst_slot_id,src_inst->GetItem()->ID); } if(!m_inv.SwapItem(src_slot_id, dst_slot_id)) { return false; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Moving entire item from slot %d to slot %d", src_slot_id, dst_slot_id); if(src_slot_id <= EmuConstants::EQUIPMENT_END || src_slot_id == MainPowerSource) { if(src_inst) { @@ -1739,7 +1739,7 @@ void Client::SwapItemResync(MoveItem_Struct* move_slots) { // resync the 'from' and 'to' slots on an as-needed basis // Not as effective as the full process, but less intrusive to gameplay -U - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); + Log.Out(Logs::Detail, Logs::Inventory, "Inventory desyncronization. (charname: %s, source: %i, destination: %i)", GetName(), move_slots->from_slot, move_slots->to_slot); Message(15, "Inventory Desyncronization detected: Resending slot data..."); if((move_slots->from_slot >= EmuConstants::EQUIPMENT_BEGIN && move_slots->from_slot <= EmuConstants::CURSOR_BAG_END) || move_slots->from_slot == MainPowerSource) { @@ -2071,7 +2071,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::EQUIPMENT_BEGIN; slot_id <= EmuConstants::EQUIPMENT_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2080,7 +2080,7 @@ void Client::RemoveNoRent(bool client_update) { for (slot_id = EmuConstants::GENERAL_BEGIN; slot_id <= EmuConstants::GENERAL_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if (inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2089,7 +2089,7 @@ void Client::RemoveNoRent(bool client_update) { if (m_inv[MainPowerSource]) { const ItemInst* inst = m_inv[MainPowerSource]; if (inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); DeleteItemInInventory(MainPowerSource, 0, (GetClientVersion() >= EQClientSoF) ? client_update : false); // Ti slot non-existent } } @@ -2098,7 +2098,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::GENERAL_BAGS_BEGIN; slot_id <= EmuConstants::CURSOR_BAG_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, client_update); } } @@ -2107,7 +2107,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BEGIN; slot_id <= EmuConstants::BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank slots } } @@ -2116,7 +2116,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::BANK_BAGS_BEGIN; slot_id <= EmuConstants::BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Bank Container slots } } @@ -2125,7 +2125,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BEGIN; slot_id <= EmuConstants::SHARED_BANK_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank slots } } @@ -2134,7 +2134,7 @@ void Client::RemoveNoRent(bool client_update) { for(slot_id = EmuConstants::SHARED_BANK_BAGS_BEGIN; slot_id <= EmuConstants::SHARED_BANK_BAGS_END; slot_id++) { const ItemInst* inst = m_inv[slot_id]; if(inst && !inst->GetItem()->NoRent) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); DeleteItemInInventory(slot_id, 0, false); // Can't delete from client Shared Bank Container slots } } @@ -2155,7 +2155,7 @@ void Client::RemoveNoRent(bool client_update) { inst = *iter; // should probably put a check here for valid pointer..but, that was checked when the item was put into inventory -U if (!inst->GetItem()->NoRent) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.Out(Logs::Detail, Logs::Inventory, "NoRent Timer Lapse: Deleting %s from `Limbo`", inst->GetItem()->Name); else m_inv.PushCursor(**iter); @@ -2178,7 +2178,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2193,7 +2193,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2208,7 +2208,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(MainPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, MainPowerSource); } else { @@ -2223,7 +2223,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2238,7 +2238,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2253,7 +2253,7 @@ void Client::RemoveDuplicateLore(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); if(inst) { if(CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); database.SaveInventory(character_id, nullptr, slot_id); } else { @@ -2281,7 +2281,7 @@ void Client::RemoveDuplicateLore(bool client_update) { inst = *iter; // probably needs a valid pointer check -U if (CheckLoreConflict(inst->GetItem())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); safe_delete(*iter); iter = local.erase(iter); } @@ -2300,7 +2300,7 @@ void Client::RemoveDuplicateLore(bool client_update) { m_inv.PushCursor(**iter); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from `Limbo`", inst->GetItem()->Name); } safe_delete(*iter); @@ -2322,7 +2322,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, client_update); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2335,7 +2335,7 @@ void Client::MoveSlotNotAllowed(bool client_update) { ItemInst* inst = m_inv.PopItem(slot_id); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); database.SaveInventory(character_id, nullptr, slot_id); safe_delete(inst); @@ -2479,7 +2479,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { BandolierCreate_Struct *bs = (BandolierCreate_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s Creating Bandolier Set %i, Set Name: %s", GetName(), bs->number, bs->name); strcpy(m_pp.bandoliers[bs->number].name, bs->name); const ItemInst* InvItem = nullptr; @@ -2491,13 +2491,13 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { InvItem = GetInv()[WeaponSlot]; if(InvItem) { BaseItem = InvItem->GetItem(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s adding item %s to slot %i", GetName(),BaseItem->Name, WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = BaseItem->ID; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = BaseItem->Icon; database.SaveCharacterBandolier(this->CharacterID(), bs->number, BandolierSlot, m_pp.bandoliers[bs->number].items[BandolierSlot].item_id, m_pp.bandoliers[bs->number].items[BandolierSlot].icon, bs->name); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s no item in slot %i", GetName(), WeaponSlot); m_pp.bandoliers[bs->number].items[BandolierSlot].item_id = 0; m_pp.bandoliers[bs->number].items[BandolierSlot].icon = 0; } @@ -2506,7 +2506,7 @@ void Client::CreateBandolier(const EQApplicationPacket *app) { void Client::RemoveBandolier(const EQApplicationPacket *app) { BandolierDelete_Struct *bds = (BandolierDelete_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s removing set", GetName(), bds->number); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s removing set", GetName(), bds->number); memset(m_pp.bandoliers[bds->number].name, 0, 32); for(int i = bandolierMainHand; i <= bandolierAmmo; i++) { m_pp.bandoliers[bds->number].items[i].item_id = 0; @@ -2521,7 +2521,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // any items currently in the weapon slots to inventory. BandolierSet_Struct *bss = (BandolierSet_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s activating set %i", GetName(), bss->number); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s activating set %i", GetName(), bss->number); int16 slot; int16 WeaponSlot; ItemInst *BandolierItems[4]; // Temporary holding area for the weapons we pull out of their inventory @@ -2585,16 +2585,16 @@ void Client::SetBandolier(const EQApplicationPacket *app) { else { // The player doesn't have the required weapon with them. BandolierItems[BandolierSlot] = 0; if (slot == INVALID_INDEX) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); + Log.Out(Logs::Detail, Logs::Inventory, "Character does not have required bandolier item for slot %i", WeaponSlot); ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { // If there was an item in that weapon slot, put it in the inventory - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "returning item %s in weapon slot %i to inventory", + Log.Out(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2629,7 +2629,7 @@ void Client::SetBandolier(const EQApplicationPacket *app) { if(InvItem) { // If there was already an item in that weapon slot that we replaced, find a place to put it if(!MoveItemToInventory(InvItem)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2640,13 +2640,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // put it in the player's inventory. ItemInst *InvItem = m_inv.PopItem(WeaponSlot); if(InvItem) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", + Log.Out(Logs::Detail, Logs::Inventory, "Bandolier has no item for slot %i, returning item %s to inventory", WeaponSlot, InvItem->GetItem()->Name); // If there was an item in that weapon slot, put it in the inventory if(MoveItemToInventory(InvItem)) database.SaveInventory(character_id, 0, WeaponSlot); else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); safe_delete(InvItem); } @@ -2677,7 +2677,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { if(!ItemToReturn) return false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); + Log.Out(Logs::Detail, Logs::Inventory,"Char: %s Returning %s to inventory", GetName(), ItemToReturn->GetItem()->Name); uint32 ItemID = ItemToReturn->GetItem()->ID; @@ -2761,7 +2761,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(i), i); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s Storing in main inventory slot %i", GetName(), i); return true; } @@ -2784,7 +2784,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { database.SaveInventory(character_id, m_inv.GetItem(BaseSlotID + BagSlot), BaseSlotID + BagSlot); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s Storing in bag slot %i", GetName(), BaseSlotID + BagSlot); return true; } @@ -2794,7 +2794,7 @@ bool Client::MoveItemToInventory(ItemInst *ItemToReturn, bool UpdateClient) { // Store on the cursor // - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Inventory, "Char: %s No space, putting on the cursor", GetName()); + Log.Out(Logs::Detail, Logs::Inventory, "Char: %s No space, putting on the cursor", GetName()); PushItemOnCursor(*ItemToReturn, UpdateClient); @@ -2865,8 +2865,8 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool } if (log) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory() -- End"); + Log.Out(Logs::General, Logs::Error, "Target interrogate inventory flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory() -- End"); } if (!silent) { requester->Message(1, "Target interrogation flag: %s", (GetInterrogateInvState() ? "TRUE" : "FALSE")); @@ -2881,7 +2881,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 head, int16 index, const ItemInst* inst, const ItemInst* parent, bool log, bool silent, bool &error, int depth) { if (depth >= 10) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::InterrogateInventory_() - Recursion count has exceeded the maximum allowable (You have a REALLY BIG PROBLEM!!)"); return; } @@ -2910,7 +2910,7 @@ void Client::InterrogateInventory_(bool errorcheck, Client* requester, int16 hea else { e = ""; } if (log) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", + Log.Out(Logs::General, Logs::Error, "Head: %i, Depth: %i, Instance: %s, Parent: %s%s", head, depth, i.c_str(), p.c_str(), e.c_str()); if (!silent) requester->Message(1, "%i:%i - inst: %s - parent: %s%s", diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 96ef83c88..16f5af7b0 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -145,7 +145,7 @@ void ZoneDatabase::AddLootDropToNPC(NPC* npc,uint32 lootdrop_id, ItemList* iteml drop_chance = zone->random.Real(0.0, 100.0); #if EQDEBUG>=11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); + Log.Out(Logs::General, Logs::None, "Drop chance for npc: %s, this chance:%f, drop roll:%f", npc->GetName(), thischance, drop_chance); #endif if (thischance == 100.0 || drop_chance < thischance) { @@ -187,7 +187,7 @@ void NPC::AddLootDrop(const Item_Struct *item2, ItemList* itemlist, int16 charge ServerLootItem_Struct* item = new ServerLootItem_Struct; #if EQDEBUG>=11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); + Log.Out(Logs::General, Logs::None, "Adding drop to npc: %s, Item: %i", GetName(), item2->ID); #endif EQApplicationPacket* outapp = nullptr; diff --git a/zone/merc.cpp b/zone/merc.cpp index ee846c49e..73990f139 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -885,7 +885,7 @@ int32 Merc::CalcMaxMana() break; } default: { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); + Log.Out(Logs::General, Logs::None, "Invalid Class '%c' in CalcMaxMana", GetCasterClass()); max_mana = 0; break; } @@ -906,7 +906,7 @@ int32 Merc::CalcMaxMana() } #if EQDEBUG >= 11 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); + Log.Out(Logs::General, Logs::None, "Merc::CalcMaxMana() called for %s - returning %d", GetName(), max_mana); #endif return max_mana; } @@ -1647,7 +1647,7 @@ void Merc::AI_Process() { if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); + Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", GetTarget()->GetCleanName()); CalculateNewPosition2(GetTarget()->GetX(), GetTarget()->GetY(), GetTarget()->GetZ(), GetRunspeed()); return; } @@ -1766,7 +1766,7 @@ bool Merc::AI_EngagedCastCheck() { { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered (MERCS)."); + Log.Out(Logs::Detail, Logs::AI, "Engaged autocast check triggered (MERCS)."); int8 mercClass = GetClass(); @@ -1873,7 +1873,7 @@ bool EntityList::Merc_AICheckCloseBeneficialSpells(Merc* caster, uint8 iChance, // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Out(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -4451,7 +4451,7 @@ bool Merc::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, boo { if (!other) { SetTarget(nullptr); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); + Log.Out(Logs::General, Logs::Error, "A null Mob object was passed to Merc::Attack() for evaluation!"); return false; } @@ -5986,7 +5986,7 @@ void NPC::LoadMercTypes() { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.Out(Logs::General, Logs::Error, "Error in NPC::LoadMercTypes()"); return; } @@ -6019,7 +6019,7 @@ void NPC::LoadMercs() { if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in NPC::LoadMercTypes()"); + Log.Out(Logs::General, Logs::Error, "Error in NPC::LoadMercTypes()"); return; } diff --git a/zone/mob.cpp b/zone/mob.cpp index 8f594c80a..ab2d83152 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1576,7 +1576,7 @@ void Mob::SendIllusionPacket(uint16 in_race, uint8 in_gender, uint8 in_texture, entity_list.QueueClients(this, outapp); safe_delete(outapp); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", + Log.Out(Logs::Detail, Logs::Spells, "Illusion: Race = %i, Gender = %i, Texture = %i, HelmTexture = %i, HairColor = %i, BeardColor = %i, EyeColor1 = %i, EyeColor2 = %i, HairStyle = %i, Face = %i, DrakkinHeritage = %i, DrakkinTattoo = %i, DrakkinDetails = %i, Size = %f", race, gender, texture, helmtexture, haircolor, beardcolor, eyecolor1, eyecolor2, hairstyle, luclinface, drakkin_heritage, drakkin_tattoo, drakkin_details, size); } @@ -3043,7 +3043,7 @@ void Mob::ExecWeaponProc(const ItemInst *inst, uint16 spell_id, Mob *on) { if(!IsValidSpell(spell_id)) { // Check for a valid spell otherwise it will crash through the function if(IsClient()){ Message(0, "Invalid spell proc %u", spell_id); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Player %s, Weapon Procced invalid spell %u", this->GetName(), spell_id); } return; } @@ -4536,7 +4536,7 @@ void Mob::MeleeLifeTap(int32 damage) { if(lifetap_amt && damage > 0){ lifetap_amt = damage * lifetap_amt / 100; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Melee lifetap healing for %d damage.", damage); + Log.Out(Logs::Detail, Logs::Combat, "Melee lifetap healing for %d damage.", damage); if (lifetap_amt > 0) HealDamage(lifetap_amt); //Heal self for modified damage amount. diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index dd637525c..a77335016 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -355,7 +355,7 @@ bool EntityList::AICheckCloseBeneficialSpells(NPC* caster, uint8 iChance, float // according to Rogean, Live NPCs will just cast through walls/floors, no problem.. // // This check was put in to address an idle-mob CPU issue - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); + Log.Out(Logs::General, Logs::Error, "Error: detrimental spells requested from AICheckCloseBeneficialSpells!!"); return(false); } @@ -1404,7 +1404,7 @@ void Mob::AI_Process() { else if (AImovement_timer->Check()) { if(!IsRooted()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Pursuing %s while engaged.", target->GetName()); + Log.Out(Logs::Detail, Logs::AI, "Pursuing %s while engaged.", target->GetName()); if(!RuleB(Pathing, Aggro) || !zone->pathing) CalculateNewPosition2(target->GetX(), target->GetY(), target->GetZ(), GetRunspeed()); else @@ -1639,7 +1639,7 @@ void NPC::AI_DoMovement() { roambox_movingto_y = zone->random.Real(roambox_min_y+1,roambox_max_y-1); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", + Log.Out(Logs::Detail, Logs::AI, "Roam Box: d=%.3f (%.3f->%.3f,%.3f->%.3f): Go To (%.3f,%.3f)", roambox_distance, roambox_min_x, roambox_max_x, roambox_min_y, roambox_max_y, roambox_movingto_x, roambox_movingto_y); if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true)) { @@ -1692,11 +1692,11 @@ void NPC::AI_DoMovement() { else { movetimercompleted=false; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "We are departing waypoint %d.", cur_wp); + Log.Out(Logs::Detail, Logs::Pathing, "We are departing waypoint %d.", cur_wp); //if we were under quest control (with no grid), we are done now.. if(cur_wp == -2) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); + Log.Out(Logs::Detail, Logs::Pathing, "Non-grid quest mob has reached its quest ordered waypoint. Leaving pathing mode."); roamer = false; cur_wp = 0; } @@ -1727,7 +1727,7 @@ void NPC::AI_DoMovement() { { // currently moving if (cur_wp_x == GetX() && cur_wp_y == GetY()) { // are we there yet? then stop - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); + Log.Out(Logs::Detail, Logs::AI, "We have reached waypoint %d (%.3f,%.3f,%.3f) on grid %d", cur_wp, GetX(), GetY(), GetZ(), GetGrid()); SetWaypointPause(); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1773,7 +1773,7 @@ void NPC::AI_DoMovement() { if (movetimercompleted==true) { // time to pause has ended SetGrid( 0 - GetGrid()); // revert to AI control - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); + Log.Out(Logs::Detail, Logs::Pathing, "Quest pathing is finished. Resuming on grid %d", GetGrid()); if(GetAppearance() != eaStanding) SetAppearance(eaStanding, false); @@ -1809,7 +1809,7 @@ void NPC::AI_DoMovement() { if (!CP2Moved) { if(moved) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); + Log.Out(Logs::Detail, Logs::AI, "Reached guard point (%.3f,%.3f,%.3f)", guard_x, guard_y, guard_z); ClearFeignMemory(); moved=false; SetMoving(false); @@ -1934,7 +1934,7 @@ bool NPC::AI_EngagedCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); + Log.Out(Logs::Detail, Logs::AI, "Engaged autocast check triggered. Trying to cast healing spells then maybe offensive spells."); // try casting a heal or gate if (!AICastSpell(this, AISpellVar.engaged_beneficial_self_chance, SpellType_Heal | SpellType_Escape | SpellType_InCombatBuff)) { @@ -1957,7 +1957,7 @@ bool NPC::AI_PursueCastCheck() { if (AIautocastspell_timer->Check(false)) { AIautocastspell_timer->Disable(); //prevent the timer from going off AGAIN while we are casting. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); + Log.Out(Logs::Detail, Logs::AI, "Engaged (pursuing) autocast check triggered. Trying to cast offensive spells."); if(!AICastSpell(GetTarget(), AISpellVar.pursue_detrimental_chance, SpellType_Root | SpellType_Nuke | SpellType_Lifetap | SpellType_Snare | SpellType_DOT | SpellType_Dispel | SpellType_Mez | SpellType_Slow | SpellType_Debuff)) { //no spell cast, try again soon. AIautocastspell_timer->Start(RandomTimer(AISpellVar.pursue_no_sp_recast_min, AISpellVar.pursue_no_sp_recast_max), false); diff --git a/zone/net.cpp b/zone/net.cpp index b1a372a8c..987124ea1 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -148,28 +148,28 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading server configuration.."); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading server configuration failed."); + Log.Out(Logs::General, Logs::Error, "Loading server configuration failed."); return 1; } const ZoneConfig *Config=ZoneConfig::get(); if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); + Log.Out(Logs::Detail, Logs::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); worldserver.SetPassword(Config->SharedKey.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Connecting to MySQL..."); + Log.Out(Logs::Detail, Logs::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Cannot continue without a database connection."); + Log.Out(Logs::General, Logs::Error, "Cannot continue without a database connection."); return 1; } @@ -186,121 +186,121 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.Out(Logs::Detail, Logs::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers */ if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.Out(Logs::General, Logs::Error, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.Out(Logs::General, Logs::Error, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Could not set signal handler"); + Log.Out(Logs::General, Logs::Error, "Could not set signal handler"); return 1; } #endif const char *log_ini_file = "./log.ini"; if(!load_log_settings(log_ini_file)) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Warning: Unable to read %s", log_ini_file); + Log.Out(Logs::Detail, Logs::Zone_Server, "Warning: Unable to read %s", log_ini_file); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Log settings loaded from %s", log_ini_file); + Log.Out(Logs::Detail, Logs::Zone_Server, "Log settings loaded from %s", log_ini_file); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Mapping Incoming Opcodes"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading Variables"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading Variables"); database.LoadVariables(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading zone names"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading items"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading items"); if (!database.LoadItems()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading items FAILED!"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed. But ignoring error and going on..."); + Log.Out(Logs::General, Logs::Error, "Loading items FAILED!"); + Log.Out(Logs::General, Logs::Error, "Failed. But ignoring error and going on..."); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading npc faction lists"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading npcs faction lists FAILED!"); + Log.Out(Logs::General, Logs::Error, "Loading npcs faction lists FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading loot tables"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading loot FAILED!"); + Log.Out(Logs::General, Logs::Error, "Loading loot FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading skill caps"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading skill caps FAILED!"); + Log.Out(Logs::General, Logs::Error, "Loading skill caps FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading spells"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading base data"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading base data FAILED!"); + Log.Out(Logs::General, Logs::Error, "Loading base data FAILED!"); CheckEQEMuErrorAndPause(); return 1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading guilds"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading factions"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading factions"); database.LoadFactionData(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading titles"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading AA effects"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading tributes"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading tributes"); database.LoadTributes(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading corpse timers"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading commands"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Command loading FAILED"); + Log.Out(Logs::General, Logs::Error, "Command loading FAILED"); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "%d commands loaded", retval); + Log.Out(Logs::Detail, Logs::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(Logs::General, Logs::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "No rule set configured, using default rules"); + Log.Out(Logs::Detail, Logs::Zone_Server, "No rule set configured, using default rules"); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loaded default rule set 'default'", tmp); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(TaskSystem, EnableTaskSystem)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[INIT] Loading Tasks"); + Log.Out(Logs::General, Logs::Tasks, "[INIT] Loading Tasks"); taskmanager = new TaskManager; taskmanager->LoadTasks(); } @@ -317,11 +317,11 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Loading quests"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Loading quests"); parse->ReloadQuests(); if (!worldserver.Connect()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Worldserver Connection Failed :: worldserver.Connect()"); + Log.Out(Logs::General, Logs::Error, "Worldserver Connection Failed :: worldserver.Connect()"); } Timer InterserverTimer(INTERSERVER_TIMER); // does MySQL pings and auto-reconnect @@ -332,9 +332,9 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Entering sleep mode"); + Log.Out(Logs::Detail, Logs::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone Bootup failed :: Zone::Bootup"); + Log.Out(Logs::General, Logs::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; } @@ -343,7 +343,7 @@ int main(int argc, char** argv) { RegisterAllPatches(stream_identifier); #ifndef WIN32 - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Main thread running with thread id %d", pthread_self()); + Log.Out(Logs::Detail, Logs::None, "Main thread running with thread id %d", pthread_self()); #endif Timer quest_timers(100); @@ -365,13 +365,13 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); + Log.Out(Logs::Detail, Logs::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); // log_sys.CloseZoneLogs(); // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); if (!eqsf.Open(Config->ZonePort)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Failed to open port %d",Config->ZonePort); + Log.Out(Logs::General, Logs::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); worldserver.Disconnect(); worldwasconnected = false; @@ -385,7 +385,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqss->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); + Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqss->GetRemotePort())); stream_identifier.AddStream(eqss); //takes the stream } @@ -397,7 +397,7 @@ int main(int argc, char** argv) { //now that we know what patch they are running, start up their client object struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.Out(Logs::Detail, Logs::World_Server, "New client from %s:%d", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); Client* client = new Client(eqsi); entity_list.AddClient(client); } @@ -522,13 +522,13 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); CheckEQEMuErrorAndPause(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Proper zone shutdown complete."); + Log.Out(Logs::Detail, Logs::Zone_Server, "Proper zone shutdown complete."); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Recieved signal: %i", sig_num); + Log.Out(Logs::Detail, Logs::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -539,7 +539,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); // safe_delete(worldserver); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Shutting down..."); + Log.Out(Logs::Detail, Logs::Zone_Server, "Shutting down..."); } uint32 NetConnection::GetIP() @@ -628,7 +628,7 @@ void LoadSpells(EQEmu::MemoryMappedFile **mmf) { spells = reinterpret_cast((*mmf)->Get()); mutex.Unlock(); } catch(std::exception &ex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading spells: %s", ex.what()); + Log.Out(Logs::General, Logs::Error, "Error loading spells: %s", ex.what()); return; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 013136a50..4700159ec 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -508,7 +508,7 @@ void NPC::QueryLoot(Client* to) for(ItemList::iterator cur = itemlist.begin(); cur != itemlist.end(); ++cur, ++x) { const Item_Struct* item = database.GetItem((*cur)->item_id); if (item == nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Database error, invalid item"); + Log.Out(Logs::General, Logs::Error, "Database error, invalid item"); continue; } @@ -1004,7 +1004,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1021,7 +1021,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); @@ -1033,7 +1033,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); @@ -1047,7 +1047,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1058,7 +1058,7 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1075,7 +1075,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); @@ -1098,7 +1098,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); @@ -1110,7 +1110,7 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1672,7 +1672,7 @@ void Mob::NPCSpecialAttacks(const char* parse, int permtag, bool reset, bool rem { if(database.SetSpecialAttkFlag(this->GetNPCTypeID(), orig_parse)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); + Log.Out(Logs::General, Logs::Normal, "NPCTypeID: %i flagged to '%s' for Special Attacks.\n",this->GetNPCTypeID(),orig_parse); } } } diff --git a/zone/object.cpp b/zone/object.cpp index 5624ec24a..baa084699 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -336,7 +336,7 @@ const ItemInst* Object::GetItem(uint8 index) { void Object::PutItem(uint8 index, const ItemInst* inst) { if (index > 9) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Object::PutItem: Invalid index specified (%i)", index); + Log.Out(Logs::General, Logs::Error, "Object::PutItem: Invalid index specified (%i)", index); return; } @@ -598,7 +598,7 @@ uint32 ZoneDatabase::AddObject(uint32 type, uint32 icon, const Object_Struct& ob safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to insert object: %s", results.ErrorMessage().c_str()); return 0; } @@ -635,7 +635,7 @@ void ZoneDatabase::UpdateObject(uint32 id, uint32 type, uint32 icon, const Objec safe_delete_array(object_name); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to update object: %s", results.ErrorMessage().c_str()); return; } @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteObject(uint32 id) std::string query = StringFormat("DELETE FROM object WHERE id = %i", id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to delete object: %s", results.ErrorMessage().c_str()); } } diff --git a/zone/pathing.cpp b/zone/pathing.cpp index c8546279b..6afa63546 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -61,19 +61,19 @@ PathManager* PathManager::LoadPathFile(const char* ZoneName) if(Ret->loadPaths(PathFile)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File %s loaded.", ZonePathFileName); + Log.Out(Logs::General, Logs::Status, "Path File %s loaded.", ZonePathFileName); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s failed to load.", ZonePathFileName); + Log.Out(Logs::General, Logs::Error, "Path File %s failed to load.", ZonePathFileName); safe_delete(Ret); } fclose(PathFile); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Path File %s not found.", ZonePathFileName); + Log.Out(Logs::General, Logs::Error, "Path File %s not found.", ZonePathFileName); } return Ret; @@ -103,18 +103,18 @@ bool PathManager::loadPaths(FILE *PathFile) if(strncmp(Magic, "EQEMUPATH", 9)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Bad Magic String in .path file."); + Log.Out(Logs::General, Logs::Error, "Bad Magic String in .path file."); return false; } fread(&Head, sizeof(Head), 1, PathFile); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Path File Header: Version %ld, PathNodes %ld", + Log.Out(Logs::General, Logs::Status, "Path File Header: Version %ld, PathNodes %ld", (long)Head.version, (long)Head.PathNodeCount); if(Head.version != 2) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unsupported path file version."); + Log.Out(Logs::General, Logs::Error, "Unsupported path file version."); return false; } @@ -138,7 +138,7 @@ bool PathManager::loadPaths(FILE *PathFile) { if(PathNodes[i].Neighbours[j].id > MaxNodeID) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); + Log.Out(Logs::General, Logs::Error, "Path Node %i, Neighbour %i (%i) out of range.", i, j, PathNodes[i].Neighbours[j].id); PathFileValid = false; } @@ -207,7 +207,7 @@ Map::Vertex PathManager::GetPathNodeCoordinates(int NodeNumber, bool BestZ) std::deque PathManager::FindRoute(int startID, int endID) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute from node %i to %i", startID, endID); + Log.Out(Logs::Detail, Logs::None, "FindRoute from node %i to %i", startID, endID); memset(ClosedListFlag, 0, sizeof(int) * Head.PathNodeCount); @@ -330,7 +330,7 @@ std::deque PathManager::FindRoute(int startID, int endID) } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Unable to find a route."); + Log.Out(Logs::Detail, Logs::None, "Unable to find a route."); return Route; } @@ -352,7 +352,7 @@ auto path_compare = [](const PathNodeSortStruct& a, const PathNodeSortStruct& b) std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); + Log.Out(Logs::Detail, Logs::None, "FindRoute(%8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f)", Start.x, Start.y, Start.z, End.x, End.y, End.z); std::deque noderoute; @@ -386,7 +386,7 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.Out(Logs::Detail, Logs::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Start, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -396,11 +396,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToStart <0 ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.Out(Logs::Detail, Logs::None, "No LOS to any starting Path Node within range."); return noderoute; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); + Log.Out(Logs::Detail, Logs::None, "Closest Path Node To Start: %2d", ClosestPathNodeToStart); // Find the nearest PathNode the end point has LOS to @@ -424,8 +424,8 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", + Log.Out(Logs::Detail, Logs::None, "Checking Reachability of Node %i from End Position.", PathNodes[(*Iterator).id].id); + Log.Out(Logs::Detail, Logs::None, " (%8.3f, %8.3f, %8.3f) to (%8.3f, %8.3f, %8.3f)", End.x, End.y, End.z, PathNodes[(*Iterator).id].v.x, PathNodes[(*Iterator).id].v.y, PathNodes[(*Iterator).id].v.z); @@ -437,11 +437,11 @@ std::deque PathManager::FindRoute(Map::Vertex Start, Map::Vertex End) } if(ClosestPathNodeToEnd < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any end Path Node within range."); + Log.Out(Logs::Detail, Logs::None, "No LOS to any end Path Node within range."); return noderoute; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); + Log.Out(Logs::Detail, Logs::None, "Closest Path Node To End: %2d", ClosestPathNodeToEnd); if(ClosestPathNodeToStart == ClosestPathNodeToEnd) { @@ -673,7 +673,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(To == From) return To; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); + Log.Out(Logs::Detail, Logs::None, "UpdatePath. From(%8.3f, %8.3f, %8.3f) To(%8.3f, %8.3f, %8.3f)", From.x, From.y, From.z, To.x, To.y, To.z); if(From == PathingLastPosition) { @@ -681,7 +681,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((PathingLoopCount > 5) && !IsRooted()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "appears to be stuck. Teleporting them to next position.", GetName()); + Log.Out(Logs::Detail, Logs::None, "appears to be stuck. Teleporting them to next position.", GetName()); if(Route.size() == 0) { @@ -721,7 +721,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // If we are already pathing, and the destination is the same as before ... if(SameDestination) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Still pathing to the same destination."); + Log.Out(Logs::Detail, Logs::None, " Still pathing to the same destination."); // Get the coordinates of the first path node we are going to. NextNode = Route.front(); @@ -732,7 +732,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // We have reached the path node. if(NodeLoc == From) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i", NextNode); + Log.Out(Logs::Detail, Logs::None, " Arrived at node %i", NextNode); NodeReached = true; @@ -746,17 +746,17 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // target, and we may run past the target if we don't check LOS at this point. int RouteSize = Route.size(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Route size is %i", RouteSize); + Log.Out(Logs::Detail, Logs::None, "Route size is %i", RouteSize); if((RouteSize == 2) || ((PathingTraversedNodes >= RuleI(Pathing, MinNodesTraversedForLOSCheck)) && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.Out(Logs::Detail, Logs::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.Out(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -765,18 +765,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(Logs::Detail, Logs::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.Out(Logs::Detail, Logs::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.Out(Logs::Detail, Logs::None, " Continuing on node path."); } } else @@ -802,7 +802,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.Out(Logs::Detail, Logs::None, "Missing node after teleport."); return To; } @@ -812,7 +812,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.Out(Logs::Detail, Logs::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -823,7 +823,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.Out(Logs::Detail, Logs::None, " Now moving to node %i", NextNode); return zone->pathing->GetPathNodeCoordinates(NextNode); } @@ -831,7 +831,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // we have run all the nodes, all that is left is the direct path from the last node // to the destination - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of node path, running direct to target."); + Log.Out(Logs::Detail, Logs::None, " Reached end of node path, running direct to target."); return To; } @@ -845,11 +845,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & && (RouteSize <= RuleI(Pathing, MinNodesLeftForLOSCheck)) && PathingLOSCheckTimer->Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking distance to target."); + Log.Out(Logs::Detail, Logs::None, " Checking distance to target."); float Distance = VertexDistanceNoRoot(From, To); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Distance between From and To (NoRoot) is %8.3f", Distance); + Log.Out(Logs::Detail, Logs::None, " Distance between From and To (NoRoot) is %8.3f", Distance); if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) @@ -858,18 +858,18 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(Logs::Detail, Logs::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.Out(Logs::Detail, Logs::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.Out(Logs::Detail, Logs::None, " Continuing on node path."); } } else @@ -881,7 +881,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { // We get here if we were already pathing, but our destination has now changed. // - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target has changed position."); + Log.Out(Logs::Detail, Logs::None, " Target has changed position."); // Update our record of where we are going to. PathingDestination = To; // Check if we now have LOS etc to the new destination. @@ -892,23 +892,23 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckShort)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for short LOS at distance %8.3f.", Distance); + Log.Out(Logs::Detail, Logs::None, " Checking for short LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(Logs::Detail, Logs::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No hazards. Running directly to target."); + Log.Out(Logs::Detail, Logs::None, " No hazards. Running directly to target."); Route.clear(); return To; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Continuing on node path."); + Log.Out(Logs::Detail, Logs::None, " Continuing on node path."); } } } @@ -919,19 +919,19 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & { if(!PathingRouteUpdateTimerShort->Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer not yet expired."); + Log.Out(Logs::Detail, Logs::None, "Short route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Short route update timer expired."); + Log.Out(Logs::Detail, Logs::None, "Short route update timer expired."); } else { if(!PathingRouteUpdateTimerLong->Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer not yet expired."); + Log.Out(Logs::Detail, Logs::None, "Long route update timer not yet expired."); return zone->pathing->GetPathNodeCoordinates(Route.front()); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Long route update timer expired."); + Log.Out(Logs::Detail, Logs::None, "Long route update timer expired."); } // We are already pathing, destination changed, no LOS. Find the nearest node to our destination. @@ -940,7 +940,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Destination unreachable via pathing, return direct route. if(DestinationPathNode == -1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Unable to find path node for new destination. Running straight to target."); + Log.Out(Logs::Detail, Logs::None, " Unable to find path node for new destination. Running straight to target."); Route.clear(); return To; } @@ -948,7 +948,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // one, we will carry on on our path. if(DestinationPathNode == Route.back()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); + Log.Out(Logs::Detail, Logs::None, " Same destination Node (%i). Continue with current path.", DestinationPathNode); NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); @@ -956,7 +956,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & // Check if we have reached a path node. if(NodeLoc == From) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Arrived at node %i, moving to next one.\n", Route.front()); + Log.Out(Logs::Detail, Logs::None, " Arrived at node %i, moving to next one.\n", Route.front()); NodeReached = true; @@ -979,7 +979,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Missing node after teleport."); + Log.Out(Logs::Detail, Logs::None, "Missing node after teleport."); return To; } @@ -989,7 +989,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & Teleport(NodeLoc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); + Log.Out(Logs::Detail, Logs::None, " TELEPORTED to %8.3f, %8.3f, %8.3f\n", NodeLoc.x, NodeLoc.y, NodeLoc.z); Route.pop_front(); @@ -999,7 +999,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & NextNode = Route.front(); } // Return the coords of our next path node on the route. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Now moving to node %i", NextNode); + Log.Out(Logs::Detail, Logs::None, " Now moving to node %i", NextNode); zone->pathing->OpenDoors(PathingLastNodeVisited, NextNode, this); @@ -1007,7 +1007,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Reached end of path grid. Running direct to target."); + Log.Out(Logs::Detail, Logs::None, " Reached end of path grid. Running direct to target."); return To; } } @@ -1015,7 +1015,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Target moved. End node is different. Clearing route."); + Log.Out(Logs::Detail, Logs::None, " Target moved. End node is different. Clearing route."); Route.clear(); // We will now fall through to get a new route. @@ -1025,11 +1025,11 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Our route list is empty."); + Log.Out(Logs::Detail, Logs::None, " Our route list is empty."); if((SameDestination) && !PathingLOSCheckTimer->Check()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Destination same as before, LOS check timer not reached. Returning To."); + Log.Out(Logs::Detail, Logs::None, " Destination same as before, LOS check timer not reached. Returning To."); return To; } @@ -1044,22 +1044,22 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if((Distance <= RuleR(Pathing, MinDistanceForLOSCheckLong)) && (ABS(From.z - To.z) <= RuleR(Pathing, ZDiffThreshold))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Checking for long LOS at distance %8.3f.", Distance); + Log.Out(Logs::Detail, Logs::None, " Checking for long LOS at distance %8.3f.", Distance); if(!zone->zonemap->LineIntersectsZone(HeadPosition, To, 1.0f, nullptr)) PathingLOSState = HaveLOS; else PathingLOSState = NoLOS; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "NoLOS"); + Log.Out(Logs::Detail, Logs::None, "NoLOS"); if((PathingLOSState == HaveLOS) && zone->pathing->NoHazards(From, To)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Target is reachable. Running directly there."); + Log.Out(Logs::Detail, Logs::None, "Target is reachable. Running directly there."); return To; } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Calculating new route to target."); + Log.Out(Logs::Detail, Logs::None, " Calculating new route to target."); Route = zone->pathing->FindRoute(From, To); @@ -1067,14 +1067,14 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & if(Route.size() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " No route available, running direct."); + Log.Out(Logs::Detail, Logs::None, " No route available, running direct."); return To; } if(SameDestination && (Route.front() == PathingLastNodeVisited)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); + Log.Out(Logs::Detail, Logs::None, " Probable loop detected. Same destination and Route.front() == PathingLastNodeVisited."); Route.clear(); @@ -1082,7 +1082,7 @@ Map::Vertex Mob::UpdatePath(float ToX, float ToY, float ToZ, float Speed, bool & } NodeLoc = zone->pathing->GetPathNodeCoordinates(Route.front()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " New route determined, heading for node %i", Route.front()); + Log.Out(Logs::Detail, Logs::None, " New route determined, heading for node %i", Route.front()); PathingLoopCount = 0; @@ -1124,7 +1124,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) for(auto Iterator = SortedByDistance.begin(); Iterator != SortedByDistance.end(); ++Iterator) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); + Log.Out(Logs::Detail, Logs::None, "Checking Reachability of Node %i from Start Position.", PathNodes[(*Iterator).id].id); if(!zone->zonemap->LineIntersectsZone(Position, PathNodes[(*Iterator).id].v, 1.0f, nullptr)) { @@ -1134,7 +1134,7 @@ int PathManager::FindNearestPathNode(Map::Vertex Position) } if(ClosestPathNodeToStart <0 ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No LOS to any starting Path Node within range."); + Log.Out(Logs::Detail, Logs::None, "No LOS to any starting Path Node within range."); return -1; } return ClosestPathNodeToStart; @@ -1150,14 +1150,14 @@ bool PathManager::NoHazards(Map::Vertex From, Map::Vertex To) if(ABS(NewZ - From.z) > RuleR(Pathing, ZDiffThreshold)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.Out(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); return false; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", + Log.Out(Logs::Detail, Logs::None, "No HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Z Change is %8.3f", From.x, From.y, From.z, MidPoint.x, MidPoint.y, MidPoint.z, NewZ - From.z); } @@ -1189,7 +1189,7 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) float NewZ = zone->zonemap->FindBestZ(TestPoint, nullptr); if (ABS(NewZ - last_z) > 5.0f) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", + Log.Out(Logs::Detail, Logs::None, " HAZARD DETECTED moving from %8.3f, %8.3f, %8.3f to %8.3f, %8.3f, %8.3f. Best Z %8.3f, Z Change is %8.3f", From.x, From.y, From.z, TestPoint.x, TestPoint.y, TestPoint.z, NewZ, NewZ - From.z); return false; } @@ -1215,30 +1215,30 @@ bool PathManager::NoHazardsAccurate(Map::Vertex From, Map::Vertex To) } if (best_z2 == -999990) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, really deep water/lava!"); + Log.Out(Logs::Detail, Logs::None, " HAZARD DETECTED, really deep water/lava!"); return false; } else { if (ABS(NewZ - best_z2) > RuleR(Pathing, ZDiffThreshold)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); + Log.Out(Logs::Detail, Logs::None, " HAZARD DETECTED, water is fairly deep at %8.3f units deep", ABS(NewZ - best_z2)); return false; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); + Log.Out(Logs::Detail, Logs::None, " HAZARD NOT DETECTED, water is shallow at %8.3f units deep", ABS(NewZ - best_z2)); } } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Hazard point not in water or lava!"); + Log.Out(Logs::Detail, Logs::None, "Hazard point not in water or lava!"); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "No water map loaded for hazards!"); + Log.Out(Logs::Detail, Logs::None, "No water map loaded for hazards!"); } curx += stepx; @@ -1290,7 +1290,7 @@ void PathManager::OpenDoors(int Node1, int Node2, Mob *ForWho) if(d && !d->IsDoorOpen() ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); + Log.Out(Logs::Detail, Logs::None, "Opening door %i for %s", PathNodes[Node1].Neighbours[i].DoorID, ForWho->GetName()); d->ForceOpen(ForWho); } diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 621895c3b..685a39091 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -1271,15 +1271,15 @@ XS(XS_Client_MovePC) } else { if (THIS->IsMerc()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process a type Bot reference"); #endif else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePC) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); } @@ -1317,15 +1317,15 @@ XS(XS_Client_MovePCInstance) } else { if (THIS->IsMerc()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Merc reference"); else if (THIS->IsNPC()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type NPC reference"); #ifdef BOTS else if (THIS->IsBot()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process a type Bot reference"); #endif else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Perl(XS_Client_MovePCInstance) attempted to process an Unknown type reference"); Perl_croak(aTHX_ "THIS is not of type Client"); diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 9ee477de0..2d2173e26 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,7 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -227,7 +227,7 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -254,12 +254,12 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "New petition created"); + Log.Out(Logs::General, Logs::None, "New petition created"); #endif } @@ -273,7 +273,7 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/pets.cpp b/zone/pets.cpp index b8d25c2b6..1171194e3 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -243,7 +243,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, PetRecord record; if(!database.GetPoweredPetEntry(pettype, act_power, &record)) { Message(13, "Unable to find data for pet %s", pettype); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to find data for pet %s, check pets table.", pettype); + Log.Out(Logs::General, Logs::Error, "Unable to find data for pet %s, check pets table.", pettype); return; } @@ -251,7 +251,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, const NPCType *base = database.GetNPCType(record.npc_type); if(base == nullptr) { Message(13, "Unable to load NPC data for pet %s", pettype); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); + Log.Out(Logs::General, Logs::Error, "Unable to load NPC data for pet %s (NPC ID %d), check pets and npc_types tables.", pettype, record.npc_type); return; } @@ -372,7 +372,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { @@ -395,7 +395,7 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, npc_type->helmtexture = monster->helmtexture; npc_type->herosforgemodel = monster->herosforgemodel; } else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); + Log.Out(Logs::General, Logs::Error, "Error loading NPC data for monster summoning pet (NPC ID %d)", monsterid); } @@ -456,7 +456,7 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -656,13 +656,13 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if (results.RowCount() != 1) { // invalid set reference, it doesn't exist - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); + Log.Out(Logs::General, Logs::Error, "Error in GetBasePetItems equipment set '%d' does not exist", curset); return false; } @@ -672,7 +672,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 83f497352..d9eb291dc 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -154,7 +154,7 @@ void QuestManager::echo(int colour, const char *str) { void QuestManager::say(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -170,7 +170,7 @@ void QuestManager::say(const char *str) { void QuestManager::say(const char *str, uint8 language) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::say called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -548,7 +548,7 @@ void QuestManager::stopalltimers(Mob *mob) { void QuestManager::emote(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::emote called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -559,7 +559,7 @@ void QuestManager::emote(const char *str) { void QuestManager::shout(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::shout called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -570,7 +570,7 @@ void QuestManager::shout(const char *str) { void QuestManager::shout2(const char *str) { QuestManagerCurrentQuestVars(); if (!owner) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::shout2 called with nullptr owner. Probably syntax error in quest file."); return; } else { @@ -589,7 +589,7 @@ void QuestManager::gmsay(const char *str, uint32 color, bool send_to_world, uint void QuestManager::depop(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::depop called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -619,7 +619,7 @@ void QuestManager::depop(int npc_type) { void QuestManager::depop_withtimer(int npc_type) { QuestManagerCurrentQuestVars(); if (!owner || !owner->IsNPC()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::depop_withtimer called with nullptr owner or non-NPC owner. Probably syntax error in quest file."); return; } else { @@ -646,7 +646,7 @@ void QuestManager::depopall(int npc_type) { entity_list.DepopAll(npc_type); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::depopall called with nullptr owner, non-NPC owner, or invalid NPC Type ID. Probably syntax error in quest file."); } } @@ -655,7 +655,7 @@ void QuestManager::depopzone(bool StartSpawnTimer) { zone->Depop(StartSpawnTimer); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::depopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -664,7 +664,7 @@ void QuestManager::repopzone() { zone->Repop(); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); + Log.Out(Logs::General, Logs::Quests, "QuestManager::repopzone called with nullptr zone. Probably syntax error in quest file."); } } @@ -1652,7 +1652,7 @@ void QuestManager::showgrid(int grid) { "ORDER BY `number`", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Quests, "Error loading grid %d for showgrid(): %s", grid, results.ErrorMessage().c_str()); return; } @@ -2074,7 +2074,7 @@ bool QuestManager::istaskenabled(int taskid) { void QuestManager::tasksetselector(int tasksetid) { QuestManagerCurrentQuestVars(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for task set %i", tasksetid); if(RuleB(TaskSystem, EnableTaskSystem) && initiator && owner && taskmanager) initiator->TaskSetSelector(owner, tasksetid); } @@ -2641,7 +2641,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam std::string insert_query = StringFormat("INSERT INTO `saylink` (`phrase`) VALUES ('%s')", escaped_string); results = database.QueryDatabase(insert_query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } else { results = database.QueryDatabase(query); if (results.Success()) { @@ -2649,7 +2649,7 @@ const char* QuestManager::saylink(char* Phrase, bool silent, const char* LinkNam for(auto row = results.begin(); row != results.end(); ++row) sayid = atoi(row[0]); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in saylink phrase queries", results.ErrorMessage().c_str()); } } } @@ -2809,7 +2809,7 @@ void QuestManager::voicetell(const char *str, int macronum, int racenum, int gen safe_delete(outapp); } else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); + Log.Out(Logs::General, Logs::Quests, "QuestManager::voicetell from %s. Client %s not found.", owner->GetName(), str); } } diff --git a/zone/raids.cpp b/zone/raids.cpp index 804392ae1..bbb51a384 100644 --- a/zone/raids.cpp +++ b/zone/raids.cpp @@ -99,7 +99,7 @@ void Raid::AddMember(Client *c, uint32 group, bool rleader, bool groupleader, bo auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error inserting into raid members: %s", results.ErrorMessage().c_str()); } LearnMembers(); @@ -233,12 +233,12 @@ void Raid::SetRaidLeader(const char *wasLead, const char *name) std::string query = StringFormat("UPDATE raid_members SET israidleader = 0 WHERE name = '%s'", wasLead); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); query = StringFormat("UPDATE raid_members SET israidleader = 1 WHERE name = '%s'", name); results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Set Raid Leader error: %s\n", results.ErrorMessage().c_str()); strn0cpy(leadername, name, 64); @@ -271,7 +271,7 @@ void Raid::SaveGroupLeaderAA(uint32 gid) safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::SaveRaidLeaderAA() @@ -285,7 +285,7 @@ void Raid::SaveRaidLeaderAA() safe_delete_array(queryBuffer); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to store LeadershipAA: %s\n", results.ErrorMessage().c_str()); } void Raid::UpdateGroupAAs(uint32 gid) @@ -498,7 +498,7 @@ void Raid::CastGroupSpell(Mob* caster, uint16 spellid, uint32 gid) #endif } else{ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Raid spell: %s is out of range %f at distance %f from %s", members[x].member->GetName(), range, distance, caster->GetName()); } } } @@ -799,7 +799,7 @@ void Raid::GroupBardPulse(Mob* caster, uint16 spellid, uint32 gid){ members[z].member->GetPet()->BardPulse(spellid, caster); #endif } else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Group bard pulse: %s is out of range %f at distance %f from %s", members[z].member->GetName(), range, distance, caster->GetName()); } } } @@ -1407,7 +1407,7 @@ void Raid::GetRaidDetails() return; if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting raid details for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); return; } @@ -1439,7 +1439,7 @@ bool Raid::LearnMembers() return false; if(results.RowCount() == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting raid members for raid %lu: %s", (unsigned long)GetID(), results.ErrorMessage().c_str()); disbandCheck = true; return false; } @@ -1643,7 +1643,7 @@ void Raid::SetGroupMentor(uint32 group_id, int percent, char *name) name, percent, group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to set raid group mentor: %s\n", results.ErrorMessage().c_str()); } void Raid::ClearGroupMentor(uint32 group_id) @@ -1658,7 +1658,7 @@ void Raid::ClearGroupMentor(uint32 group_id) group_id, GetID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to clear raid group mentor: %s\n", results.ErrorMessage().c_str()); } // there isn't a nice place to add this in another function, unlike groups diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 928414f2c..0f8b3330d 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -153,13 +153,13 @@ bool Spawn2::Process() { if (timer.Check()) { timer.Disable(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Timer has triggered", spawn2_id); //first check our spawn condition, if this isnt active //then we reset the timer and try again next time. if(condition_id != SC_AlwaysEnabled && !zone->spawn_conditions.Check(condition_id, condition_min_value)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: spawning prevented by spawn condition %d", spawn2_id, condition_id); Reset(); return(true); } @@ -170,14 +170,14 @@ bool Spawn2::Process() { } if (sg == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Unable to locate spawn group %d. Disabling.", spawn2_id, spawngroup_id_); return false; } //have the spawn group pick an NPC for us uint32 npcid = sg->GetNPCType(); if (npcid == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn group %d did not yeild an NPC! not spawning.", spawn2_id, spawngroup_id_); Reset(); //try again later (why?) return(true); } @@ -185,7 +185,7 @@ bool Spawn2::Process() { //try to find our NPC type. const NPCType* tmp = database.GetNPCType(npcid); if (tmp == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn group %d yeilded an invalid NPC type %d", spawn2_id, spawngroup_id_, npcid); Reset(); //try again later return(true); } @@ -194,7 +194,7 @@ bool Spawn2::Process() { { if(!entity_list.LimitCheckName(tmp->name)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is unique and one already exists.", spawn2_id, spawngroup_id_, npcid); timer.Start(5000); //try again in five seconds. return(true); } @@ -202,7 +202,7 @@ bool Spawn2::Process() { if(tmp->spawn_limit > 0) { if(!entity_list.LimitCheckType(npcid, tmp->spawn_limit)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn group %d yeilded NPC type %d, which is over its spawn limit (%d)", spawn2_id, spawngroup_id_, npcid, tmp->spawn_limit); timer.Start(5000); //try again in five seconds. return(true); } @@ -233,10 +233,10 @@ bool Spawn2::Process() { if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay && sg->min_delay) npc->AI_SetRoambox(sg->roamdist,sg->roambox[0],sg->roambox[1],sg->roambox[2],sg->roambox[3],sg->delay,sg->min_delay); if(zone->InstantGrids()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f).", spawn2_id, spawngroup_id_, npc->GetName(), npcid, x, y, z); LoadGrid(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Group %d spawned %s (%d) at (%.3f, %.3f, %.3f). Grid loading delayed.", spawn2_id, spawngroup_id_, tmp->name, npcid, x, y, z); } } return true; @@ -261,7 +261,7 @@ void Spawn2::LoadGrid() { //dont set an NPC's grid until its loaded for them. npcthis->SetGrid(grid_); npcthis->AssignWaypoints(grid_); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Loading grid %d for %s", spawn2_id, grid_, npcthis->GetName()); } @@ -272,21 +272,21 @@ void Spawn2::LoadGrid() { void Spawn2::Reset() { timer.Start(resetTimer()); npcthis = nullptr; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn reset, repop in %d ms", spawn2_id, timer.GetRemainingTime()); } void Spawn2::Depop() { timer.Disable(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn reset, repop disabled", spawn2_id); npcthis = nullptr; } void Spawn2::Repop(uint32 delay) { if (delay == 0) { timer.Trigger(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn reset, repop immediately.", spawn2_id); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn reset for repop, repop in %d ms", spawn2_id, delay); timer.Start(delay); } npcthis = nullptr; @@ -328,7 +328,7 @@ void Spawn2::ForceDespawn() cur = despawnTimer(dtimer); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn group %d set despawn timer to %d ms.", spawn2_id, spawngroup_id_, cur); timer.Start(cur); } @@ -349,7 +349,7 @@ void Spawn2::DeathReset(bool realdeath) if(spawn2_id) { database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), (cur/1000)); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Spawn reset by death, repop in %d ms", spawn2_id, timer.GetRemainingTime()); //store it to database too } } @@ -364,7 +364,7 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -392,12 +392,12 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } if (results.RowCount() != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } @@ -424,7 +424,7 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -466,12 +466,12 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { if(GetSpawnCondition() != c.condition_id) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Notified that our spawn condition %d has changed from %d to %d. Our min value is %d.", spawn2_id, c.condition_id, old_value, c.value, condition_min_value); bool old_state = (old_value >= condition_min_value); bool new_state = (c.value >= condition_min_value); if(old_state == new_state) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our threshold for this condition was not crossed. Doing nothing.", spawn2_id); return; //no change } @@ -479,50 +479,50 @@ void Spawn2::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { switch(c.on_change) { case SpawnCondition::DoNothing: //that was easy. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Taking no action on existing spawn.", spawn2_id, new_state?"enabled":"disabled"); break; case SpawnCondition::DoDepop: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Depoping our mob.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Reset(); //reset our spawn timer break; case SpawnCondition::DoRepop: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) npcthis->Depop(false); //remove the current mob Repop(); //repop break; case SpawnCondition::DoRepopIfReady: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Forcing a repop if repsawn timer is expired.", spawn2_id, new_state?"enabled":"disabled"); if(npcthis != nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our npcthis is currently not null. The zone thinks it is %s. Forcing a depop.", spawn2_id, npcthis->GetName()); npcthis->Depop(false); //remove the current mob npcthis = nullptr; } if(new_state) { // only get repawn timer remaining when the SpawnCondition is enabled. timer_remaining = database.GetSpawnTimeLeft(spawn2_id,zone->GetInstanceID()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); + Log.Out(Logs::Detail, Logs::Spawns,"Spawn2 %d: Our condition is now %s. The respawn timer_remaining is %d. Forcing a repop if it is <= 0.", spawn2_id, new_state?"enabled":"disabled", timer_remaining); if(timer_remaining <= 0) Repop(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); + Log.Out(Logs::Detail, Logs::Spawns,"Spawn2 %d: Our condition is now %s. Not checking respawn timer.", spawn2_id, new_state?"enabled":"disabled"); } break; default: if(c.on_change < SpawnCondition::DoSignalMin) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Invalid on-change action %d.", spawn2_id, new_state?"enabled":"disabled", c.on_change); return; //unknown onchange action } int signal_id = c.on_change - SpawnCondition::DoSignalMin; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn2 %d: Our condition is now %s. Signaling our mob with %d.", spawn2_id, new_state?"enabled":"disabled", signal_id); if(npcthis != nullptr) npcthis->SignalNPC(signal_id); } } void Zone::SpawnConditionChanged(const SpawnCondition &c, int16 old_value) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); + Log.Out(Logs::Detail, Logs::Spawns, "Zone notified that spawn condition %d has changed from %d to %d. Notifying all spawn points.", c.condition_id, old_value, c.value); LinkedListIterator iterator(spawn2_list); @@ -592,7 +592,7 @@ void SpawnConditionManager::Process() { EQTime::AddMinutes(cevent.period, &cevent.next); std::string t; EQTime::ToString(&cevent.next, t); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Will trigger again in %d EQ minutes at %s.", cevent.id, cevent.period, t.c_str()); //save the next event time in the DB UpdateDBEvent(cevent); //find the next closest event timer. @@ -611,7 +611,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { std::map::iterator condi; condi = spawn_conditions.find(event.condition_id); if(condi == spawn_conditions.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Unable to find condition %d to execute on.", event.id, event.condition_id); return; //unable to find the spawn condition to operate on } @@ -619,7 +619,7 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { zone->zone_time.getEQTimeOfDay(&tod); if(event.strict && (event.next.hour != tod.hour || event.next.day != tod.day || event.next.month != tod.month || event.next.year != tod.year)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Unable to execute. Condition is strict, and event time has already passed.", event.id); return; } @@ -631,26 +631,26 @@ void SpawnConditionManager::ExecEvent(SpawnEvent &event, bool send_update) { switch(event.action) { case SpawnEvent::ActionSet: new_value = event.argument; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Executing. Setting condition %d to %d.", event.id, event.condition_id, event.argument); break; case SpawnEvent::ActionAdd: new_value += event.argument; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Executing. Adding %d to condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionSubtract: new_value -= event.argument; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Executing. Subtracting %d from condition %d, yeilding %d.", event.id, event.argument, event.condition_id, new_value); break; case SpawnEvent::ActionMultiply: new_value *= event.argument; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Executing. Multiplying condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; case SpawnEvent::ActionDivide: new_value /= event.argument; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Executing. Dividing condition %d by %d, yeilding %d.", event.id, event.condition_id, event.argument, new_value); break; default: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); + Log.Out(Logs::Detail, Logs::Spawns, "Event %d: Invalid event action type %d", event.id, event.action); return; } @@ -674,7 +674,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -686,7 +686,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } @@ -699,7 +699,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -727,7 +727,7 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: std::string timeAsString; EQTime::ToString(&event.next, timeAsString); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); + Log.Out(Logs::Detail, Logs::Spawns, "(LoadDBEvent) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d. Will trigger at %s", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict, timeAsString.c_str()); return true; } @@ -742,7 +742,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -755,7 +755,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in cond.on_change = (SpawnCondition::OnChange) atoi(row[1]); spawn_conditions[cond.condition_id] = cond; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); + Log.Out(Logs::Detail, Logs::Spawns, "Loaded spawn condition %d with value %d and on_change %d", cond.condition_id, cond.value, cond.on_change); } //load values @@ -764,7 +764,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } @@ -782,7 +782,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -794,7 +794,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in event.period = atoi(row[2]); if(event.period == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); + Log.Out(Logs::General, Logs::Error, "Refusing to load spawn event #%d because it has a period of 0\n", event.id); continue; } @@ -811,7 +811,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in spawn_events.push_back(event); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); + Log.Out(Logs::Detail, Logs::Spawns, "(LoadSpawnConditions) Loaded %s spawn event %d on condition %d with period %d, action %d, argument %d, strict %d", event.enabled? "enabled": "disabled", event.id, event.condition_id, event.period, event.action, event.argument, event.strict); } //now we need to catch up on events that happened while we were away @@ -846,7 +846,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in //watch for special case of all 0s, which means to reset next to now if(cevent.next.year == 0 && cevent.next.month == 0 && cevent.next.day == 0 && cevent.next.hour == 0 && cevent.next.minute == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); + Log.Out(Logs::Detail, Logs::Spawns, "Initial next trigger time set for spawn event %d", cevent.id); memcpy(&cevent.next, &tod, sizeof(cevent.next)); //add one period EQTime::AddMinutes(cevent.period, &cevent.next); @@ -857,7 +857,7 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in bool ran = false; while(EQTime::IsTimeBefore(&tod, &cevent.next)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Catch up triggering on event %d", cevent.id); + Log.Out(Logs::Detail, Logs::Spawns, "Catch up triggering on event %d", cevent.id); //this event has been triggered. //execute the event if(!cevent.strict || StrictCheck) @@ -900,9 +900,9 @@ void SpawnConditionManager::FindNearestEvent() { } } if(next_id == -1) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "No spawn events enabled. Disabling next event."); + Log.Out(Logs::Detail, Logs::Spawns, "No spawn events enabled. Disabling next event."); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Next event determined to be event %d", next_id); + Log.Out(Logs::Detail, Logs::Spawns, "Next event determined to be event %d", next_id); } void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance_id, uint16 condition_id, int16 new_value, bool world_update) @@ -914,14 +914,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); + Log.Out(Logs::Detail, Logs::Spawns, "Condition update received from world for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Condition update received from world for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -930,7 +930,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //set our local value cond.value = new_value; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Condition update received from world for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -941,14 +941,14 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance std::map::iterator condi; condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); + Log.Out(Logs::Detail, Logs::Spawns, "Local Condition update requested for %d, but we do not have that conditon.", condition_id); return; //unable to find the spawn condition } SpawnCondition &cond = condi->second; if(cond.value == new_value) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Local Condition update requested for %d with value %d, which is what we already have.", condition_id, new_value); return; } @@ -959,7 +959,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //save it in the DB too UpdateDBCondition(zone_short, instance_id, condition_id, new_value); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Local Condition update requested for %d with value %d", condition_id, new_value); //now we have to test each spawn point to see if it changed. zone->SpawnConditionChanged(cond, old_value); @@ -969,7 +969,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance //this is a remote spawn condition, update the DB and send //an update packet to the zone if its up - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); + Log.Out(Logs::Detail, Logs::Spawns, "Remote spawn condition %d set to %d. Updating DB and notifying world.", condition_id, new_value); UpdateDBCondition(zone_short, instance_id, condition_id, new_value); @@ -989,7 +989,7 @@ void SpawnConditionManager::SetCondition(const char *zone_short, uint32 instance void SpawnConditionManager::ReloadEvent(uint32 event_id) { std::string zone_short_name; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Requested to reload event %d from the database.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Requested to reload event %d from the database.", event_id); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1002,7 +1002,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { //load the event into the old event slot if(!LoadDBEvent(event_id, cevent, zone_short_name)) { //unable to find the event in the database... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Failed to reload event %d from the database.", event_id); return; } //sync up our nearest event @@ -1015,7 +1015,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { SpawnEvent e; if(!LoadDBEvent(event_id, e, zone_short_name)) { //unable to find the event in the database... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Failed to reload event %d from the database.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Failed to reload event %d from the database.", event_id); return; } @@ -1032,7 +1032,7 @@ void SpawnConditionManager::ReloadEvent(uint32 event_id) { void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool strict, bool reset_base) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); + Log.Out(Logs::Detail, Logs::Spawns, "Request to %s spawn event %d %sresetting trigger time", enabled?"enable":"disable", event_id, reset_base?"":"without "); //first look for the event in our local event list std::vector::iterator cur,end; @@ -1047,13 +1047,13 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri cevent.enabled = enabled; cevent.strict = strict; if(reset_base) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn event %d located in this zone. State set. Trigger time reset (period %d).", event_id, cevent.period); //start with the time now zone->zone_time.getEQTimeOfDay(&cevent.next); //advance the next time by our period EQTime::AddMinutes(cevent.period, &cevent.next); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone. State changed.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn event %d located in this zone. State changed.", event_id); } //save the event in the DB @@ -1062,7 +1062,7 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri //sync up our nearest event FindNearestEvent(); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn event %d located in this zone but no change was needed.", event_id); } //even if we dont change anything, we still found it return; @@ -1081,24 +1081,24 @@ void SpawnConditionManager::ToggleEvent(uint32 event_id, bool enabled, bool stri SpawnEvent e; std::string zone_short_name; if(!LoadDBEvent(event_id, e, zone_short_name)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find spawn event %d in the database.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Unable to find spawn event %d in the database.", event_id); //unable to find the event in the database... return; } if(e.enabled == enabled && !reset_base) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn event %d is not located in this zone but no change was needed.", event_id); return; //no changes. } e.enabled = enabled; if(reset_base) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn event %d is in zone %s. State set. Trigger time reset (period %d). Notifying world.", event_id, zone_short_name.c_str(), e.period); //start with the time now zone->zone_time.getEQTimeOfDay(&e.next); //advance the next time by our period EQTime::AddMinutes(e.period, &e.next); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); + Log.Out(Logs::Detail, Logs::Spawns, "Spawn event %d is in zone %s. State changed. Notifying world.", event_id, zone_short_name.c_str(), e.period); } //save the event in the DB UpdateDBEvent(e); @@ -1123,7 +1123,7 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc condi = spawn_conditions.find(condition_id); if(condi == spawn_conditions.end()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to find local condition %d in Get request.", condition_id); + Log.Out(Logs::Detail, Logs::Spawns, "Unable to find local condition %d in Get request.", condition_id); return(0); //unable to find the spawn condition } @@ -1138,12 +1138,12 @@ int16 SpawnConditionManager::GetCondition(const char *zone_short, uint32 instanc zone_short, instance_id, condition_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.Out(Logs::Detail, Logs::Spawns, "Unable to query remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); + Log.Out(Logs::Detail, Logs::Spawns, "Unable to load remote condition %d from zone %s in Get request.", condition_id, zone_short); return 0; //dunno a better thing to do... } diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index 577e5b998..bae4832c0 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -51,7 +51,7 @@ SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, floa uint32 SpawnGroup::GetNPCType() { #if EQDEBUG >= 10 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); + Log.Out(Logs::General, Logs::None, "SpawnGroup[%08x]::GetNPCType()", (uint32) this); #endif int npcType = 0; int totalchance = 0; @@ -167,7 +167,7 @@ bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, uint16 version, SpawnG "AND zone = '%s'", zone_name); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error2 in PopulateZoneLists query '%'", query.c_str()); return false; } @@ -195,7 +195,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "FROM spawngroup WHERE spawngroup.ID = '%i'", spawngroupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error2 in PopulateZoneLists query %s", query.c_str()); return false; } @@ -210,7 +210,7 @@ bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_g "ORDER BY chance", spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error3 in PopulateZoneLists query '%s'", query.c_str()); return false; } diff --git a/zone/special_attacks.cpp b/zone/special_attacks.cpp index 47ae29ec2..27734777f 100644 --- a/zone/special_attacks.cpp +++ b/zone/special_attacks.cpp @@ -464,7 +464,7 @@ int Mob::MonkSpecialAttack(Mob* other, uint8 unchecked_type) break; } default: - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Attack, "Invalid special attack type %d attempted", unchecked_type); + Log.Out(Logs::Detail, Logs::Attack, "Invalid special attack type %d attempted", unchecked_type); return(1000); /* nice long delay for them, the caller depends on this! */ } @@ -683,7 +683,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if(!CanDoubleAttack && ((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(Logs::Detail, Logs::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -695,12 +695,12 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const ItemInst* Ammo = m_inv[MainAmmo]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have no bow!", GetItemIDAt(MainRange)); return; } if (!Ammo || !Ammo->IsType(ItemClassCommon)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ammo item (%d) in slot %d", GetItemIDAt(MainAmmo), MainAmmo); Message(0, "Error: Ammo: GetItem(%i)==0, you have no ammo!", GetItemIDAt(MainAmmo)); return; } @@ -709,17 +709,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { const Item_Struct* AmmoItem = Ammo->GetItem(); if(RangeItem->ItemType != ItemTypeBow) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item is not a bow. type %d.", RangeItem->ItemType); Message(0, "Error: Rangeweapon: Item %d is not a bow.", RangeWeapon->GetID()); return; } if(AmmoItem->ItemType != ItemTypeArrow) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ammo item is not an arrow. type %d.", AmmoItem->ItemType); Message(0, "Error: Ammo: type %d != %d, you have the wrong type of ammo!", AmmoItem->ItemType, ItemTypeArrow); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); + Log.Out(Logs::Detail, Logs::Combat, "Shooting %s with bow %s (%d) and arrow %s (%d)", other->GetName(), RangeItem->Name, RangeItem->ID, AmmoItem->Name, AmmoItem->ID); //look for ammo in inventory if we only have 1 left... if(Ammo->GetCharges() == 1) { @@ -746,7 +746,7 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { Ammo = baginst; ammo_slot = m_inv.CalcSlotId(r, i); found = true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.Out(Logs::Detail, Logs::Combat, "Using ammo from quiver stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); break; } } @@ -761,17 +761,17 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (aslot != INVALID_INDEX) { ammo_slot = aslot; Ammo = m_inv[aslot]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); + Log.Out(Logs::Detail, Logs::Combat, "Using ammo from inventory stack at slot %d. %d in stack.", ammo_slot, Ammo->GetCharges()); } } } float range = RangeItem->Range + AmmoItem->Range + GetRangeDistTargetSizeMod(GetTarget()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.Out(Logs::Detail, Logs::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -799,9 +799,9 @@ void Client::RangedAttack(Mob* other, bool CanDoubleAttack) { if (!ChanceAvoidConsume || (ChanceAvoidConsume < 100 && zone->random.Int(0,99) > ChanceAvoidConsume)){ DeleteItemInInventory(ammo_slot, 1, true); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Consumed one arrow from slot %d", ammo_slot); + Log.Out(Logs::Detail, Logs::Combat, "Consumed one arrow from slot %d", ammo_slot); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Endless Quiver prevented ammo consumption."); + Log.Out(Logs::Detail, Logs::Combat, "Endless Quiver prevented ammo consumption."); } CheckIncreaseSkill(SkillArchery, GetTarget(), -15); @@ -873,7 +873,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillArchery); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillArchery, MainPrimary, chance_mod))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillArchery, 0, RangeWeapon, Ammo, AmmoSlot, speed); @@ -882,7 +882,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillArchery); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack hit %s.", other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack hit %s.", other->GetName()); bool HeadShot = false; uint32 HeadShot_Dmg = TryHeadShot(other, SkillArchery); @@ -923,7 +923,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite MaxDmg += MaxDmg*bonusArcheryDamageModifier / 100; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); + Log.Out(Logs::Detail, Logs::Combat, "Bow DMG %d, Arrow DMG %d, Max Damage %d.", WDmg, ADmg, MaxDmg); bool dobonus = false; if(GetClass() == RANGER && GetLevel() > 50){ @@ -944,7 +944,7 @@ void Mob::DoArcheryAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite hate *= 2; MaxDmg = mod_archery_bonus_damage(MaxDmg, RangeWeapon); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); + Log.Out(Logs::Detail, Logs::Combat, "Ranger. Double damage success roll, doubling damage to %d", MaxDmg); Message_StringID(MT_CritMelee, BOW_DOUBLE_DAMAGE); } } @@ -1192,7 +1192,7 @@ void NPC::RangedAttack(Mob* other) //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check())){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(Logs::Detail, Logs::Combat, "Archery canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; } @@ -1361,7 +1361,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //make sure the attack and ranged timers are up //if the ranged timer is disabled, then they have no ranged weapon and shouldent be attacking anyhow if((!CanDoubleAttack && (attack_timer.Enabled() && !attack_timer.Check(false)) || (ranged_timer.Enabled() && !ranged_timer.Check()))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); + Log.Out(Logs::Detail, Logs::Combat, "Throwing attack canceled. Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); // The server and client timers are not exact matches currently, so this would spam too often if enabled //Message(0, "Error: Timer not up. Attack %d, ranged %d", attack_timer.GetRemainingTime(), ranged_timer.GetRemainingTime()); return; @@ -1371,19 +1371,19 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 const ItemInst* RangeWeapon = m_inv[MainRange]; if (!RangeWeapon || !RangeWeapon->IsType(ItemClassCommon)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Missing or invalid ranged weapon (%d) in slot %d", GetItemIDAt(MainRange), MainRange); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing to throw!", GetItemIDAt(MainRange)); return; } const Item_Struct* item = RangeWeapon->GetItem(); if(item->ItemType != ItemTypeLargeThrowing && item->ItemType != ItemTypeSmallThrowing) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack canceled. Ranged item %d is not a throwing weapon. type %d.", item->ItemType); Message(0, "Error: Rangeweapon: GetItem(%i)==0, you have nothing useful to throw!", GetItemIDAt(MainRange)); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Throwing %s (%d) at %s", item->Name, item->ID, other->GetName()); if(RangeWeapon->GetCharges() == 1) { //first check ammo @@ -1392,7 +1392,7 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //more in the ammo slot, use it RangeWeapon = AmmoItem; ammo_slot = MainAmmo; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.Out(Logs::Detail, Logs::Combat, "Using ammo from ammo slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } else { //look through our inventory for more int32 aslot = m_inv.HasItem(item->ID, 1, invWherePersonal); @@ -1400,17 +1400,17 @@ void Client::ThrowingAttack(Mob* other, bool CanDoubleAttack) { //old was 51 //the item wont change, but the instance does, not that it matters ammo_slot = aslot; RangeWeapon = m_inv[aslot]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); + Log.Out(Logs::Detail, Logs::Combat, "Using ammo from inventory slot, stack at slot %d. %d in stack.", ammo_slot, RangeWeapon->GetCharges()); } } } float range = item->Range + GetRangeDistTargetSizeMod(other); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Calculated bow range to be %.1f", range); + Log.Out(Logs::Detail, Logs::Combat, "Calculated bow range to be %.1f", range); range *= range; float dist = DistNoRoot(*other); if(dist > range) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); + Log.Out(Logs::Detail, Logs::Combat, "Throwing attack out of range... client should catch this. (%f > %f).\n", dist, range); Message_StringID(13,TARGET_OUT_OF_RANGE);//Client enforces range and sends the message, this is a backup just incase. return; } @@ -1489,7 +1489,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite SendItemAnimation(other, AmmoItem, SkillThrowing); if (ProjectileMiss || (!ProjectileImpact && !other->CheckHitChance(this, SkillThrowing, MainPrimary, chance_mod))){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Ranged attack missed %s.", other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Ranged attack missed %s.", other->GetName()); if (LaunchProjectile){ TryProjectileAttack(other, AmmoItem, SkillThrowing, 0, RangeWeapon, nullptr, AmmoSlot, speed); return; @@ -1497,7 +1497,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite else other->Damage(this, 0, SPELL_UNKNOWN, SkillThrowing); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Throwing attack hit %s.", other->GetName()); + Log.Out(Logs::Detail, Logs::Combat, "Throwing attack hit %s.", other->GetName()); int16 WDmg = 0; @@ -1533,7 +1533,7 @@ void Mob::DoThrowingAttackDmg(Mob* other, const ItemInst* RangeWeapon, const Ite entity_list.MessageClose_StringID(this, false, 200, MT_CritMelee, ASSASSINATES, GetName()); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); + Log.Out(Logs::Detail, Logs::Combat, "Item DMG %d. Max Damage %d. Hit for damage %d", WDmg, MaxDmg, TotalDmg); if (!Assassinate_Dmg) other->AvoidDamage(this, TotalDmg, false); //CanRiposte=false - Can not riposte throw attacks. diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 1962ec416..b45f7da70 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -476,7 +476,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if(!target_zone) { #ifdef SPELL_EFFECT_SPAM - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell In Same Zone."); + Log.Out(Logs::General, Logs::None, "Succor/Evacuation Spell In Same Zone."); #endif if(IsClient()) CastToClient()->MovePC(zone->GetZoneID(), zone->GetInstanceID(), x, y, z, heading, 0, EvacToSafeCoords); @@ -485,7 +485,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { #ifdef SPELL_EFFECT_SPAM - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Succor/Evacuation Spell To Another Zone."); + Log.Out(Logs::General, Logs::None, "Succor/Evacuation Spell To Another Zone."); #endif if(IsClient()) CastToClient()->MovePC(target_zone, x, y, z, heading); @@ -711,7 +711,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) stun_resist += aabonuses.StunResist; if (stun_resist <= 0 || zone->random.Int(0,99) >= stun_resist) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stunned. We had %d percent resist chance.", stun_resist); + Log.Out(Logs::Detail, Logs::Combat, "Stunned. We had %d percent resist chance.", stun_resist); if (caster->IsClient()) effect_value += effect_value*caster->GetFocusEffect(focusFcStunTimeMod, spell_id)/100; @@ -721,7 +721,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsClient()) Message_StringID(MT_Stun, SHAKE_OFF_STUN); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); + Log.Out(Logs::Detail, Logs::Combat, "Stun Resisted. We had %d percent resist chance.", stun_resist); } } break; @@ -1649,7 +1649,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, " corpse being rezzed using spell %i by %s", + Log.Out(Logs::Detail, Logs::Spells, " corpse being rezzed using spell %i by %s", spell_id, caster->GetName()); CastToCorpse()->CastRezz(spell_id, caster); @@ -1772,7 +1772,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) } else { Message_StringID(4, TARGET_NOT_FOUND); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); + Log.Out(Logs::General, Logs::Error, "%s attempted to cast spell id %u with spell effect SE_SummonCorpse, but could not cast target into a Client object.", GetCleanName(), spell_id); } } @@ -3065,7 +3065,7 @@ int Mob::CalcSpellEffectValue(uint16 spell_id, int effect_id, int caster_level, int mod = caster->GetInstrumentMod(spell_id); mod = ApplySpellEffectiveness(caster, spell_id, mod, true); effect_value = effect_value * mod / 10; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); + Log.Out(Logs::Detail, Logs::Spells, "Effect value %d altered with bard modifier of %d to yeild %d", oval, mod, effect_value); } effect_value = mod_effect_value(effect_value, spell_id, spells[spell_id].effectid[effect_id], caster); @@ -3127,7 +3127,7 @@ snare has both of them negative, yet their range should work the same: updownsign = 1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", + Log.Out(Logs::Detail, Logs::Spells, "CSEV: spell %d, formula %d, base %d, max %d, lvl %d. Up/Down %d", spell_id, formula, base, max, caster_level, updownsign); switch(formula) @@ -3326,7 +3326,7 @@ snare has both of them negative, yet their range should work the same: result = ubase * (caster_level * (formula - 2000) + 1); } else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Unknown spell effect value forumula %d", formula); + Log.Out(Logs::General, Logs::None, "Unknown spell effect value forumula %d", formula); } } @@ -3351,7 +3351,7 @@ snare has both of them negative, yet their range should work the same: if (base < 0 && result > 0) result *= -1; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); + Log.Out(Logs::Detail, Logs::Spells, "Result: %d (orig %d), cap %d %s", result, oresult, max, (base < 0 && result > 0)?"Inverted due to negative base":""); return result; } @@ -3383,18 +3383,18 @@ void Mob::BuffProcess() IsMezSpell(buffs[buffs_i].spellid) || IsBlindSpell(buffs[buffs_i].spellid)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } } else if (buffs[buffs_i].ticsremaining < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); + Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has expired. Fading.", buffs[buffs_i].spellid, buffs_i); BuffFadeBySlot(buffs_i); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); + Log.Out(Logs::Detail, Logs::Spells, "Buff %d in slot %d has %d tics remaining.", buffs[buffs_i].spellid, buffs_i, buffs[buffs_i].ticsremaining); } } else if(IsClient() && !(CastToClient()->GetClientVersionBit() & BIT_SoFAndLater)) @@ -3759,7 +3759,7 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses) if (IsClient() && !CastToClient()->IsDead()) CastToClient()->MakeBuffFadePacket(buffs[slot].spellid, slot); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); + Log.Out(Logs::Detail, Logs::Spells, "Fading buff %d from slot %d", buffs[slot].spellid, slot); if(spells[buffs[slot].spellid].viral_targets > 0) { bool last_virus = true; @@ -4817,7 +4817,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo return 0; break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); + Log.Out(Logs::General, Logs::Normal, "CalcFocusEffect: unknown limit spelltype %d", focus_spell.base[i]); } break; @@ -5156,7 +5156,7 @@ int16 Mob::CalcFocusEffect(focusType type, uint16 focus_id, uint16 spell_id, boo //this spits up a lot of garbage when calculating spell focuses //since they have all kinds of extra effects on them. default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); + Log.Out(Logs::General, Logs::Normal, "CalcFocusEffect: unknown effectid %d", focus_spell.effectid[i]); #endif } diff --git a/zone/spells.cpp b/zone/spells.cpp index 570d6ea0e..ddee8f965 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -147,7 +147,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, int32 cast_time, int32 mana_cost, uint32* oSpellWillFinish, uint32 item_slot, uint32 timer, uint32 timer_duration, uint32 type, int16 *resist_adjust) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", + Log.Out(Logs::Detail, Logs::Spells, "CastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item slot %d", spells[spell_id].name, spell_id, target_id, slot, cast_time, mana_cost, (item_slot==0xFFFFFFFF)?999:item_slot); if(casting_spell_id == spell_id) @@ -166,7 +166,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, (IsAmnesiad() && IsDiscipline(spell_id)) ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", + Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: not able to cast now. Valid? %d, casting %d, waiting? %d, spellend? %d, stunned? %d, feared? %d, mezed? %d, silenced? %d, amnesiad? %d", IsValidSpell(spell_id), casting_spell_id, delaytimer, spellend_timer.Enabled(), IsStunned(), IsFeared(), IsMezzed(), IsSilenced(), IsAmnesiad() ); if(IsSilenced() && !IsDiscipline(spell_id)) Message_StringID(13, SILENCED_STRING); @@ -204,7 +204,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, //cannot cast under divine aura if(DivineAura()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); + Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: cannot cast while Divine Aura is in effect."); InterruptSpell(173, 0x121, false); return(false); } @@ -234,7 +234,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, InterruptSpell(fizzle_msg, 0x121, spell_id); uint32 use_mana = ((spells[spell_id].mana) / 4); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); + Log.Out(Logs::Detail, Logs::Spells, "Spell casting canceled: fizzled. %d mana has been consumed", use_mana); // fizzle 1/4 the mana away SetMana(GetMana() - use_mana); @@ -243,7 +243,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, } if (HasActiveSong() && IsBardSong(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); + Log.Out(Logs::Detail, Logs::Spells, "Casting a new song while singing a song. Killing old song %d.", bardsong); //Note: this does NOT tell the client _StopSong(); } @@ -258,7 +258,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_EquipClick) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that requires equipping but shouldn't let them equip it - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", + Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) which they shouldn't be able to equip!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item with an invalid class"); } @@ -270,7 +270,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if ((itm->GetItem()->Click.Type == ET_ClickEffect2) && !(itm->GetItem()->Classes & bitmask)) { if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are casting a spell from an item that they don't meet the race/class requirements to cast - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", + Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click a race/class restricted effect on item %s (id: %d) which they shouldn't be able to click!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking race/class restricted item with an invalid class"); } @@ -291,7 +291,7 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, uint16 slot, if( itm && (itm->GetItem()->Click.Type == ET_EquipClick) && !(item_slot <= MainAmmo || item_slot == MainPowerSource) ){ if (CastToClient()->GetClientVersion() < EQClientSoF) { // They are attempting to cast a must equip clicky without having it equipped - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); + Log.Out(Logs::General, Logs::Error, "HACKER: %s (account: %s) attempted to click an equip-only effect on item %s (id: %d) without equiping it!", CastToClient()->GetCleanName(), CastToClient()->AccountName(), itm->GetItem()->Name, itm->GetItem()->ID); database.SetHackerFlag(CastToClient()->AccountName(), CastToClient()->GetCleanName(), "Clicking equip-only item without equiping it"); } else { @@ -349,7 +349,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, const SPDat_Spell_Struct &spell = spells[spell_id]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", + Log.Out(Logs::Detail, Logs::Spells, "DoCastSpell called for spell %s (%d) on entity %d, slot %d, time %d, mana %d, from item %d", spell.name, spell_id, target_id, slot, cast_time, mana_cost, item_slot==0xFFFFFFFF?999:item_slot); casting_spell_id = spell_id; @@ -363,7 +363,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_type = type; SaveSpellLoc(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); + Log.Out(Logs::Detail, Logs::Spells, "Casting %d Started at (%.3f,%.3f,%.3f)", spell_id, spell_x, spell_y, spell_z); // if this spell doesn't require a target, or if it's an optional target // and a target wasn't provided, then it's us; unless TGB is on and this @@ -375,7 +375,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, spell.targettype == ST_Beam || spell.targettype == ST_TargetOptional) && target_id == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d auto-targeted the caster. Group? %d, target type %d", spell_id, IsGroupSpell(spell_id), spell.targettype); target_id = GetID(); } @@ -392,7 +392,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, // we checked for spells not requiring targets above if(target_id == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell Error: no target. spell=%d\n", GetName(), spell_id); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, SPELL_NEED_TAR); @@ -430,7 +430,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, { mana_cost = 0; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); + Log.Out(Logs::Detail, Logs::Spells, "Spell Error not enough mana spell=%d mymana=%d cost=%d\n", GetName(), spell_id, my_curmana, mana_cost); if(IsClient()) { //clients produce messages... npcs should not for this case Message_StringID(13, INSUFFICIENT_MANA); @@ -451,7 +451,7 @@ bool Mob::DoCastSpell(uint16 spell_id, uint16 target_id, uint16 slot, casting_spell_resist_adjust = resist_adjust; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Casting time %d (orig %d), mana cost %d", spell_id, cast_time, orgcasttime, mana_cost); // cast time is 0, just finish it right now and be done with it @@ -517,7 +517,7 @@ bool Mob::DoCastingChecks() if (RuleB(Spells, BuffLevelRestrictions)) { // casting_spell_targetid is guaranteed to be what we went, check for ST_Self for now should work though if (spell_target && spells[spell_id].targettype != ST_Self && !spell_target->CheckSpellLevelRestriction(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if (!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); return false; @@ -756,7 +756,7 @@ bool Client::CheckFizzle(uint16 spell_id) float fizzle_roll = zone->random.Real(0, 100); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); + Log.Out(Logs::Detail, Logs::Spells, "Check Fizzle %s spell %d fizzlechance: %0.2f%% diff: %0.2f roll: %0.2f", GetName(), spell_id, fizzlechance, diff, fizzle_roll); if(fizzle_roll > fizzlechance) return(true); @@ -816,7 +816,7 @@ void Mob::InterruptSpell(uint16 message, uint16 color, uint16 spellid) ZeroCastingVars(); // resets all the state keeping stuff - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d has been interrupted.", spellid); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d has been interrupted.", spellid); if(!spellid) return; @@ -893,7 +893,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!CastToClient()->GetPTimers().Expired(&database, pTimerSpellStart + spell_id, false)) { //should we issue a message or send them a spell gem packet? Message_StringID(13, SPELL_RECAST); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -907,7 +907,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + itm->GetItem()->RecastType), false)) { Message_StringID(13, SPELL_RECAST); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -916,7 +916,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(!IsValidSpell(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: invalid spell id", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: invalid spell id", spell_id); InterruptSpell(); return; } @@ -927,7 +927,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(delaytimer) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: recast too quickly", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: recast too quickly", spell_id); Message(13, "You are unable to focus."); InterruptSpell(); return; @@ -937,7 +937,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // make sure they aren't somehow casting 2 timed spells at once if (casting_spell_id != spell_id) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: already casting", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: already casting", spell_id); Message_StringID(13,ALREADY_CASTING); InterruptSpell(); return; @@ -952,7 +952,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if (IsBardSong(spell_id)) { if(spells[spell_id].buffduration == 0xFFFF || spells[spell_id].recast_time != 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); + Log.Out(Logs::Detail, Logs::Spells, "Bard song %d not applying bard logic because duration or recast is wrong: dur=%d, recast=%d", spells[spell_id].buffduration, spells[spell_id].recast_time); } else { bardsong = spell_id; bardsong_slot = slot; @@ -962,7 +962,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, else bardsong_target_id = spell_target->GetID(); bardsong_timer.Start(6000); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard song %d started: slot %d, target id %d", bardsong, bardsong_slot, bardsong_target_id); bard_song_mode = true; } } @@ -1041,10 +1041,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); + Log.Out(Logs::Detail, Logs::Spells, "Checking Interruption: spell x: %f spell y: %f cur x: %f cur y: %f channelchance %f channeling skill %d\n", GetSpellX(), GetSpellY(), GetX(), GetY(), channelchance, GetSkill(SkillChanneling)); if(!spells[spell_id].uninterruptable && zone->random.Real(0, 100) > channelchance) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: interrupted.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: interrupted.", spell_id); InterruptSpell(); return; } @@ -1060,10 +1060,10 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(IsClient()) { int reg_focus = CastToClient()->GetFocusEffect(focusReagentCost,spell_id);//Client only if(zone->random.Roll(reg_focus)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Reagent focus item prevented reagent consumption (%d chance)", spell_id, reg_focus); } else { if(reg_focus > 0) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Reagent focus item failed to prevent reagent consumption (%d chance)", spell_id, reg_focus); Client *c = this->CastToClient(); int component, component_count, inv_slot_id; bool missingreags = false; @@ -1116,11 +1116,11 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, break; default: // some non-instrument component. Let it go, but record it in the log - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Something odd happened: Song %d required component %s", spell_id, component); + Log.Out(Logs::Detail, Logs::Spells, "Something odd happened: Song %d required component %s", spell_id, component); } if(!HasInstrument) { // if the instrument is missing, log it and interrupt the song - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); + Log.Out(Logs::Detail, Logs::Spells, "Song %d: Canceled. Missing required instrument %s", spell_id, component); if(c->GetGM()) c->Message(0, "Your GM status allows you to finish casting even though you're missing a required instrument."); else { @@ -1143,12 +1143,12 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, const Item_Struct *item = database.GetItem(component); if(item) { c->Message_StringID(13, MISSING_SPELL_COMP_ITEM, item->Name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, item->Name, component); } else { char TempItemName[64]; strcpy((char*)&TempItemName, "UNKNOWN"); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Canceled. Missing required reagent %s (%d)", spell_id, TempItemName, component); } } } // end bard/not bard ifs @@ -1169,7 +1169,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if (component == -1) continue; component_count = spells[spell_id].component_counts[t_count]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Consuming %d of spell component item id %d", spell_id, component, component_count); // Components found, Deleting // now we go looking for and deleting the items one by one for(int s = 0; s < component_count; s++) @@ -1234,7 +1234,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, { if(!CastToClient()->GetPTimers().Expired(&database, (pTimerItemStart + recasttype), false)) { Message_StringID(13, SPELL_RECAST); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: item spell reuse timer not expired", spell_id); InterruptSpell(); return; } @@ -1253,15 +1253,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, if(fromaug) { charges = -1; } //Don't destroy the parent item if(charges > -1) { // charged item, expend a charge - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Consuming a charge from item %s (%d) which had %d/%d charges.", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetCharges(), inst->GetItem()->MaxCharges); DeleteChargeFromSlot = inventory_slot; } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Cast from unlimited charge item %s (%d) (%d charges)", spell_id, inst->GetItem()->Name, inst->GetItem()->ID, inst->GetItem()->MaxCharges); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); + Log.Out(Logs::Detail, Logs::Spells, "Item used to cast spell %d was missing from inventory slot %d after casting!", spell_id, inventory_slot); Message(13, "Casting Error: Active casting item not found in inventory slot %i", inventory_slot); InterruptSpell(); return; @@ -1280,7 +1280,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, // we're done casting, now try to apply the spell if( !SpellFinished(spell_id, spell_target, slot, mana_used, inventory_slot, resist_adjust) ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Casting of %d canceled: SpellFinished returned false.", spell_id); InterruptSpell(); return; } @@ -1309,7 +1309,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, this->CastToClient()->CheckSongSkillIncrease(spell_id); this->CastToClient()->MemorizeSpell(slot, spell_id, memSpellSpellbar); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard song %d should be started", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard song %d should be started", spell_id); } else { @@ -1344,7 +1344,7 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, uint16 slot, delaytimer = true; spellend_timer.Start(400,true); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell casting of %d is finished.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell casting of %d is finished.", spell_id); } @@ -1391,7 +1391,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce && (IsGrouped() // still self only if not grouped || IsRaidGrouped()) && (HasProjectIllusion())){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); + Log.Out(Logs::Detail, Logs::AA, "Project Illusion overwrote target caster: %s spell id: %d was ON", GetName(), spell_id); targetType = ST_GroupClientAndPet; } @@ -1474,7 +1474,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce ) { //invalid target - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (undead)", spell_id, spell_target->GetBodyType()); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1487,7 +1487,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3)) { //invalid target - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned)", spell_id, body_type); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1501,7 +1501,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || (spell_target != GetPet()) || (body_type != BT_Summoned && body_type != BT_Summoned2 && body_type != BT_Summoned3 && body_type != BT_Animal)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (summoned pet)", spell_id, body_type); Message_StringID(13, SPELL_NEED_TAR); @@ -1526,7 +1526,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target || mob_body != target_bt) { //invalid target - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target of body type %d (want body Type %d)", spell_id, spell_target->GetBodyType(), target_bt); if(!spell_target) Message_StringID(13,SPELL_NEED_TAR); else @@ -1544,7 +1544,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (ldon object)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1552,14 +1552,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target->IsNPC()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } if(spell_target->GetClass() != LDON_TREASURE) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1568,7 +1568,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(!spell_target) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (normal)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (normal)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; // can't cast these unless we have a target } @@ -1580,7 +1580,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target || !spell_target->IsPlayerCorpse()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (corpse)", spell_id); uint32 message = ONLY_ON_CORPSES; if(!spell_target) message = SPELL_NEED_TAR; else if(!spell_target->IsCorpse()) message = ONLY_ON_CORPSES; @@ -1596,7 +1596,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce spell_target = GetPet(); if(!spell_target) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (no pet)", spell_id); Message_StringID(13,NO_PET); return false; // can't cast these unless we have a target } @@ -1666,7 +1666,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (AOE)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1703,7 +1703,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce { if(!spell_target) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: invalid target (Group Required: Single Target)", spell_id); Message_StringID(13,SPELL_NEED_TAR); return false; } @@ -1800,14 +1800,14 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce if(group_id_caster == 0 || group_id_target == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } if(group_id_caster != group_id_target) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d canceled: Attempted to cast a Single Target Group spell on a ungrouped member.", spell_id); Message_StringID(13, TARGET_GROUP_MEMBER); return false; } @@ -1878,7 +1878,7 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce default: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); + Log.Out(Logs::Detail, Logs::Spells, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); Message(0, "I dont know Target Type: %d Spell: (%d) %s", spells[spell_id].targettype, spell_id, spells[spell_id].name); CastAction = CastActUnknown; break; @@ -1957,7 +1957,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) return(false); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: target type %d, target %s, AE center %s", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target // spell that's recast every 2500 msec for AEDuration msec. There are @@ -1968,7 +1968,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 Mob *beacon_loc = spell_target ? spell_target : this; Beacon *beacon = new Beacon(beacon_loc, spells[spell_id].AEDuration); entity_list.AddBeacon(beacon); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: AE duration beacon created, entity id %d", spell_id, beacon->GetName()); spell_target = nullptr; ae_center = beacon; CastAction = AECaster; @@ -1977,7 +1977,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // check line of sight to target if it's a detrimental spell if(!spells[spell_id].npc_no_los && spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target) && !IsHarmonySpell(spell_id) && spells[spell_id].targettype != ST_TargetOptional) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: cannot see target %s", spell_target->GetName()); Message_StringID(13,CANT_SEE_TARGET); return false; } @@ -2008,13 +2008,13 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 float min_range2 = spells[spell_id].min_range * spells[spell_id].min_range; if(dist2 > range2) { //target is out of range. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } else if (dist2 < min_range2){ //target is too close range. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Spell target is too close (squared: %f < %f)", spell_id, dist2, min_range2); Message_StringID(13, TARGET_TOO_CLOSE); return(false); } @@ -2043,7 +2043,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 #endif //BOTS if(spell_target == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Targeted spell, but we have no target", spell_id); return(false); } if (isproc) { @@ -2067,11 +2067,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(IsPlayerIllusionSpell(spell_id) && IsClient() && (HasProjectIllusion())){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); + Log.Out(Logs::Detail, Logs::AA, "Effect Project Illusion for %s on spell id: %d was ON", GetName(), spell_id); SetProjectIllusion(false); } else{ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); + Log.Out(Logs::Detail, Logs::AA, "Effect Project Illusion for %s on spell id: %d was OFF", GetName(), spell_id); } break; } @@ -2235,7 +2235,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 // CastSpell already reduced the cost for it if we're a client with focus if(slot != USE_ITEM_SPELL_SLOT && slot != POTION_BELT_SPELL_SLOT && slot != TARGET_RING_SPELL_SLOT && mana_used > 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: consuming %d mana", spell_id, mana_used); if (!DoHPToManaCovert(mana_used)) SetMana(GetMana() - mana_used); TryTriggerOnValueAmount(false, true); @@ -2247,7 +2247,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(spell_id == casting_spell_id && casting_spell_timer != 0xFFFFFFFF) { CastToClient()->GetPTimers().Start(casting_spell_timer, casting_spell_timer_duration); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Setting custom reuse timer %d to %d", spell_id, casting_spell_timer, casting_spell_timer_duration); } else if(spells[spell_id].recast_time > 1000 && !spells[spell_id].IsDisciplineBuff) { int recast = spells[spell_id].recast_time/1000; @@ -2263,7 +2263,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 if(reduction) recast -= reduction; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Setting long reuse timer to %d s (orig %d)", spell_id, recast, spells[spell_id].recast_time); CastToClient()->GetPTimers().Start(pTimerSpellStart + spell_id, recast); } } @@ -2301,7 +2301,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, uint16 slot, uint16 bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(slot == USE_ITEM_SPELL_SLOT) { //bard songs should never come from items... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Supposidly cast from an item. Killing song.", spell_id); return(false); } @@ -2309,12 +2309,12 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { Mob *ae_center = nullptr; CastAction_type CastAction; if(!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: was unable to determine target. Stopping.", spell_id); return(false); } if(ae_center != nullptr && ae_center->IsBeacon()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Unsupported Beacon NPC AE spell", spell_id); return(false); } @@ -2323,18 +2323,18 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(mana_used > 0) { if(mana_used > GetMana()) { //ran out of mana... this calls StopSong() for us - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Ran out of mana while singing song %d", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Ran out of mana while singing song %d", spell_id); return(false); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: consuming %d mana (have %d)", spell_id, mana_used, GetMana()); SetMana(GetMana() - mana_used); } // check line of sight to target if it's a detrimental spell if(spell_target && IsDetrimentalSpell(spell_id) && !CheckLosFN(spell_target)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: cannot see target %s", spell_target->GetName()); Message_StringID(13, CANT_SEE_TARGET); return(false); } @@ -2349,7 +2349,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { float range2 = range * range; if(dist2 > range2) { //target is out of range. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Spell target is out of range (squared: %f > %f)", spell_id, dist2, range2); Message_StringID(13, TARGET_OUT_OF_RANGE); return(false); } @@ -2365,10 +2365,10 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case SingleTarget: { if(spell_target == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Targeted spell, but we have no target", spell_id); return(false); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse: Targeted. spell %d, target %s", spell_id, spell_target->GetName()); spell_target->BardPulse(spell_id, this); break; } @@ -2386,7 +2386,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { { // we can't cast an AE spell without something to center it on if(ae_center == nullptr) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: AE Targeted spell, but we have no target", spell_id); return(false); } @@ -2394,9 +2394,9 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { if(spell_target) { // this must be an AETarget spell // affect the target too spell_target->BardPulse(spell_id, this); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse: spell %d, AE target %s", spell_id, spell_target->GetName()); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse: spell %d, AE with no target", spell_id); } bool affect_caster = !IsNPC(); //NPC AE spells do not affect the NPC caster entity_list.AEBardPulse(this, ae_center, spell_id, affect_caster); @@ -2406,13 +2406,13 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { case GroupSpell: { if(spell_target->IsGrouped()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse: spell %d, Group targeting group of %s", spell_id, spell_target->GetName()); Group *target_group = entity_list.GetGroupByMob(spell_target); if(target_group) target_group->GroupBardPulse(this, spell_id); } else if(spell_target->IsRaidGrouped() && spell_target->IsClient()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse: spell %d, Raid group targeting raid group of %s", spell_id, spell_target->GetName()); Raid *r = entity_list.GetRaidByClient(spell_target->CastToClient()); if(r){ uint32 gid = r->GetGroup(spell_target->GetName()); @@ -2429,7 +2429,7 @@ bool Mob::ApplyNextBardPulse(uint16 spell_id, Mob *spell_target, uint16 slot) { } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse: spell %d, Group target without group. Affecting caster.", spell_id); BardPulse(spell_id, this); #ifdef GROUP_BUFF_PETS if (GetPet() && HasPetAffinity() && !GetPet()->IsCharmed()) @@ -2455,13 +2455,13 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { if(buffs[buffs_i].spellid != spell_id) continue; if(buffs[buffs_i].casterid != caster->GetID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); + Log.Out(Logs::Detail, Logs::Spells, "Bard Pulse for %d: found buff from caster %d and we are pulsing for %d... are there two bards playing the same song???", spell_id, buffs[buffs_i].casterid, caster->GetID()); return; } //extend the spell if it will expire before the next pulse if(buffs[buffs_i].ticsremaining <= 3) { buffs[buffs_i].ticsremaining += 3; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: extending duration in slot %d to %d tics", spell_id, buffs_i, buffs[buffs_i].ticsremaining); } //should we send this buff update to the client... seems like it would @@ -2559,7 +2559,7 @@ void Mob::BardPulse(uint16 spell_id, Mob *caster) { //we are done... return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Bard Song Pulse %d: Buff not found, reapplying spell.", spell_id); //this spell is not affecting this mob, apply it. caster->SpellOnTarget(spell_id, this); } @@ -2601,7 +2601,7 @@ int Mob::CalcBuffDuration(Mob *caster, Mob *target, uint16 spell_id, int32 caste res = mod_buff_duration(res, caster, target, spell_id); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", + Log.Out(Logs::Detail, Logs::Spells, "Spell %d: Casting level %d, formula %d, base_duration %d: result %d", spell_id, castlevel, formula, duration, res); return(res); @@ -2673,7 +2673,7 @@ int CalcBuffDuration_formula(int level, int formula, int duration) return duration ? duration : 3600; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "CalcBuffDuration_formula: unknown formula %d", formula); + Log.Out(Logs::General, Logs::None, "CalcBuffDuration_formula: unknown formula %d", formula); return 0; } } @@ -2695,15 +2695,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, int blocked_effect, blocked_below_value, blocked_slot; int overwrite_effect, overwrite_below_value, overwrite_slot; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Check Stacking on old %s (%d) @ lvl %d (by %s) vs. new %s (%d) @ lvl %d (by %s)", sp1.name, spellid1, caster_level1, (caster1==nullptr)?"Nobody":caster1->GetName(), sp2.name, spellid2, caster_level2, (caster2==nullptr)?"Nobody":caster2->GetName()); // Same Spells and dot exemption is set to 1 or spell is Manaburn if (spellid1 == spellid2) { if (sp1.dot_stacking_exempt == 1 && caster1 != caster2) { // same caster can refresh - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell due to dot stacking exemption."); + Log.Out(Logs::Detail, Logs::Spells, "Blocking spell due to dot stacking exemption."); return -1; } else if (spellid1 == 2751) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because manaburn does not stack with itself."); + Log.Out(Logs::Detail, Logs::Spells, "Blocking spell because manaburn does not stack with itself."); return -1; } } @@ -2735,7 +2735,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { if(!IsDetrimentalSpell(spellid1) && !IsDetrimentalSpell(spellid2)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); + Log.Out(Logs::Detail, Logs::Spells, "%s and %s are beneficial, and one is a bard song, no action needs to be taken", sp1.name, sp2.name); return (0); } } @@ -2804,16 +2804,16 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp1_value = CalcSpellEffectValue(spellid1, overwrite_slot, caster_level1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", + Log.Out(Logs::Detail, Logs::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d. Old spell has value %d on that slot/effect. %s.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value, sp1_value, (sp1_value < overwrite_below_value)?"Overwriting":"Not overwriting"); if(sp1_value < overwrite_below_value) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); + Log.Out(Logs::Detail, Logs::Spells, "Overwrite spell because sp1_value < overwrite_below_value"); return 1; // overwrite spell if its value is less } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", + Log.Out(Logs::Detail, Logs::Spells, "%s (%d) overwrites existing spell if effect %d on slot %d is below %d, but we do not have that effect on that slot. Ignored.", sp2.name, spellid2, overwrite_effect, overwrite_slot, overwrite_below_value); } @@ -2827,22 +2827,22 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, { sp2_value = CalcSpellEffectValue(spellid2, blocked_slot, caster_level2); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", + Log.Out(Logs::Detail, Logs::Spells, "%s (%d) blocks effect %d on slot %d below %d. New spell has value %d on that slot/effect. %s.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value, sp2_value, (sp2_value < blocked_below_value)?"Blocked":"Not blocked"); if (sp2_value < blocked_below_value) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because sp2_Value < blocked_below_value"); + Log.Out(Logs::Detail, Logs::Spells, "Blocking spell because sp2_Value < blocked_below_value"); return -1; //blocked } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", + Log.Out(Logs::Detail, Logs::Spells, "%s (%d) blocks effect %d on slot %d below %d, but we do not have that effect on that slot. Ignored.", sp1.name, spellid1, blocked_effect, blocked_slot, blocked_below_value); } } } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", + Log.Out(Logs::Detail, Logs::Spells, "%s (%d) and %s (%d) appear to be in the same line, skipping Stacking Overwrite/Blocking checks", sp1.name, spellid1, sp2.name, spellid2); } @@ -2905,13 +2905,13 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(IsNPC() && caster1 && caster2 && caster1 != caster2) { if(effect1 == SE_CurrentHP && sp1_detrimental && sp2_detrimental) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); + Log.Out(Logs::Detail, Logs::Spells, "Both casters exist and are not the same, the effect is a detrimental dot, moving on"); continue; } } if(effect1 == SE_CompleteHeal){ //SE_CompleteHeal never stacks or overwrites ever, always block. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Blocking spell because complete heal never stacks or overwries"); + Log.Out(Logs::Detail, Logs::Spells, "Blocking spell because complete heal never stacks or overwries"); return (-1); } @@ -2923,7 +2923,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, */ if(sp_det_mismatch) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The effects are the same but the spell types are not, passing the effect"); + Log.Out(Logs::Detail, Logs::Spells, "The effects are the same but the spell types are not, passing the effect"); continue; } @@ -2932,7 +2932,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, and the effect is a dot we can go ahead and stack it */ if(effect1 == SE_CurrentHP && spellid1 != spellid2 && sp1_detrimental && sp2_detrimental) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "The spells are not the same and it is a detrimental dot, passing"); + Log.Out(Logs::Detail, Logs::Spells, "The spells are not the same and it is a detrimental dot, passing"); continue; } @@ -2958,7 +2958,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, sp2_value = 0 - sp2_value; if(sp2_value < sp1_value) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", + Log.Out(Logs::Detail, Logs::Spells, "Spell %s (value %d) is not as good as %s (value %d). Rejecting %s.", sp2.name, sp2_value, sp1.name, sp1_value, sp2.name); return -1; // can't stack } @@ -2967,7 +2967,7 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //we dont return here... a better value on this one effect dosent mean they are //all better... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", + Log.Out(Logs::Detail, Logs::Spells, "Spell %s (value %d) is not as good as %s (value %d). We will overwrite %s if there are no other conflicts.", sp1.name, sp1_value, sp2.name, sp2_value, sp1.name); will_overwrite = true; } @@ -2976,15 +2976,15 @@ int Mob::CheckStackConflict(uint16 spellid1, int caster_level1, uint16 spellid2, //so now we see if this new spell is any better, or if its not related at all if(will_overwrite) { if (values_equal && effect_match && !IsGroupSpell(spellid2) && IsGroupSpell(spellid1)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", + Log.Out(Logs::Detail, Logs::Spells, "%s (%d) appears to be the single target version of %s (%d), rejecting", sp2.name, spellid2, sp1.name, spellid1); return -1; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); + Log.Out(Logs::Detail, Logs::Spells, "Stacking code decided that %s should overwrite %s.", sp2.name, sp1.name); return(1); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); + Log.Out(Logs::Detail, Logs::Spells, "Stacking code decided that %s is not affected by %s.", sp2.name, sp1.name); return 0; } @@ -3043,11 +3043,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } if (duration == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Buff %d failed to add because its duration came back as 0.", spell_id); return -2; // no duration? this isn't a buff } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", + Log.Out(Logs::Detail, Logs::Spells, "Trying to add buff %d cast by %s (cast level %d) with duration %d", spell_id, caster?caster->GetName():"UNKNOWN", caster_level, duration); // first we loop through everything checking that the spell @@ -3077,12 +3077,12 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid ret = CheckStackConflict(curbuf.spellid, curbuf.casterlevel, spell_id, caster_level, entity_list.GetMobID(curbuf.casterid), caster, buffslot); if (ret == -1) { // stop the spell - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", + Log.Out(Logs::Detail, Logs::Spells, "Adding buff %d failed: stacking prevented by spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); return -1; } if (ret == 1) { // set a flag to indicate that there will be overwriting - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", + Log.Out(Logs::Detail, Logs::Spells, "Adding buff %d will overwrite spell %d in slot %d with caster level %d", spell_id, curbuf.spellid, buffslot, curbuf.casterlevel); // If this is the first buff it would override, use its slot if (!will_overwrite) @@ -3106,7 +3106,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid for (buffslot = 0; buffslot < buff_count; buffslot++) { const Buffs_Struct &curbuf = buffs[buffslot]; if (IsBeneficialSpell(curbuf.spellid)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", + Log.Out(Logs::Detail, Logs::Spells, "No slot for detrimental buff %d, so we are overwriting a beneficial buff %d in slot %d", spell_id, curbuf.spellid, buffslot); BuffFadeBySlot(buffslot, false); emptyslot = buffslot; @@ -3114,11 +3114,11 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid } } if(emptyslot == -1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Unable to find a buff slot for detrimental buff %d", spell_id); return -1; } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Unable to find a buff slot for beneficial buff %d", spell_id); return -1; } } @@ -3169,7 +3169,7 @@ int Mob::AddBuff(Mob *caster, uint16 spell_id, int duration, int32 level_overrid buffs[emptyslot].UpdateClient = true; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); + Log.Out(Logs::Detail, Logs::Spells, "Buff %d added to slot %d with caster level %d", spell_id, emptyslot, caster_level); if (IsPet() && GetOwner() && GetOwner()->IsClient()) SendPetBuffsToClient(); @@ -3207,7 +3207,7 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) { int i, ret, firstfree = -2; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); + Log.Out(Logs::Detail, Logs::AI, "Checking if buff %d cast at level %d can stack on me.%s", spellid, caster_level, iFailIfOverwrite?" failing if we would overwrite something":""); int buff_count = GetMaxTotalSlots(); for (i=0; i < buff_count; i++) @@ -3231,19 +3231,19 @@ int Mob::CanBuffStack(uint16 spellid, uint8 caster_level, bool iFailIfOverwrite) if(ret == 1) { // should overwrite current slot if(iFailIfOverwrite) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.Out(Logs::Detail, Logs::AI, "Buff %d would overwrite %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return(-1); } if(firstfree == -2) firstfree = i; } if(ret == -1) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); + Log.Out(Logs::Detail, Logs::AI, "Buff %d would conflict with %d in slot %d, reporting stack failure", spellid, curbuf.spellid, i); return -1; // stop the spell, can't stack it } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); + Log.Out(Logs::Detail, Logs::AI, "Reporting that buff %d could successfully be placed into slot %d", spellid, firstfree); return firstfree; } @@ -3270,7 +3270,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // well we can't cast a spell on target without a target if(!spelltar) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Unable to apply spell %d without a target", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Unable to apply spell %d without a target", spell_id); Message(13, "SOT: You must have a target for this spell."); return false; } @@ -3298,7 +3298,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r uint16 caster_level = GetCasterLevel(spell_id); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); + Log.Out(Logs::Detail, Logs::Spells, "Casting spell %d on %s with effective caster level %d", spell_id, spelltar->GetName(), caster_level); // Actual cast action - this causes the caster animation and the particles // around the target @@ -3378,7 +3378,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Spells, EnableBlockedBuffs)) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", + Log.Out(Logs::Detail, Logs::Spells, "Spell %i not applied to %s as it is a Blocked Buff.", spell_id, spelltar->GetName()); safe_delete(action_packet); return true; @@ -3386,7 +3386,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBlockedPetBuff(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", + Log.Out(Logs::Detail, Logs::Spells, "Spell %i not applied to %s (%s's pet) as it is a Pet Blocked Buff.", spell_id, spelltar->GetName(), spelltar->GetOwner()->GetName()); safe_delete(action_packet); return true; @@ -3395,7 +3395,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // invuln mobs can't be affected by any spells, good or bad if(spelltar->GetInvul() || spelltar->DivineAura()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Casting spell %d on %s aborted: they are invulnerable.", spell_id, spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3406,17 +3406,17 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (RuleB(Pets, UnTargetableSwarmPet)) { if (spelltar->IsNPC()) { if (!spelltar->CastToNPC()->GetSwarmOwner()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Casting spell %d on %s aborted: they are untargetable", spell_id, spelltar->GetName()); safe_delete(action_packet); return(false); } @@ -3525,9 +3525,9 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spells[spell_id].targettype == ST_AEBard) { //if it was a beneficial AE bard song don't spam the window that it would not hold - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.Out(Logs::Detail, Logs::Spells, "Beneficial ae bard song %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); + Log.Out(Logs::Detail, Logs::Spells, "Beneficial spell %d can't take hold %s -> %s, IBA? %d", spell_id, GetName(), spelltar->GetName(), IsBeneficialAllowed(spelltar)); Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); } safe_delete(action_packet); @@ -3537,7 +3537,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r } else if ( !IsAttackAllowed(spelltar, true) && !IsResurrectionEffects(spell_id)) // Detrimental spells - PVP check { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Detrimental spell %d can't take hold %s -> %s", spell_id, GetName(), spelltar->GetName()); spelltar->Message_StringID(MT_SpellFailure, YOU_ARE_PROTECTED, GetCleanName()); safe_delete(action_packet); return false; @@ -3551,7 +3551,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if(spelltar->IsImmuneToSpell(spell_id, this)) { //the above call does the message to the client if needed - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d can't take hold due to immunity %s -> %s", spell_id, GetName(), spelltar->GetName()); safe_delete(action_packet); return false; } @@ -3644,7 +3644,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { if(spell_effectiveness == 0 || !IsPartialCapableSpell(spell_id) ) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d was completely resisted by %s", spell_id, spelltar->GetName()); if (spells[spell_id].resisttype == RESIST_PHYSICAL){ Message_StringID(MT_SpellFailure, PHYSICAL_RESIST_FAIL,spells[spell_id].name); @@ -3692,7 +3692,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r if (spelltar->IsAIControlled() && IsDetrimentalSpell(spell_id) && !IsHarmonySpell(spell_id)) { int32 aggro_amount = CheckAggroAmount(spell_id, isproc); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d cast on %s generated %d hate", spell_id, spelltar->GetName(), aggro_amount); if(aggro_amount > 0) spelltar->AddToHateList(this, aggro_amount); else{ int32 newhate = spelltar->GetHateAmount(this) + aggro_amount; @@ -3709,7 +3709,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r // make sure spelltar is high enough level for the buff if(RuleB(Spells, BuffLevelRestrictions) && !spelltar->CheckSpellLevelRestriction(spell_id)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d failed: recipient did not meet the level restrictions", spell_id); if(!IsBardSong(spell_id)) Message_StringID(MT_SpellFailure, SPELL_TOO_POWERFUL); safe_delete(action_packet); @@ -3721,7 +3721,7 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r { // if SpellEffect returned false there's a problem applying the // spell. It's most likely a buff that can't stack. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d could not apply its effects %s -> %s\n", spell_id, GetName(), spelltar->GetName()); if(casting_spell_type != 1) // AA is handled differently Message_StringID(MT_SpellFailure, SPELL_NO_HOLD); safe_delete(action_packet); @@ -3825,14 +3825,14 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r safe_delete(action_packet); safe_delete(message_packet); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Cast of %d by %s on %s complete successfully.", spell_id, GetName(), spelltar->GetName()); return true; } void Corpse::CastRezz(uint16 spellid, Mob* Caster) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); + Log.Out(Logs::Detail, Logs::Spells, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,IsRezzed(),rez_experience); if(IsRezzed()){ if(Caster && Caster->IsClient()) @@ -4005,7 +4005,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) //this spell like 10 times, this could easily be consolidated //into one loop through with a switch statement. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Checking to see if we are immune to spell %d cast by %s", spell_id, caster->GetName()); if(!IsValidSpell(spell_id)) return true; @@ -4016,7 +4016,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(IsMezSpell(spell_id)) { if(GetSpecialAbility(UNMEZABLE)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Mez spells."); + Log.Out(Logs::Detail, Logs::Spells, "We are immune to Mez spells."); caster->Message_StringID(MT_Shout, CANNOT_MEZ); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4034,7 +4034,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if((GetLevel() > spells[spell_id].max[effect_index]) && (!caster->IsNPC() || (caster->IsNPC() && !RuleB(Spells, NPCIgnoreBaseImmunity)))) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.Out(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Mez spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_MEZ_WITH_SPELL); return true; } @@ -4043,7 +4043,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) // slow and haste spells if(GetSpecialAbility(UNSLOWABLE) && IsEffectInSpell(spell_id, SE_AttackSpeed)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Slow spells."); + Log.Out(Logs::Detail, Logs::Spells, "We are immune to Slow spells."); caster->Message_StringID(MT_Shout, IMMUNE_ATKSPEED); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4059,7 +4059,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { effect_index = GetSpellEffectIndex(spell_id, SE_Fear); if(GetSpecialAbility(UNFEARABLE)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Fear spells."); + Log.Out(Logs::Detail, Logs::Spells, "We are immune to Fear spells."); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4070,13 +4070,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) return true; } else if(IsClient() && caster->IsClient() && (caster->CastToClient()->GetGM() == false)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients cannot fear eachother!"); + Log.Out(Logs::Detail, Logs::Spells, "Clients cannot fear eachother!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } else if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); + Log.Out(Logs::Detail, Logs::Spells, "Level is %d, cannot be feared by this spell.", GetLevel()); caster->Message_StringID(MT_Shout, FEAR_TOO_HIGH); int32 aggro = caster->CheckAggroAmount(spell_id); if (aggro > 0) { @@ -4090,7 +4090,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) else if (IsClient() && CastToClient()->CheckAAEffect(aaEffectWarcry)) { Message(13, "Your are immune to fear."); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Clients has WarCry effect, immune to fear!"); + Log.Out(Logs::Detail, Logs::Spells, "Clients has WarCry effect, immune to fear!"); caster->Message_StringID(MT_Shout, IMMUNE_FEAR); return true; } @@ -4100,7 +4100,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(GetSpecialAbility(UNCHARMABLE)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Charm spells."); + Log.Out(Logs::Detail, Logs::Spells, "We are immune to Charm spells."); caster->Message_StringID(MT_Shout, CANNOT_CHARM); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4113,7 +4113,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) if(this == caster) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You are immune to your own charms."); + Log.Out(Logs::Detail, Logs::Spells, "You are immune to your own charms."); caster->Message(MT_Shout, "You cannot charm yourself."); return true; } @@ -4126,7 +4126,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) assert(effect_index >= 0); if(GetLevel() > spells[spell_id].max[effect_index] && spells[spell_id].max[effect_index] != 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); + Log.Out(Logs::Detail, Logs::Spells, "Our level (%d) is higher than the limit of this Charm spell (%d)", GetLevel(), spells[spell_id].max[effect_index]); caster->Message_StringID(MT_Shout, CANNOT_CHARM_YET); return true; } @@ -4140,7 +4140,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) ) { if(GetSpecialAbility(UNSNAREABLE)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to Snare spells."); + Log.Out(Logs::Detail, Logs::Spells, "We are immune to Snare spells."); caster->Message_StringID(MT_Shout, IMMUNE_MOVEMENT); int32 aggro = caster->CheckAggroAmount(spell_id); if(aggro > 0) { @@ -4156,7 +4156,7 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot lifetap yourself."); + Log.Out(Logs::Detail, Logs::Spells, "You cannot lifetap yourself."); caster->Message_StringID(MT_Shout, CANT_DRAIN_SELF); return true; } @@ -4166,13 +4166,13 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster) { if(this == caster) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "You cannot sacrifice yourself."); + Log.Out(Logs::Detail, Logs::Spells, "You cannot sacrifice yourself."); caster->Message_StringID(MT_Shout, CANNOT_SAC_SELF); return true; } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "No immunities to spell %d found.", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "No immunities to spell %d found.", spell_id); return false; } @@ -4209,7 +4209,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use if(GetSpecialAbility(IMMUNE_MAGIC)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); + Log.Out(Logs::Detail, Logs::Spells, "We are immune to magic, so we fully resist the spell %d", spell_id); return(0); } @@ -4230,7 +4230,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int fear_resist_bonuses = CalcFearResistChance(); if(zone->random.Roll(fear_resist_bonuses)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); + Log.Out(Logs::Detail, Logs::Spells, "Resisted spell in fear resistance, had %d chance to resist", fear_resist_bonuses); return 0; } } @@ -4248,7 +4248,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use int resist_bonuses = CalcResistChanceBonus(); if(resist_bonuses && zone->random.Roll(resist_bonuses)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); + Log.Out(Logs::Detail, Logs::Spells, "Resisted spell in sanctification, had %d chance to resist", resist_bonuses); return 0; } } @@ -4256,7 +4256,7 @@ float Mob::ResistSpell(uint8 resist_type, uint16 spell_id, Mob *caster, bool use //Get the resist chance for the target if(resist_type == RESIST_NONE) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell was unresistable"); + Log.Out(Logs::Detail, Logs::Spells, "Spell was unresistable"); return 100; } @@ -4822,7 +4822,7 @@ void Client::MemSpell(uint16 spell_id, int slot, bool update_client) } m_pp.mem_spells[slot] = spell_id; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d memorized into slot %d", spell_id, slot); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d memorized into slot %d", spell_id, slot); database.SaveCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4837,7 +4837,7 @@ void Client::UnmemSpell(int slot, bool update_client) if(slot > MAX_PP_MEMSPELL || slot < 0) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d forgotten from slot %d", m_pp.mem_spells[slot], slot); m_pp.mem_spells[slot] = 0xFFFFFFFF; database.DeleteCharacterMemorizedSpell(this->CharacterID(), m_pp.mem_spells[slot], slot); @@ -4870,7 +4870,7 @@ void Client::ScribeSpell(uint16 spell_id, int slot, bool update_client) m_pp.spell_book[slot] = spell_id; database.SaveCharacterSpell(this->CharacterID(), spell_id, slot); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d scribed into spell book slot %d", spell_id, slot); if(update_client) { @@ -4883,7 +4883,7 @@ void Client::UnscribeSpell(int slot, bool update_client) if(slot >= MAX_PP_SPELLBOOK || slot < 0) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); + Log.Out(Logs::Detail, Logs::Spells, "Spell %d erased from spell book slot %d", m_pp.spell_book[slot], slot); m_pp.spell_book[slot] = 0xFFFFFFFF; database.DeleteCharacterSpell(this->CharacterID(), m_pp.spell_book[slot], slot); @@ -4914,7 +4914,7 @@ void Client::UntrainDisc(int slot, bool update_client) if(slot >= MAX_PP_DISCIPLINES || slot < 0) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); + Log.Out(Logs::Detail, Logs::Spells, "Discipline %d untrained from slot %d", m_pp.disciplines.values[slot], slot); m_pp.disciplines.values[slot] = 0; database.DeleteCharacterDisc(this->CharacterID(), slot); @@ -4963,7 +4963,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } @@ -4982,12 +4982,12 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { char_ID, spell_Global_Name.c_str()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); + Log.Out(Logs::General, Logs::Error, "Spell ID %i query of spell_globals with Name: '%s' Value: '%i' failed", spell_ID, spell_Global_Name.c_str(), spell_Global_Value); return false; } if (results.RowCount() != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); + Log.Out(Logs::General, Logs::Error, "Char ID: %i does not have the Qglobal Name: '%s' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_ID); return false; } @@ -5001,7 +5001,7 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { return true; // Check if the qglobal value is greater than the require spellglobal value // If no matching result found in qglobals, don't scribe this spell - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); + Log.Out(Logs::General, Logs::Error, "Char ID: %i Spell_globals Name: '%s' Value: '%i' did not match QGlobal Value: '%i' for Spell ID %i", char_ID, spell_Global_Name.c_str(), spell_Global_Value, global_Value, spell_ID); return false; } @@ -5040,7 +5040,7 @@ bool Mob::FindType(uint16 type, bool bOffensive, uint16 threshold) { spells[buffs[i].spellid].base[j], spells[buffs[i].spellid].max[j], buffs[i].casterlevel, buffs[i].spellid); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, + Log.Out(Logs::General, Logs::Normal, "FindType: type = %d; value = %d; threshold = %d", type, value, threshold); if (value < threshold) @@ -5089,23 +5089,23 @@ bool Mob::AddProcToWeapon(uint16 spell_id, bool bPerma, uint16 iChance, uint16 b PermaProcs[i].spellID = spell_id; PermaProcs[i].chance = iChance; PermaProcs[i].base_spellID = base_spell_id; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(Logs::Detail, Logs::Spells, "Added permanent proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many perma procs for %s", GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Too many perma procs for %s", GetName()); } else { for (i = 0; i < MAX_PROCS; i++) { if (SpellProcs[i].spellID == SPELL_UNKNOWN) { SpellProcs[i].spellID = spell_id; SpellProcs[i].chance = iChance; SpellProcs[i].base_spellID = base_spell_id;; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(Logs::Detail, Logs::Spells, "Added spell-granted proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Too many procs for %s", GetName()); + Log.Out(Logs::Detail, Logs::Spells, "Too many procs for %s", GetName()); } return false; } @@ -5116,7 +5116,7 @@ bool Mob::RemoveProcFromWeapon(uint16 spell_id, bool bAll) { SpellProcs[i].spellID = SPELL_UNKNOWN; SpellProcs[i].chance = 0; SpellProcs[i].base_spellID = SPELL_UNKNOWN; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed proc %d from slot %d", spell_id, i); + Log.Out(Logs::Detail, Logs::Spells, "Removed proc %d from slot %d", spell_id, i); } } return true; @@ -5133,7 +5133,7 @@ bool Mob::AddDefensiveProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id DefensiveProcs[i].spellID = spell_id; DefensiveProcs[i].chance = iChance; DefensiveProcs[i].base_spellID = base_spell_id; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(Logs::Detail, Logs::Spells, "Added spell-granted defensive proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5148,7 +5148,7 @@ bool Mob::RemoveDefensiveProc(uint16 spell_id, bool bAll) DefensiveProcs[i].spellID = SPELL_UNKNOWN; DefensiveProcs[i].chance = 0; DefensiveProcs[i].base_spellID = SPELL_UNKNOWN; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed defensive proc %d from slot %d", spell_id, i); + Log.Out(Logs::Detail, Logs::Spells, "Removed defensive proc %d from slot %d", spell_id, i); } } return true; @@ -5165,7 +5165,7 @@ bool Mob::AddRangedProc(uint16 spell_id, uint16 iChance, uint16 base_spell_id) RangedProcs[i].spellID = spell_id; RangedProcs[i].chance = iChance; RangedProcs[i].base_spellID = base_spell_id; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); + Log.Out(Logs::Detail, Logs::Spells, "Added spell-granted ranged proc spell %d with chance %d to slot %d", spell_id, iChance, i); return true; } } @@ -5180,7 +5180,7 @@ bool Mob::RemoveRangedProc(uint16 spell_id, bool bAll) RangedProcs[i].spellID = SPELL_UNKNOWN; RangedProcs[i].chance = 0; RangedProcs[i].base_spellID = SPELL_UNKNOWN;; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Removed ranged proc %d from slot %d", spell_id, i); + Log.Out(Logs::Detail, Logs::Spells, "Removed ranged proc %d from slot %d", spell_id, i); } } return true; @@ -5211,7 +5211,7 @@ bool Mob::UseBardSpellLogic(uint16 spell_id, int slot) int Mob::GetCasterLevel(uint16 spell_id) { int level = GetLevel(); level += itembonuses.effective_casting_level + spellbonuses.effective_casting_level + aabonuses.effective_casting_level; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); + Log.Out(Logs::Detail, Logs::Spells, "Determined effective casting level %d+%d+%d=%d", GetLevel(), spellbonuses.effective_casting_level, itembonuses.effective_casting_level, level); return(level); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 97000189b..47155d62f 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -74,7 +74,7 @@ bool TaskManager::LoadTaskSets() { MAXTASKSETS, MAXTASKS); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS]Error in TaskManager::LoadTaskSets: %s", results.ErrorMessage().c_str()); return false; } @@ -83,7 +83,7 @@ bool TaskManager::LoadTaskSets() { int taskID = atoi(row[1]); TaskSets[taskSet].push_back(taskID); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Adding TaskID %4i to TaskSet %4i", taskID, taskSet); } return true; @@ -91,7 +91,7 @@ bool TaskManager::LoadTaskSets() { bool TaskManager::LoadSingleTask(int TaskID) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] TaskManager::LoadSingleTask(%i)", TaskID); if((TaskID <= 0) || (TaskID >= MAXTASKS)) return false; @@ -115,21 +115,21 @@ bool TaskManager::LoadSingleTask(int TaskID) { void TaskManager::ReloadGoalLists() { if(!GoalListManager.LoadLists()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.Out(Logs::Detail, Logs::Tasks,"TaskManager::LoadTasks LoadLists failed"); } bool TaskManager::LoadTasks(int singleTask) { // If TaskID !=0, then just load the task specified. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] TaskManager::LoadTasks Called"); std::string query; if(singleTask == 0) { if(!GoalListManager.LoadLists()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadLists failed"); + Log.Out(Logs::Detail, Logs::Tasks,"TaskManager::LoadTasks LoadLists failed"); if(!LoadTaskSets()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); + Log.Out(Logs::Detail, Logs::Tasks,"TaskManager::LoadTasks LoadTaskSets failed"); query = StringFormat("SELECT `id`, `duration`, `title`, `description`, `reward`, " "`rewardid`, `cashreward`, `xpreward`, `rewardmethod`, " @@ -146,7 +146,7 @@ bool TaskManager::LoadTasks(int singleTask) { auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -155,7 +155,7 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Task ID %i out of range while loading tasks from database", taskID); continue; } @@ -179,11 +179,11 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->SequenceMode = ActivitiesSequential; Tasks[taskID]->LastStep = 0; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] TaskID: %5i, Duration: %8i, StartZone: %3i Reward: %s MinLevel %i MaxLevel %i Repeatable: %s", taskID, Tasks[taskID]->Duration, Tasks[taskID]->StartZone, Tasks[taskID]->Reward, Tasks[taskID]->MinLevel, Tasks[taskID]->MaxLevel, Tasks[taskID]->Repeatable ? "Yes" : "No"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Title: %s", Tasks[taskID]->Title); } @@ -203,7 +203,7 @@ bool TaskManager::LoadTasks(int singleTask) { "ORDER BY taskid, activityid ASC", singleTask, MAXACTIVITIESPERTASK); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); return false; } @@ -215,13 +215,13 @@ bool TaskManager::LoadTasks(int singleTask) { if((taskID <= 0) || (taskID >= MAXTASKS) || (activityID < 0) || (activityID >= MAXACTIVITIESPERTASK)) { // This shouldn't happen, as the SELECT is bounded by MAXTASKS - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " + Log.Out(Logs::General, Logs::Error, "[TASKS]Task or Activity ID (%i, %i) out of range while loading " "activities from database", taskID, activityID); continue; } if(Tasks[taskID]==nullptr) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Activity for non-existent task (%i, %i) while loading activities from database", taskID, activityID); continue; } @@ -238,7 +238,7 @@ bool TaskManager::LoadTasks(int singleTask) { // ERR_NOTASK errors. // Change to (activityID != (Tasks[taskID]->ActivityCount + 1)) to index from 1 if(activityID != Tasks[taskID]->ActivityCount) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Activities for Task %i are not sequential starting at 0. Not loading task.", taskID, activityID); Tasks[taskID] = nullptr; continue; } @@ -273,7 +273,7 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID = atoi(row[11]); Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Optional = atoi(row[12]); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Activity Slot %2i: ID %i for Task %5i. Type: %3i, GoalID: %8i, " "GoalMethod: %i, GoalCount: %3i, ZoneID:%3i", Tasks[taskID]->ActivityCount, activityID, taskID, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Type, @@ -282,9 +282,9 @@ bool TaskManager::LoadTasks(int singleTask) { Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].GoalCount, Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].ZoneID); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Text1: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text1); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Text2: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text2); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Text3: %s", Tasks[taskID]->Activity[Tasks[taskID]->ActivityCount].Text3); Tasks[taskID]->ActivityCount++; } @@ -306,7 +306,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { int characterID = c->CharacterID(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); + Log.Out(Logs::Detail, Logs::Tasks,"TaskManager::SaveClientState for character ID %d", characterID); if(state->ActiveTaskCount > 0) { for(int task=0; taskActiveTasks[task].Updated) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState for character ID %d, Updating TaskIndex %i TaskID %i", characterID, task, taskID); std::string query = StringFormat("REPLACE INTO character_tasks (charid, taskid, slot, acceptedtime) " "VALUES (%i, %i, %i, %i)", characterID, taskID, task, state->ActiveTasks[task].AcceptedTime); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); else state->ActiveTasks[task].Updated = false; @@ -338,7 +338,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(!state->ActiveTasks[task].Activity[activityIndex].Updated) continue; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", + Log.Out(Logs::General, Logs::Tasks, "[CLIENTSAVE] TaskManager::SaveClientSate for character ID %d, Updating Activity %i, %i", characterID, task, activityIndex); if(updatedActivityCount==0) @@ -358,11 +358,11 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { if(updatedActivityCount == 0) continue; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTSAVE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -383,7 +383,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { for(unsigned int i=state->LastCompletedTaskLoaded; iCompletedTasks.size(); i++) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTSAVE] TaskManager::SaveClientState Saving Completed Task at slot %i", i); int taskID = state->CompletedTasks[i].TaskID; if((taskID <= 0) || (taskID >= MAXTASKS) || (Tasks[taskID] == nullptr)) @@ -396,7 +396,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { std::string query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, -1); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); continue; } @@ -413,7 +413,7 @@ bool TaskManager::SaveClientState(Client *c, ClientTaskState *state) { query = StringFormat(completedTaskQuery, characterID, state->CompletedTasks[i].CompletedTime, taskID, j); results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, results.ErrorMessage().c_str()); } @@ -459,14 +459,14 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTaskCount = 0; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState for character ID %d", characterID); std::string query = StringFormat("SELECT `taskid`, `slot`, `acceptedtime` " "FROM `character_tasks` " "WHERE `charid` = %i ORDER BY acceptedtime", characterID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS]Error in TaskManager::LoadClientState load Tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -475,17 +475,17 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int slot = atoi(row[1]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Task ID %i out of range while loading character tasks from database", taskID); continue; } if((slot<0) || (slot>=MAXACTIVETASKS)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); + Log.Out(Logs::General, Logs::Error, "[TASKS] Slot %i out of range while loading character tasks from database", slot); continue; } if(state->ActiveTasks[slot].TaskID != TASKSLOTEMPTY) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS] Slot %i for Task %is is already occupied.", slot, taskID); continue; } @@ -501,11 +501,11 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { ++state->ActiveTaskCount; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, Accepted Time: %8X", characterID, taskID, acceptedtime); } // Load Activities - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] LoadClientState. Loading activities for character ID %d", characterID); query = StringFormat("SELECT `taskid`, `activityid`, `donecount`, `completed` " "FROM `character_activities` " @@ -513,20 +513,20 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "ORDER BY `taskid` ASC, `activityid` ASC", characterID); results = database.QueryDatabase(query); if (!results.Success()){ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS]Error in TaskManager::LoadClientState load Activities: %s", results.ErrorMessage().c_str()); return false; } for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); if((taskID<0) || (taskID>=MAXTASKS)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Task ID %i out of range while loading character activities from database", taskID); continue; } int activityID = atoi(row[1]); if((activityID<0) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Activity ID %i out of range while loading character activities from database", activityID); continue; } @@ -540,7 +540,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { } if(activeTaskIndex == -1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Activity %i found for task %i which client does not have.", activityID, taskID); continue; } @@ -555,7 +555,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { state->ActiveTasks[activeTaskIndex].Activity[activityID].Updated = false; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] TaskManager::LoadClientState. Char: %i Task ID %i, ActivityID: %i, DoneCount: %i, Completed: %i", characterID, taskID, activityID, doneCount, completed); } @@ -566,7 +566,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS]Error in TaskManager::LoadClientState load completed tasks: %s", results.ErrorMessage().c_str()); return false; } @@ -582,7 +582,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { int taskID = atoi(row[0]); if((taskID <= 0) || (taskID >=MAXTASKS)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Task ID %i out of range while loading completed tasks from database", taskID); continue; } @@ -592,7 +592,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { // completed. int activityID = atoi(row[1]); if((activityID<-1) || (activityID>=MAXACTIVITIESPERTASK)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Activity ID %i out of range while loading completed tasks from database", activityID); continue; } @@ -634,12 +634,12 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { characterID, MAXTASKS); results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS]Error in TaskManager::LoadClientState load enabled tasks: %s", results.ErrorMessage().c_str()); else for (auto row = results.begin(); row != results.end(); ++row) { int taskID = atoi(row[0]); state->EnabledTasks.push_back(taskID); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] Adding TaskID %i to enabled tasks", taskID); } // Check that there is an entry in the client task state for every activity in each task @@ -652,7 +652,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { c->Message(13, "Active Task Slot %i, references a task (%i), that does not exist. " "Removing from memory. Contact a GM to resolve this.",i, taskID); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); + Log.Out(Logs::General, Logs::Error, "[TASKS]Character %i has task %i which does not exist.", characterID, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; continue; @@ -664,7 +664,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { "Removing from memory. Contact a GM to resolve this.", taskID, Tasks[taskID]->Title); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " + Log.Out(Logs::General, Logs::Error, "[TASKS]Fatal error in character %i task state. Activity %i for " "Task %i either missing from client state or from task.", characterID, j, taskID); state->ActiveTasks[i].TaskID=TASKSLOTEMPTY; break; @@ -676,7 +676,7 @@ bool TaskManager::LoadClientState(Client *c, ClientTaskState *state) { if(state->ActiveTasks[i].TaskID != TASKSLOTEMPTY) state->UnlockActivities(characterID, i); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); + Log.Out(Logs::General, Logs::Tasks, "[CLIENTLOAD] LoadClientState for Character ID %d DONE!", characterID); return true; } @@ -710,9 +710,9 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { } } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] New enabled task list "); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] New enabled task list "); for(unsigned int i=0; iGetLevel(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskSetSelector called for taskset %i. EnableTaskSize is %i", TaskSetID, state->EnabledTasks.size()); if((TaskSetID<=0) || (TaskSetID>=MAXTASKSETS)) return; @@ -918,7 +918,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i if(TaskSets[TaskSetID][0] == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskSets[%i][0] == 0. All Tasks in Set enabled.", TaskSetID); std::vector::iterator Iterator = TaskSets[TaskSetID].begin(); while((Iterator != TaskSets[TaskSetID].end()) && (TaskListIndex < MAXCHOOSERENTRIES)) { @@ -941,7 +941,7 @@ void TaskManager::TaskSetSelector(Client *c, ClientTaskState *state, Mob *mob, i while((EnabledTaskIndex < state->EnabledTasks.size()) && (TaskSetIndex < TaskSets[TaskSetID].size()) && (TaskListIndex < MAXCHOOSERENTRIES)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Comparing EnabledTasks[%i] (%i) with TaskSets[%i][%i] (%i)", EnabledTaskIndex, state->EnabledTasks[EnabledTaskIndex], TaskSetID, TaskSetIndex, TaskSets[TaskSetID][TaskSetIndex]); @@ -981,7 +981,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task return; } // Titanium OpCode: 0x5e7c - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); char *Ptr; int PlayerLevel = c->GetLevel(); @@ -1106,7 +1106,7 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *TaskList) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskSelector for %i Tasks", TaskCount); int PlayerLevel = c->GetLevel(); @@ -1275,16 +1275,16 @@ int ClientTaskState::GetActiveTaskID(int index) { static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] DeleteCompletedTasksFromDatabase. CharID = %i, TaskID = %i", charID, taskID); const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Delete query %s", query.c_str()); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Delete query %s", query.c_str()); } bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { @@ -1298,7 +1298,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // On loading the client state, all activities that are not completed, are // marked as hidden. For Sequential (non-stepped) mode, we mark the first // activity as active if not complete. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] CharID: %i Task: %i Sequence mode is %i", CharID, ActiveTasks[TaskIndex].TaskID, Task->SequenceMode); if(Task->SequenceMode == ActivitiesSequential) { @@ -1320,7 +1320,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { } if(AllActivitiesComplete && RuleB(TaskSystem, RecordCompletedTasks)) { if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1332,7 +1332,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1349,7 +1349,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { CompletedTasks.push_back(cti); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Returning sequential task, AllActivitiesComplete is %i", AllActivitiesComplete); return AllActivitiesComplete; } @@ -1358,7 +1358,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { bool CurrentStepComplete = true; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Current Step is %i, Last Step is %i", ActiveTasks[TaskIndex].CurrentStep, Task->LastStep); // If CurrentStep is -1, this is the first call to this method since loading the // client state. Unlock all activities with a step number of 0 if(ActiveTasks[TaskIndex].CurrentStep == -1) { @@ -1393,7 +1393,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { // If we are only keeping one completed record per task, and the player has done // the same task again, erase the previous completed entry for this task. if(RuleB(TasksSystem, KeepOneRecordPerCompletedTask)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] KeepOneRecord enabled"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] KeepOneRecord enabled"); std::vector::iterator Iterator = CompletedTasks.begin(); int ErasedElements = 0; while(Iterator != CompletedTasks.end()) { @@ -1405,7 +1405,7 @@ bool ClientTaskState::UnlockActivities(int CharID, int TaskIndex) { else ++Iterator; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Erased Element count is %i", ErasedElements); if(ErasedElements) { LastCompletedTaskLoaded -= ErasedElements; DeleteCompletedTaskFromDatabase(CharID, ActiveTasks[TaskIndex].TaskID); @@ -1455,7 +1455,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI int Ret = false; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState::UpdateTasks for NPCTypeID: %d", NPCTypeID); // If the client has no tasks, there is nothing further to check. @@ -1477,7 +1477,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI if(Task->Activity[j].Type != ActivityType) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Char: %s Task: %i, Activity %i, Activity type %i for NPC %i failed zone check", c->GetName(), ActiveTasks[i].TaskID, j, ActivityType, NPCTypeID); continue; } @@ -1498,7 +1498,7 @@ bool ClientTaskState::UpdateTasksByNPC(Client *c, int ActivityType, int NPCTypeI continue; } // We found an active task to kill this type of NPC, so increment the done count - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ByNPC"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Calling increment done count ByNPC"); IncrementDoneCount(c, Task, i, j); Ret = true; } @@ -1577,7 +1577,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI // If the client has no tasks, there is nothing further to check. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForItem(%d,%d)", Type, ItemID); if(ActiveTaskCount == 0) return; @@ -1597,7 +1597,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI if(Task->Activity[j].Type != (int)Type) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Char: %s Activity type %i for Item %i failed zone check", c->GetName(), Type, ItemID); continue; } @@ -1618,7 +1618,7 @@ void ClientTaskState::UpdateTasksForItem(Client *c, ActivityType Type, int ItemI continue; } // We found an active task related to this item, so increment the done count - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Calling increment done count ForItem"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Calling increment done count ForItem"); IncrementDoneCount(c, Task, i, j, Count); } } @@ -1630,7 +1630,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { // If the client has no tasks, there is nothing further to check. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnExplore(%i)", ExploreID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityExplore) continue; if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Char: %s Explore exploreid %i failed zone check", c->GetName(), ExploreID); continue; } @@ -1670,7 +1670,7 @@ void ClientTaskState::UpdateTasksOnExplore(Client *c, int ExploreID) { } // We found an active task to explore this area, so set done count to goal count // (Only a goal count of 1 makes sense for explore activities?) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on explore"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment on explore"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); @@ -1684,7 +1684,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i bool Ret = false; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState::UpdateTasksForOnDeliver(%d)", NPCTypeID); if(ActiveTaskCount == 0) return false; @@ -1705,7 +1705,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i (Task->Activity[j].Type != ActivityGiveCash)) continue; // Is there a zone restriction on the activity ? if((Task->Activity[j].ZoneID >0) && (Task->Activity[j].ZoneID != (int)zone->GetZoneID())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Char: %s Deliver activity failed zone check (current zone %i, need zone %i", c->GetName(), zone->GetZoneID(), Task->Activity[j].ZoneID); continue; } @@ -1714,7 +1714,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i // Is the activity related to these items ? // if((Task->Activity[j].Type == ActivityGiveCash) && Cash) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveCash"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment on GiveCash"); IncrementDoneCount(c, Task, i, j, Cash); Ret = true; } @@ -1738,7 +1738,7 @@ bool ClientTaskState::UpdateTasksOnDeliver(Client *c, uint32 *Items, int Cash, i continue; } // We found an active task related to this item, so increment the done count - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on GiveItem"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment on GiveItem"); IncrementDoneCount(c, Task, i, j, 1); Ret = true; } @@ -1753,7 +1753,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { // If the client has no tasks, there is nothing further to check. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState::UpdateTasksOnTouch(%i)", ZoneID); if(ActiveTaskCount == 0) return; for(int i=0; iActivity[j].Type != ActivityTouch) continue; if(Task->Activity[j].GoalMethod != METHODSINGLEID) continue; if(Task->Activity[j].ZoneID != ZoneID) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Char: %s Touch activity failed zone check", c->GetName()); continue; } // We found an active task to zone into this zone, so set done count to goal count // (Only a goal count of 1 makes sense for touch activities?) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment on Touch"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment on Touch"); IncrementDoneCount(c, Task, i, j, Task->Activity[j].GoalCount - ActiveTasks[i].Activity[j].DoneCount); } @@ -1788,7 +1788,7 @@ void ClientTaskState::UpdateTasksOnTouch(Client *c, int ZoneID) { } void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int TaskIndex, int ActivityID, int Count, bool ignore_quest_update) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] IncrementDoneCount"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] IncrementDoneCount"); ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount += Count; @@ -1805,7 +1805,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].Updated=true; // Have we reached the goal count for this activity ? if(ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount >= Task->Activity[ActivityID].GoalCount) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Done (%i) = Goal (%i) for Activity %i", ActiveTasks[TaskIndex].Activity[ActivityID].DoneCount, Task->Activity[ActivityID].GoalCount, ActivityID); @@ -1814,7 +1814,7 @@ void ClientTaskState::IncrementDoneCount(Client *c, TaskInformation* Task, int T ActiveTasks[TaskIndex].Activity[ActivityID].State = ActivityCompleted; // Unlock subsequent activities for this task bool TaskComplete = UnlockActivities(c->CharacterID(), TaskIndex); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskCompleted is %i", TaskComplete); // and by the 'Task Stage Completed' message c->SendTaskActivityComplete(ActiveTasks[TaskIndex].TaskID, ActivityID, TaskIndex); // Send the updated task/activity list to the client @@ -1991,7 +1991,7 @@ bool ClientTaskState::IsTaskActive(int TaskID) { void ClientTaskState::FailTask(Client *c, int TaskID) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] FailTask %i, ActiveTaskCount is %i", TaskID, ActiveTaskCount); if(ActiveTaskCount == 0) return; for(int i=0; i= Task->ActivityCount) return false; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState IsTaskActivityActive(%i, %i). State is %i ", TaskID, ActivityID, ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State); @@ -2045,7 +2045,7 @@ bool ClientTaskState::IsTaskActivityActive(int TaskID, int ActivityID) { void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, int Count, bool ignore_quest_update /*= false*/) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, %i).", TaskID, ActivityID, Count); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2072,14 +2072,14 @@ void ClientTaskState::UpdateTaskActivity(Client *c, int TaskID, int ActivityID, // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Increment done count on UpdateTaskActivity"); IncrementDoneCount(c, Task, ActiveTaskIndex, ActivityID, Count, ignore_quest_update); } void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState UpdateTaskActivity(%i, %i, 0).", TaskID, ActivityID); // Quick sanity check if((ActivityID<0) || (ActiveTaskCount==0)) return; @@ -2107,7 +2107,7 @@ void ClientTaskState::ResetTaskActivity(Client *c, int TaskID, int ActivityID) { // The Activity is not currently active if(ActiveTasks[ActiveTaskIndex].Activity[ActivityID].State != ActivityActive) return; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ResetTaskActivityCount"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ResetTaskActivityCount"); ActiveTasks[ActiveTaskIndex].Activity[ActivityID].DoneCount = 0; @@ -2173,7 +2173,7 @@ int ClientTaskState::IsTaskCompleted(int TaskID) { if(!(RuleB(TaskSystem, RecordCompletedTasks))) return -1; for(unsigned int i=0; iunknown04 = 0x00000002; - Log.LogDebugType(EQEmuLogSys::Detail, EQEmuLogSys::Tasks, "SendTasksComplete"); + Log.LogDebugType(Logs::Detail, Logs::Tasks, "SendTasksComplete"); DumpPacket(outapp); fflush(stdout); QueuePacket(outapp); @@ -2275,7 +2275,7 @@ void Client::SendTaskComplete(int TaskIndex) { void ClientTaskState::SendTaskHistory(Client *c, int TaskIndex) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Task History Requested for Completed Task Index %i", TaskIndex); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Task History Requested for Completed Task Index %i", TaskIndex); // We only sent the most recent 50 completed tasks, so we need to offset the Index the client sent to us. @@ -2406,7 +2406,7 @@ void Client::SendTaskFailed(int TaskID, int TaskIndex) { //tac->unknown5 = 0x00000001; tac->unknown5 = 0; // 0 for task complete or failed. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskFailed"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskFailed"); _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); @@ -2428,7 +2428,7 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) if(State->CompletedTasks.size() > 50) FirstTaskToSend = State->CompletedTasks.size() - 50; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Completed Task Count: %i, First Task to send is %i, Last is %i", State->CompletedTasks.size(), FirstTaskToSend, LastTaskToSend); /* for(iterator=State->CompletedTasks.begin(); iterator!=State->CompletedTasks.end(); iterator++) { @@ -2689,12 +2689,12 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, false); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] SendActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, @@ -2704,7 +2704,7 @@ void TaskManager::SendActiveTasksToClient(Client *c, bool TaskComplete) { Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2725,13 +2725,13 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta int StartTime = c->GetTaskStartTime(TaskIndex); SendActiveTaskDescription(c, TaskID, TaskIndex, StartTime, Tasks[TaskID]->Duration, BringUpTaskJournal); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] SendSingleActiveTasksToClient: Task %i, Activities: %i", TaskID, GetActivityCount(TaskID)); int Sequence = 0; for(int Activity=0; ActivityGetTaskActivityState(TaskIndex, Activity) != ActivityHidden) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Long: %i, %i, %i Complete=%i", TaskID, Activity, TaskIndex, TaskComplete); if(Activity==GetActivityCount(TaskID)-1) SendTaskActivityLong(c, TaskID, Activity, TaskIndex, Tasks[TaskID]->Activity[Activity].Optional, TaskComplete); @@ -2740,7 +2740,7 @@ void TaskManager::SendSingleActiveTaskToClient(Client *c, int TaskIndex, bool Ta Tasks[TaskID]->Activity[Activity].Optional, 0); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Short: %i, %i, %i", TaskID, Activity, TaskIndex); SendTaskActivityShort(c, TaskID, Activity, TaskIndex); } Sequence++; @@ -2919,7 +2919,7 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->SequenceNumber = SequenceNumber; cts->unknown4 = 0x00000002; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask"); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] CancelTask"); _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); @@ -2932,24 +2932,24 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD void ClientTaskState::RemoveTask(Client *c, int sequenceNumber) { int characterID = c->CharacterID(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] ClientTaskState Cancel Task %i ", sequenceNumber); std::string query = StringFormat("DELETE FROM character_activities WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); return; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); query = StringFormat("DELETE FROM character_tasks WHERE charid=%i AND taskid = %i", characterID, ActiveTasks[sequenceNumber].TaskID); results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "[TASKS] Error in CientTaskState::CancelTask %s", results.ErrorMessage().c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] CancelTask: %s", query.c_str()); ActiveTasks[sequenceNumber].TaskID = TASKSLOTEMPTY; ActiveTaskCount--; @@ -2990,7 +2990,7 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID) { // int FreeSlot = -1; for(int i=0; iProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } @@ -3073,7 +3073,7 @@ TaskGoalListManager::~TaskGoalListManager() { bool TaskGoalListManager::LoadLists() { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] TaskGoalListManager::LoadLists Called"); for(int i=0; i< NumberOfLists; i++) safe_delete_array(TaskGoalLists[i].GoalItemEntries); @@ -3088,12 +3088,12 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } NumberOfLists = results.RowCount(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Database returned a count of %i lists", NumberOfLists); TaskGoalLists = new TaskGoalList_Struct[NumberOfLists]; @@ -3122,7 +3122,7 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } @@ -3207,7 +3207,7 @@ std::vector TaskGoalListManager::GetListContents(int ListID) { bool TaskGoalListManager::IsInList(int ListID, int Entry) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i)", ListID, Entry); int ListIndex = GetListByID(ListID); @@ -3227,7 +3227,7 @@ bool TaskGoalListManager::IsInList(int ListID, int Entry) { else if(Entry < TaskGoalLists[ListIndex].GoalItemEntries[MiddleEntry]) LastEntry = MiddleEntry - 1; else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); + Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskGoalListManager::IsInList(%i, %i) returning true", ListIndex, Entry); return true; } @@ -3250,7 +3250,7 @@ TaskProximityManager::~TaskProximityManager() { bool TaskProximityManager::LoadProximities(int zoneID) { TaskProximity proximity; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] TaskProximityManager::LoadProximities Called for zone %i", zoneID); TaskProximities.clear(); std::string query = StringFormat("SELECT `exploreid`, `minx`, `maxx`, " @@ -3259,7 +3259,7 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -3285,7 +3285,7 @@ int TaskProximityManager::CheckProximities(float X, float Y, float Z) { TaskProximity* P = &TaskProximities[i]; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", + Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Checking %8.3f, %8.3f, %8.3f against %8.3f, %8.3f, %8.3f, %8.3f, %8.3f, %8.3f", X, Y, Z, P->MinX, P->MaxX, P->MinY, P->MaxY, P->MinZ, P->MaxZ); if(X < P->MinX || X > P->MaxX || Y < P->MinY || Y > P->MaxY || diff --git a/zone/titles.cpp b/zone/titles.cpp index e6a268607..0f2e59368 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,7 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -263,7 +263,7 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -296,7 +296,7 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -351,7 +351,7 @@ void Client::EnableTitle(int titleSet) { CharacterID(), titleSet); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); + Log.Out(Logs::General, Logs::Error, "Error in EnableTitle query for titleset %i and charid %i", titleSet, CharacterID()); } @@ -362,7 +362,7 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -382,7 +382,7 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 946d595fc..d923af5c6 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -42,7 +42,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme { if (!user || !in_augment) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); + Log.Out(Logs::General, Logs::Error, "Client or AugmentItem_Struct not set in Object::HandleAugmentation"); return; } @@ -89,7 +89,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme if(!container) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Player tried to augment an item without a container set."); + Log.Out(Logs::General, Logs::Error, "Player tried to augment an item without a container set."); user->Message(13, "Error: This item is not a container!"); return; } @@ -243,7 +243,7 @@ void Object::HandleAugmentation(Client* user, const AugmentItem_Struct* in_augme void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Object *worldo) { if (!user || !in_combine) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); + Log.Out(Logs::General, Logs::Error, "Client or NewCombine_Struct not set in Object::HandleCombine"); return; } @@ -418,7 +418,7 @@ void Object::HandleCombine(Client* user, const NewCombine_Struct* in_combine, Ob if(success && spec.replace_container) { if(worldcontainer){ //should report this error, but we dont have the recipe ID, so its not very useful - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Replace container combine executed in a world container."); + Log.Out(Logs::General, Logs::Error, "Replace container combine executed in a world container."); } else user->DeleteItemInInventory(in_combine->container_slot, 0, true); @@ -444,7 +444,7 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac //ask the database for the recipe to make sure it exists... DBTradeskillRecipe_Struct spec; if (!database.GetTradeRecipe(rac->recipe_id, rac->object_type, rac->some_id, user->CharacterID(), &spec)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); + Log.Out(Logs::General, Logs::Error, "Unknown recipe for HandleAutoCombine: %u\n", rac->recipe_id); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -467,21 +467,21 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() < 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: no components returned"); + Log.Out(Logs::General, Logs::Error, "Error in HandleAutoCombine: no components returned"); user->QueuePacket(outapp); safe_delete(outapp); return; } if(results.RowCount() > 10) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); + Log.Out(Logs::General, Logs::Error, "Error in HandleAutoCombine: too many components returned (%u)", results.RowCount()); user->QueuePacket(outapp); safe_delete(outapp); return; @@ -676,7 +676,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -684,7 +684,7 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt return; //search gave no results... not an error if(results.ColumnCount() != 6) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error in TradeskillSearchResults query '%s': Invalid column count in result", query.c_str()); return; } @@ -730,17 +730,17 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if(results.RowCount() < 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: no components returned"); + Log.Out(Logs::General, Logs::Error, "Error in SendTradeskillDetails: no components returned"); return; } if(results.RowCount() > 10) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); + Log.Out(Logs::General, Logs::Error, "Error in SendTradeskillDetails: too many components returned (%u)", results.RowCount()); return; } @@ -901,7 +901,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { //handle caps if(spec->nofail) { chance = 100; //cannot fail. - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...This combine cannot fail."); + Log.Out(Logs::Detail, Logs::Tradeskills, "...This combine cannot fail."); } else if(over_trivial >= 0) { // At reaching trivial the chance goes to 95% going up an additional // percent for every 40 skillpoints above the trivial. @@ -921,8 +921,8 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { chance = 95; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); + Log.Out(Logs::Detail, Logs::Tradeskills, "...Current skill: %d , Trivial: %d , Success chance: %f percent", user_skill , spec->trivial , chance); + Log.Out(Logs::Detail, Logs::Tradeskills, "...Bonusstat: %d , INT: %d , WIS: %d , DEX: %d , STR: %d", bonusstat , GetINT() , GetWIS() , GetDEX() , GetSTR()); float res = zone->random.Real(0, 99); int aa_chance = 0; @@ -1066,7 +1066,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(4, TRADESKILL_SUCCEED, spec->name.c_str()); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill success"); + Log.Out(Logs::Detail, Logs::Tradeskills, "Tradeskill success"); itr = spec->onsuccess.begin(); while(itr != spec->onsuccess.end() && !spec->quest) { @@ -1098,7 +1098,7 @@ bool Client::TradeskillExecute(DBTradeskillRecipe_Struct *spec) { Message_StringID(MT_Emote,TRADESKILL_FAILED); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "Tradeskill failed"); + Log.Out(Logs::Detail, Logs::Tradeskills, "Tradeskill failed"); if (this->GetGroup()) { entity_list.MessageGroup(this,true,MT_Skills,"%s was unsuccessful in %s tradeskill attempt.",GetName(),this->GetGender() == 0 ? "his" : this->GetGender() == 1 ? "her" : "its"); @@ -1177,9 +1177,9 @@ void Client::CheckIncreaseTradeskill(int16 bonusstat, int16 stat_modifier, float NotifyNewTitlesAvailable(); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); + Log.Out(Logs::Detail, Logs::Tradeskills, "...skillup_modifier: %f , success_modifier: %d , stat modifier: %d", skillup_modifier , success_modifier , stat_modifier); + Log.Out(Logs::Detail, Logs::Tradeskills, "...Stage1 chance was: %f percent", chance_stage1); + Log.Out(Logs::Detail, Logs::Tradeskills, "...Stage2 chance was: %f percent. 0 percent means stage1 failed", chance_stage2); } bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint32 some_id, @@ -1232,8 +1232,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 buf2.c_str(), containers.c_str(), count, sum); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe search, query: %s", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe search, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1254,7 +1254,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 //length limit on buf2 if(index == 214) { //Maximum number of recipe matches (19 * 215 = 4096) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); + Log.Out(Logs::General, Logs::Error, "GetTradeRecipe warning: Too many matches. Unable to search all recipe entries. Searched %u of %u possible entries.", index + 1, results.RowCount()); break; } } @@ -1266,8 +1266,8 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND sum(tre.item_id * tre.componentcount) = %u", buf2.c_str(), count, sum); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } } @@ -1292,18 +1292,18 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 "AND tre.item_id = %u;", buf2.c_str(), containerId); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe, re-query: %s", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } if(results.RowCount() == 0) { //Recipe contents matched more than 1 recipe, but not in this container - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Incorrect container is being used!"); + Log.Out(Logs::General, Logs::Error, "Combine error: Incorrect container is being used!"); return false; } if (results.RowCount() > 1) //Recipe contents matched more than 1 recipe in this container - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); + Log.Out(Logs::General, Logs::Error, "Combine error: Recipe is not unique! %u matches found for container %u. Continuing with first recipe match.", results.RowCount(), containerId); } @@ -1320,7 +1320,7 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } @@ -1375,8 +1375,8 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id char_id, (unsigned long)recipe_id, containers.c_str()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe, query: %s", query.c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecipe, error: %s", results.ErrorMessage().c_str()); return false; } @@ -1407,12 +1407,12 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } if(results.RowCount() < 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetTradeRecept success: no success items returned"); + Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecept success: no success items returned"); return false; } @@ -1464,7 +1464,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) @@ -1477,12 +1477,12 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } if (results.RowCount() != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); + Log.Out(Logs::General, Logs::Normal, "Client::LearnRecipe - RecipeID: %d had %d occurences.", recipeID, results.RowCount()); return; } @@ -1503,7 +1503,7 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1553,7 +1553,7 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } @@ -1564,7 +1564,7 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } diff --git a/zone/trading.cpp b/zone/trading.cpp index c7e370ade..d87483199 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -86,7 +86,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { if (!owner || !owner->IsClient()) { // This should never happen - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Programming error: NPC's should not call Trade::AddEntity()"); + Log.Out(Logs::General, Logs::None, "Programming error: NPC's should not call Trade::AddEntity()"); return; } @@ -126,7 +126,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { inst2->SetCharges(stack_size + inst2->GetCharges()); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); + Log.Out(Logs::Detail, Logs::Trading, "%s added partial item '%s' stack (qty: %i) to trade slot %i", owner->GetName(), inst->GetItem()->Name, stack_size, trade_slot_id); if (_stack_size > 0) inst->SetCharges(_stack_size); @@ -143,7 +143,7 @@ void Trade::AddEntity(uint16 trade_slot_id, uint32 stack_size) { SendItemData(inst, trade_slot_id); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); + Log.Out(Logs::Detail, Logs::Trading, "%s added item '%s' to trade slot %i", owner->GetName(), inst->GetItem()->Name, trade_slot_id); client->PutItemInInventory(trade_slot_id, *inst); client->DeleteItemInInventory(MainCursor); @@ -296,7 +296,7 @@ void Trade::LogTrade() void Trade::DumpTrade() { Mob* with = With(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Dumping trade data: '%s' in TradeState %i with '%s'", + Log.Out(Logs::General, Logs::None, "Dumping trade data: '%s' in TradeState %i with '%s'", this->owner->GetName(), state, ((with==nullptr)?"(null)":with->GetName())); if (!owner->IsClient()) @@ -307,7 +307,7 @@ void Trade::DumpTrade() const ItemInst* inst = trader->GetInv().GetItem(i); if (inst) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", + Log.Out(Logs::General, Logs::None, "Item %i (Charges=%i, Slot=%i, IsBag=%s)", inst->GetItem()->ID, inst->GetCharges(), i, ((inst->IsType(ItemClassContainer)) ? "True" : "False")); @@ -315,7 +315,7 @@ void Trade::DumpTrade() for (uint8 j = SUB_BEGIN; j < EmuConstants::ITEM_CONTAINER_SIZE; j++) { inst = trader->GetInv().GetItem(i, j); if (inst) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "\tBagItem %i (Charges=%i, Slot=%i)", + Log.Out(Logs::General, Logs::None, "\tBagItem %i (Charges=%i, Slot=%i)", inst->GetItem()->ID, inst->GetCharges(), Inventory::CalcSlotId(i, j)); } @@ -324,7 +324,7 @@ void Trade::DumpTrade() } } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); + Log.Out(Logs::General, Logs::None, "\tpp:%i, gp:%i, sp:%i, cp:%i", pp, gp, sp, cp); } #endif @@ -368,7 +368,7 @@ void Client::ResetTrade() { break; if (partial_inst->GetID() != inst->GetID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -458,7 +458,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st bool qs_log = false; if(other) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Finishing trade with client %s", other->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Finishing trade with client %s", other->GetName()); this->AddMoneyToPP(other->trade->cp, other->trade->sp, other->trade->gp, other->trade->pp, true); @@ -491,7 +491,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst && inst->IsType(ItemClassContainer)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Giving container %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -499,7 +499,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(Logs::Detail, Logs::Trading, "Container %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -552,17 +552,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Transfer of container %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(Logs::Detail, Logs::Trading, "%s's inventory is full, returning container %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(Logs::Detail, Logs::Trading, "Container %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -588,7 +588,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st break; if (partial_inst->GetID() != inst->GetID()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::ResetTrade() - an incompatible location reference was returned by Inventory::FindFreeSlotForTradeItem()"); break; } @@ -606,10 +606,10 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st inst->SetCharges(0); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Transferring partial stack %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); if (other->PutItemInInventory(partial_slot, *partial_inst, true)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", + Log.Out(Logs::Detail, Logs::Trading, "Partial stack %s (%d) successfully transferred, deleting %i charges from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, (old_charges - inst->GetCharges())); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -635,7 +635,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", + Log.Out(Logs::Detail, Logs::Trading, "Transfer of partial stack %s (%d) to %s failed, returning %i charges to trade slot.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName(), (old_charges - inst->GetCharges())); inst->SetCharges(old_charges); @@ -710,7 +710,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st const ItemInst* inst = m_inv[trade_slot]; if (inst) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Giving item %s (%d) in slot %d to %s", inst->GetItem()->Name, inst->GetItem()->ID, trade_slot, other->GetName()); // TODO: need to check bag items/augments for no drop..everything for attuned... if (inst->GetItem()->NoDrop != 0 || Admin() >= RuleI(Character, MinStatusForNoDropExemptions) || RuleI(World, FVNoDropFlag) == 1 || other == this) { @@ -718,7 +718,7 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st if (free_slot != INVALID_INDEX) { if (other->PutItemInInventory(free_slot, *inst, true)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(Logs::Detail, Logs::Trading, "Item %s (%d) successfully transferred, deleting from trade slot.", inst->GetItem()->Name, inst->GetItem()->ID); if (qs_log) { QSTradeItems_Struct* detail = new QSTradeItems_Struct; @@ -772,17 +772,17 @@ void Client::FinishTrade(Mob* tradingWith, bool finalizer, void* event_entry, st } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Transfer of Item %s (%d) to %s failed, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID, other->GetName()); PushItemOnCursor(*inst, true); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(Logs::Detail, Logs::Trading, "%s's inventory is full, returning item %s (%d) to giver.", other->GetName(), inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); + Log.Out(Logs::Detail, Logs::Trading, "Item %s (%d) is NoDrop, returning to giver.", inst->GetItem()->Name, inst->GetItem()->ID); PushItemOnCursor(*inst, true); } @@ -1160,7 +1160,7 @@ void Client::SendTraderItem(uint32 ItemID, uint16 Quantity) { const Item_Struct* item = database.GetItem(ItemID); if(!item){ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); + Log.Out(Logs::Detail, Logs::Trading, "Bogus item deleted in Client::SendTraderItem!\n"); return; } @@ -1219,10 +1219,10 @@ void Client::BulkSendTraderInventory(uint32 char_id) { safe_delete(inst); } else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); + Log.Out(Logs::Detail, Logs::Trading, "Client::BulkSendTraderInventory nullptr inst pointer"); } else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); + Log.Out(Logs::Detail, Logs::Trading, "Client::BulkSendTraderInventory nullptr item pointer or item is NODROP %8X",item); } safe_delete(TraderItems); } @@ -1245,7 +1245,7 @@ ItemInst* Client::FindTraderItemBySerialNumber(int32 SerialNumber){ } } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); + Log.Out(Logs::Detail, Logs::Trading, "Client::FindTraderItemBySerialNumber Couldn't find item! Serial No. was %i", SerialNumber); return nullptr; } @@ -1302,7 +1302,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ } } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", + Log.Out(Logs::Detail, Logs::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n", SerialNumber , Quantity, this->GetName()); return 0; @@ -1311,7 +1311,7 @@ uint16 Client::FindTraderItem(int32 SerialNumber, uint16 Quantity){ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Customer,uint16 TraderSlot, int SerialNumber) { if(!Customer) return; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); + Log.Out(Logs::Detail, Logs::Trading, "NukeTraderItem(Slot %i, Charges %i, Quantity %i", Slot, Charges, Quantity); if(Quantity < Charges) { Customer->SendSingleTraderItem(this->CharacterID(), SerialNumber); m_inv.DeleteItem(Slot, Quantity); @@ -1395,7 +1395,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* if(!Stackable) Quantity = (Charges > 0) ? Charges : 1; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); + Log.Out(Logs::Detail, Logs::Trading, "FindAndNuke %s, Charges %i, Quantity %i", item->GetItem()->Name, Charges, Quantity); } if(item && (Charges <= Quantity || (Charges <= 0 && Quantity==1) || !Stackable)){ this->DeleteItemInInventory(SlotID, Quantity); @@ -1431,7 +1431,7 @@ void Client::FindAndNukeTraderItem(int32 SerialNumber, uint16 Quantity, Client* } } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, + Log.Out(Logs::Detail, Logs::Trading, "Could NOT find a match for Item: %i with a quantity of: %i on Trader: %s\n",SerialNumber, Quantity,this->GetName()); } @@ -1486,7 +1486,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -1510,13 +1510,13 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat const ItemInst* BuyItem = Trader->FindTraderItemBySerialNumber(tbs->ItemID); if(!BuyItem) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item on trader."); + Log.Out(Logs::Detail, Logs::Trading, "Unable to find item on trader."); TradeRequestFailed(app); safe_delete(outapp); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", + Log.Out(Logs::Detail, Logs::Trading, "Buyitem: Name: %s, IsStackable: %i, Requested Quantity: %i, Charges on Item %i", BuyItem->GetItem()->Name, BuyItem->IsStackable(), tbs->Quantity, BuyItem->GetCharges()); // If the item is not stackable, then we can only be buying one of them. if(!BuyItem->IsStackable()) @@ -1534,12 +1534,12 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat outtbs->Quantity = tbs->Quantity; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); + Log.Out(Logs::Detail, Logs::Trading, "Actual quantity that will be traded is %i", outtbs->Quantity); if((tbs->Price * outtbs->Quantity) <= 0) { Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); Trader->Message(13, "Internal error. Aborting trade. Please report this to the ServerOP. Error code is 1"); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Bazaar: Zero price transaction between %s and %s aborted." + Log.Out(Logs::General, Logs::Error, "Bazaar: Zero price transaction between %s and %s aborted." "Item: %s, Charges: %i, TBS: Qty %i, Price: %i", GetName(), Trader->GetName(), BuyItem->GetItem()->Name, BuyItem->GetCharges(), tbs->Quantity, tbs->Price); @@ -1836,11 +1836,11 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "SRCH: %s", query.c_str()); + Log.Out(Logs::Detail, Logs::Trading, "SRCH: %s", query.c_str()); int Size = 0; uint32 ID = 0; @@ -1887,7 +1887,7 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint VARSTRUCT_ENCODE_TYPE(uint32, bufptr, ID); } else{ - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find trader: %i\n",atoi(row[1])); + Log.Out(Logs::Detail, Logs::Trading, "Unable to find trader: %i\n",atoi(row[1])); VARSTRUCT_ENCODE_TYPE(uint32, bufptr, 0); } Cost = atoi(row[5]); @@ -1981,7 +1981,7 @@ static void UpdateTraderCustomerItemsAdded(uint32 CustomerID, TraderCharges_Stru if(inst->IsStackable()) inst->SetMerchantCount(gis->Charges[i]); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.Out(Logs::Detail, Logs::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor? @@ -2018,7 +2018,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St if(gis->ItemID[i] == ItemID) { tdis->ItemID = gis->SerialNumber[i]; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Telling customer to remove item %i with %i charges and S/N %i", + Log.Out(Logs::Detail, Logs::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); _pkt(TRADING__PACKETS, outapp); @@ -2031,7 +2031,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St return; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price updates to customer %s", Customer->GetName()); + Log.Out(Logs::Detail, Logs::Trading, "Sending price updates to customer %s", Customer->GetName()); ItemInst* inst = database.CreateItem(item); @@ -2057,7 +2057,7 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St inst->SetMerchantSlot(gis->SerialNumber[i]); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Sending price update for %s, Serial No. %i with %i charges", + Log.Out(Logs::Detail, Logs::Trading, "Sending price update for %s, Serial No. %i with %i charges", item->Name, gis->SerialNumber[i], gis->Charges[i]); Customer->SendItemPacket(30, inst, ItemPacketMerchant); // MainCursor?? @@ -2073,7 +2073,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { // TraderPriceUpdate_Struct* tpus = (TraderPriceUpdate_Struct*)app->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", + Log.Out(Logs::Detail, Logs::Trading, "Received Price Update for %s, Item Serial No. %i, New Price %i", GetName(), tpus->SerialNumber, tpus->NewPrice); // Pull the items this Trader currently has for sale from the trader table. @@ -2081,7 +2081,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { TraderCharges_Struct* gis = database.LoadTraderItemWithCharges(CharacterID()); if(!gis) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Error retrieving Trader items details to update price."); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Error retrieving Trader items details to update price."); return; } @@ -2101,7 +2101,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((gis->ItemID[i] > 0) && (gis->SerialNumber[i] == tpus->SerialNumber)) { // We found the item that the Trader wants to change the price of (or add back up for sale). // - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); + Log.Out(Logs::Detail, Logs::Trading, "ItemID is %i, Charges is %i", gis->ItemID[i], gis->Charges[i]); IDOfItemToUpdate = gis->ItemID[i]; @@ -2127,7 +2127,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { return ; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to find item to update price for. Rechecking trader satchels"); + Log.Out(Logs::Detail, Logs::Trading, "Unable to find item to update price for. Rechecking trader satchels"); // Find what is in their Trader Satchels GetItems_Struct* newgis=GetTraderItems(); @@ -2140,7 +2140,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if((newgis->Items[i] > 0) && (newgis->SerialNumber[i] == tpus->SerialNumber)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], + Log.Out(Logs::Detail, Logs::Trading, "Found new Item to Add, ItemID is %i, Charges is %i", newgis->Items[i], newgis->Charges[i]); IDOfItemToAdd = newgis->Items[i]; @@ -2158,7 +2158,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { if(!IDOfItemToAdd || !item) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Item not found in Trader Satchels either."); + Log.Out(Logs::Detail, Logs::Trading, "Item not found in Trader Satchels either."); tpus->SubAction = BazaarPriceChange_Fail; QueuePacket(app); Trader_EndTrader(); @@ -2203,7 +2203,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { gis->SerialNumber[i] = newgis->SerialNumber[i]; gis->ItemCost[i] = tpus->NewPrice; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", + Log.Out(Logs::Detail, Logs::Trading, "Adding new item for %s. ItemID %i, SerialNumber %i, Charges %i, Price: %i, Slot %i", GetName(), newgis->Items[i], newgis->SerialNumber[i], newgis->Charges[i], tpus->NewPrice, i); } @@ -2249,7 +2249,7 @@ void Client::HandleTraderPriceUpdate(const EQApplicationPacket *app) { QueuePacket(app); if(OldPrice == tpus->NewPrice) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "The new price is the same as the old one."); + Log.Out(Logs::Detail, Logs::Trading, "The new price is the same as the old one."); safe_delete(gis); return; } @@ -2270,7 +2270,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { // This method is called when a potential seller in the /barter window searches for matching buyers // - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Client::SendBuyerResults %s\n", searchString); char* escSearchString = new char[strlen(searchString) * 2 + 1]; database.DoEscapeString(escSearchString, searchString, strlen(searchString)); @@ -2280,7 +2280,7 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2515,7 +2515,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { Quantity = i; break; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2523,7 +2523,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer || !Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); if(ItemToTransfer) @@ -2561,7 +2561,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { int16 SellerSlot = m_inv.HasItem(ItemID, 1, invWhereWorn|invWherePersonal|invWhereCursor); if (SellerSlot == INVALID_INDEX) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2569,7 +2569,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemInst* ItemToTransfer = m_inv.PopItem(SellerSlot); if(!ItemToTransfer) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); return; } @@ -2581,7 +2581,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { QuantityMoved += ItemToTransfer->GetCharges(); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2616,7 +2616,7 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { ItemToTransfer->SetCharges(QuantityToRemoveFromStack); if(!Buyer->MoveItemToInventory(ItemToTransfer, true)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unexpected error while moving item from seller to buyer."); + Log.Out(Logs::General, Logs::Error, "Unexpected error while moving item from seller to buyer."); Message(13, "Internal error while processing transaction."); safe_delete(ItemToTransfer); return; @@ -2855,11 +2855,11 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { bool LoreConflict = CheckLoreConflict(item); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", + Log.Out(Logs::Detail, Logs::Trading, "UpdateBuyLine: Char: %s BuySlot: %i ItemID %i %s Quantity %i Toggle: %i Price %i ItemCount %i LoreConflict %i", GetName(), BuySlot, ItemID, item->Name, Quantity, ToggleOnOff, Price, ItemCount, LoreConflict); if((item->NoDrop != 0) && !LoreConflict && (Quantity > 0) && HasMoney(Quantity * Price) && ToggleOnOff && (ItemCount == 0)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Adding to database"); + Log.Out(Logs::Detail, Logs::Trading, "Adding to database"); database.AddBuyLine(CharacterID(), BuySlot, ItemID, ItemName, Quantity, Price); QueuePacket(app); } diff --git a/zone/trap.cpp b/zone/trap.cpp index ac4361fe0..d973a800b 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,7 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 014fd8773..7fbd52e1d 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -220,7 +220,7 @@ void Client::ChangeTributeSettings(TributeInfo_Struct *t) { void Client::SendTributeDetails(uint32 client_id, uint32 tribute_id) { if(tribute_list.count(tribute_id) != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); + Log.Out(Logs::General, Logs::Error, "Details request for invalid tribute %lu", (unsigned long)tribute_id); return; } TributeData &td = tribute_list[tribute_id]; @@ -390,7 +390,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -407,7 +407,7 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -415,14 +415,14 @@ bool ZoneDatabase::LoadTributes() { uint32 id = atoul(row[0]); if(tribute_list.count(id) != 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); + Log.Out(Logs::General, Logs::Error, "Error in LoadTributes: unknown tribute %lu in tribute_levels", (unsigned long)id); continue; } TributeData &cur = tribute_list[id]; if(cur.tier_count >= MAX_TRIBUTE_TIERS) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); + Log.Out(Logs::General, Logs::Error, "Error in LoadTributes: on tribute %lu: more tiers defined than permitted", (unsigned long)id); continue; } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 82cc2936a..95f655cbb 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -88,7 +88,7 @@ void NPC::StopWandering() roamer=false; CastToNPC()->SetGrid(0); SendPosition(); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Stop Wandering requested."); + Log.Out(Logs::Detail, Logs::Pathing, "Stop Wandering requested."); return; } @@ -107,16 +107,16 @@ void NPC::ResumeWandering() cur_wp=save_wp; UpdateWaypoint(cur_wp); // have him head to last destination from here } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); + Log.Out(Logs::Detail, Logs::Pathing, "Resume Wandering requested. Grid %d, wp %d", GetGrid(), cur_wp); } else if (AIwalking_timer->Enabled()) { // we are at a waypoint paused normally - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); + Log.Out(Logs::Detail, Logs::Pathing, "Resume Wandering on timed pause. Grid %d, wp %d", GetGrid(), cur_wp); AIwalking_timer->Trigger(); // disable timer to end pause now } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Out(Logs::General, Logs::Error, "NPC not paused - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); return; } @@ -131,7 +131,7 @@ void NPC::ResumeWandering() } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Out(Logs::General, Logs::Error, "NPC not on grid - can't resume wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -143,7 +143,7 @@ void NPC::PauseWandering(int pausetime) if (GetGrid() != 0) { DistractedFromGrid = true; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); + Log.Out(Logs::Detail, Logs::Pathing, "Paused Wandering requested. Grid %d. Resuming in %d ms (0=not until told)", GetGrid(), pausetime); SendPosition(); if (pausetime<1) { // negative grid number stops him dead in his tracks until ResumeWandering() @@ -154,7 +154,7 @@ void NPC::PauseWandering(int pausetime) AIwalking_timer->Start(pausetime*1000); // set the timer } } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); + Log.Out(Logs::General, Logs::Error, "NPC not on grid - can't pause wandering: %lu", (unsigned long)GetNPCTypeID()); } return; } @@ -166,7 +166,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if (GetGrid() < 0) { // currently stopped by a quest command SetGrid( 0 - GetGrid()); // get him moving again - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); + Log.Out(Logs::Detail, Logs::AI, "MoveTo during quest wandering. Canceling quest wandering and going back to grid %d when MoveTo is done.", GetGrid()); } AIwalking_timer->Disable(); // disable timer in case he is paused at a wp if (cur_wp>=0) @@ -174,14 +174,14 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) save_wp=cur_wp; // save the current waypoint cur_wp=-1; // flag this move as quest controlled } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); + Log.Out(Logs::Detail, Logs::AI, "MoveTo (%.3f, %.3f, %.3f), pausing regular grid wandering. Grid %d, save_wp %d", mtx, mty, mtz, -GetGrid(), save_wp); } else { // not on a grid roamer=true; save_wp=0; cur_wp=-2; // flag as quest controlled w/no grid - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); + Log.Out(Logs::Detail, Logs::AI, "MoveTo (%.3f, %.3f, %.3f) without a grid.", mtx, mty, mtz); } if (saveguardspot) { @@ -196,7 +196,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) if(guard_heading == -1) guard_heading = this->CalculateHeadingToTarget(mtx, mty); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.Out(Logs::Detail, Logs::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } cur_wp_x = mtx; @@ -212,7 +212,7 @@ void NPC::MoveTo(float mtx, float mty, float mtz, float mth, bool saveguardspot) void NPC::UpdateWaypoint(int wp_index) { if(wp_index >= static_cast(Waypoints.size())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Update to waypoint %d failed. Not found.", wp_index); + Log.Out(Logs::Detail, Logs::AI, "Update to waypoint %d failed. Not found.", wp_index); return; } std::vector::iterator cur; @@ -224,7 +224,7 @@ void NPC::UpdateWaypoint(int wp_index) cur_wp_z = cur->z; cur_wp_pause = cur->pause; cur_wp_heading = cur->heading; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); + Log.Out(Logs::Detail, Logs::AI, "Next waypoint %d: (%.3f, %.3f, %.3f, %.3f)", wp_index, cur_wp_x, cur_wp_y, cur_wp_z, cur_wp_heading); //fix up pathing Z if(zone->HasMap() && RuleB(Map, FixPathingZAtWaypoints)) @@ -430,7 +430,7 @@ void NPC::SetWaypointPause() void NPC::SaveGuardSpot(bool iClearGuardSpot) { if (iClearGuardSpot) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Clearing guard order."); + Log.Out(Logs::Detail, Logs::AI, "Clearing guard order."); guard_x = 0; guard_y = 0; guard_z = 0; @@ -443,14 +443,14 @@ void NPC::SaveGuardSpot(bool iClearGuardSpot) { guard_heading = heading; if(guard_heading == 0) guard_heading = 0.0001; //hack to make IsGuarding simpler - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); + Log.Out(Logs::Detail, Logs::AI, "Setting guard position to (%.3f, %.3f, %.3f)", guard_x, guard_y, guard_z); } } void NPC::NextGuardPosition() { if (!CalculateNewPosition2(guard_x, guard_y, guard_z, GetMovespeed())) { SetHeading(guard_heading); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Unable to move to next guard position. Probably rooted."); + Log.Out(Logs::Detail, Logs::AI, "Unable to move to next guard position. Probably rooted."); } else if((x_pos == guard_x) && (y_pos == guard_y) && (z_pos == guard_z)) { @@ -516,15 +516,15 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b if ((x_pos-x == 0) && (y_pos-y == 0)) {//spawn is at target coords if(z_pos-z != 0) { z_pos = z; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); + Log.Out(Logs::Detail, Logs::AI, "Calc Position2 (%.3f, %.3f, %.3f): Jumping pure Z.", x, y, z); return true; } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); + Log.Out(Logs::Detail, Logs::AI, "Calc Position2 (%.3f, %.3f, %.3f) inWater=%d: We are there.", x, y, z, inWater); return false; } else if ((ABS(x_pos - x) < 0.1) && (ABS(y_pos - y) < 0.1)) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); + Log.Out(Logs::Detail, Logs::AI, "Calc Position2 (%.3f, %.3f, %.3f): X/Y difference <0.1, Jumping to target.", x, y, z); if(IsNPC()) { entity_list.ProcessMove(CastToNPC(), x, y, z); @@ -550,7 +550,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); + Log.Out(Logs::Detail, Logs::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), old vector (%.3f, %.3f, %.3f)", x, y, z, tar_vx, tar_vy, tar_vz); uint8 NPCFlyMode = 0; @@ -569,7 +569,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(Logs::Detail, Logs::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -612,7 +612,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b //pRunAnimSpeed = (int8)(speed*NPC_RUNANIM_RATIO); //speed *= NPC_SPEED_MULTIPLIER; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.Out(Logs::Detail, Logs::AI, "Calculating new position2 to (%.3f, %.3f, %.3f), new vector (%.3f, %.3f, %.3f) rate %.3f, RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -647,7 +647,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b z_pos = new_z; tar_ndx=22-numsteps; heading = CalculateHeadingToTarget(x, y); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.Out(Logs::Detail, Logs::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } else { @@ -659,7 +659,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = y; z_pos = z; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Only a single step to get there... jumping."); + Log.Out(Logs::Detail, Logs::AI, "Only a single step to get there... jumping."); } } @@ -678,7 +678,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b y_pos = new_y; z_pos = new_z; heading = CalculateHeadingToTarget(x, y); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); + Log.Out(Logs::Detail, Logs::AI, "Next position2 (%.3f, %.3f, %.3f) (%d steps)", x_pos, y_pos, z_pos, numsteps); } uint8 NPCFlyMode = 0; @@ -698,7 +698,7 @@ bool Mob::MakeNewPositionAndSendUpdate(float x, float y, float z, float speed, b float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(Logs::Detail, Logs::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -759,7 +759,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec moved=false; } SetRunAnimSpeed(0); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); + Log.Out(Logs::Detail, Logs::AI, "Rooted while calculating new position to (%.3f, %.3f, %.3f)", x, y, z); return true; } @@ -773,7 +773,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec pRunAnimSpeed = (uint8)(speed*NPC_RUNANIM_RATIO); speed *= NPC_SPEED_MULTIPLIER; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); + Log.Out(Logs::Detail, Logs::AI, "Calculating new position to (%.3f, %.3f, %.3f) vector (%.3f, %.3f, %.3f) rate %.3f RAS %d", x, y, z, tar_vx, tar_vy, tar_vz, speed, pRunAnimSpeed); // -------------------------------------------------------------------------- // 2: get unit vector @@ -790,7 +790,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = x; y_pos = y; z_pos = z; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Close enough, jumping to waypoint"); + Log.Out(Logs::Detail, Logs::AI, "Close enough, jumping to waypoint"); } else { float new_x = x_pos + tar_vx*tar_vector; @@ -803,7 +803,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec x_pos = new_x; y_pos = new_y; z_pos = new_z; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); + Log.Out(Logs::Detail, Logs::AI, "Next position (%.3f, %.3f, %.3f)", x_pos, y_pos, z_pos); } uint8 NPCFlyMode = 0; @@ -823,7 +823,7 @@ bool Mob::CalculateNewPosition(float x, float y, float z, float speed, bool chec float newz = zone->zonemap->FindBestZ(dest, nullptr) + 2.0f; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(Logs::Detail, Logs::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaMoving)) // Sanity check. { @@ -876,7 +876,7 @@ void NPC::AssignWaypoints(int32 grid) { std::string query = StringFormat("SELECT `type`, `type2` FROM `grid` WHERE `id` = %i AND `zoneid` = %i", grid, zone->GetZoneID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "MySQL Error while trying to assign grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -897,7 +897,7 @@ void NPC::AssignWaypoints(int32 grid) { "ORDER BY `number`", grid, zone->GetZoneID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "MySQL Error while trying to assign waypoints from grid %u to mob %s: %s", grid, name, results.ErrorMessage().c_str()); return; } @@ -951,7 +951,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { x_pos = new_x; y_pos = new_y; z_pos = new_z; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); + Log.Out(Logs::Detail, Logs::AI, "Sent To (%.3f, %.3f, %.3f)", new_x, new_y, new_z); if(flymode == FlyMode1) return; @@ -967,7 +967,7 @@ void Mob::SendTo(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(Logs::Detail, Logs::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz - dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -998,7 +998,7 @@ void Mob::SendToFixZ(float new_x, float new_y, float new_z) { float newz = zone->zonemap->FindBestZ(dest, nullptr); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); + Log.Out(Logs::Detail, Logs::AI, "BestZ returned %4.3f at %4.3f, %4.3f, %4.3f", newz,x_pos,y_pos,z_pos); if( (newz > -2000) && ABS(newz-dest.z) < RuleR(Map, FixPathingZMaxDeltaSendTo)) // Sanity check. z_pos = newz + 1; @@ -1011,7 +1011,7 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1028,7 +1028,7 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1049,7 +1049,7 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -1078,7 +1078,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1092,7 +1092,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1122,7 +1122,7 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1160,7 +1160,7 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1173,14 +1173,14 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1196,7 +1196,7 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1222,7 +1222,7 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -1249,7 +1249,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1270,14 +1270,14 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } @@ -1289,7 +1289,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1304,7 +1304,7 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); @@ -1316,7 +1316,7 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -1336,7 +1336,7 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 8043954fc..225063ec1 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -140,7 +140,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "Got 0x%04x from world:", pack->opcode); + Log.Out(Logs::Detail, Logs::Zone_Server, "Got 0x%04x from world:", pack->opcode); _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); switch(pack->opcode) { case 0: { @@ -155,12 +155,12 @@ void WorldServer::Process() { if (pack->size != sizeof(ServerConnectInfo)) break; ServerConnectInfo* sci = (ServerConnectInfo*) pack->pBuffer; - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World assigned Port: %d for this zone.", sci->port); + Log.Out(Logs::Detail, Logs::Zone_Server, "World assigned Port: %d for this zone.", sci->port); ZoneConfig::SetZonePort(sci->port); break; } case ServerOP_ZAAuthFailed: { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); + Log.Out(Logs::Detail, Logs::Zone_Server, "World server responded 'Not Authorized', disabling reconnect"); pTryReconnect = false; Disconnect(); break; @@ -386,12 +386,12 @@ void WorldServer::Process() { } } else { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", + Log.Out(Logs::Detail, Logs::None, "[CLIENT] id=%i, playerineqstring=%i, playersinzonestring=%i. Dumping WhoAllReturnStruct:", wars->id, wars->playerineqstring, wars->playersinzonestring); } } else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "WhoAllReturnStruct: Could not get return struct!"); + Log.Out(Logs::General, Logs::Error, "WhoAllReturnStruct: Could not get return struct!"); break; } case ServerOP_EmoteMessage: { @@ -678,7 +678,7 @@ void WorldServer::Process() { //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //also serves to inform Client::OPRezzAnswer to expect a packet. client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", + Log.Out(Logs::Detail, Logs::Spells, "OP_RezzRequest in zone %s for %s, spellid:%i", zone->GetShortName(), client->GetName(), srs->rez.spellid); EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); @@ -694,10 +694,10 @@ void WorldServer::Process() { // to the zone that the corpse is in. Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); if (corpse && corpse->IsCorpse()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "OP_RezzComplete received in zone %s for corpse %s", + Log.Out(Logs::Detail, Logs::Spells, "OP_RezzComplete received in zone %s for corpse %s", zone->GetShortName(), srs->rez.corpse_name); - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Found corpse. Marking corpse as rezzed."); + Log.Out(Logs::Detail, Logs::Spells, "Found corpse. Marking corpse as rezzed."); // I don't know why Rezzed is not set to true in CompleteRezz(). corpse->IsRezzed(true); corpse->CompleteResurrection(); @@ -748,7 +748,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - Log.Out(EQEmuLogSys::Moderate, EQEmuLogSys::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); + Log.Out(Logs::Moderate, Logs::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); @@ -1381,7 +1381,7 @@ void WorldServer::Process() { if(NewCorpse) NewCorpse->Spawn(); else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); + Log.Out(Logs::General, Logs::Error, "Unable to load player corpse id %u for zone %s.", s->player_corpse_id, zone->GetShortName()); break; } @@ -1974,7 +1974,7 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); + Log.Out(Logs::Detail, Logs::Spells, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; sem->rezzopcode = opcode; @@ -1983,9 +1983,9 @@ bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + Log.Out(Logs::Detail, Logs::Spells, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); else - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Spells, "NOT Sending player rezz packet to world"); + Log.Out(Logs::Detail, Logs::Spells, "NOT Sending player rezz packet to world"); safe_delete(pack); return ret; @@ -2005,14 +2005,14 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) { ReloadTasks_Struct* rts = (ReloadTasks_Struct*) pack->pBuffer; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Zone received ServerOP_ReloadTasks from World, Command %i", rts->Command); switch(rts->Command) { case RELOADTASKS: entity_list.SaveAllClientsTaskState(); if(rts->Parameter == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload ALL tasks"); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload ALL tasks"); safe_delete(taskmanager); taskmanager = new TaskManager; taskmanager->LoadTasks(); @@ -2021,7 +2021,7 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) entity_list.ReloadAllClientsTaskState(); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload only task %i", rts->Parameter); taskmanager->LoadTasks(rts->Parameter); entity_list.ReloadAllClientsTaskState(rts->Parameter); } @@ -2030,23 +2030,23 @@ void WorldServer::HandleReloadTasks(ServerPacket *pack) case RELOADTASKPROXIMITIES: if(zone) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task proximities"); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task proximities"); taskmanager->LoadProximities(zone->GetZoneID()); } break; case RELOADTASKGOALLISTS: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task goal lists"); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task goal lists"); taskmanager->ReloadGoalLists(); break; case RELOADTASKSETS: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Reload task sets"); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Reload task sets"); taskmanager->LoadTaskSets(); break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); + Log.Out(Logs::General, Logs::Tasks, "[GLOBALLOAD] Unhandled ServerOP_ReloadTasks command %i", rts->Command); } @@ -2061,7 +2061,7 @@ uint32 WorldServer::NextGroupID() { if(cur_groupid >= last_groupid) { //this is an error... This means that 50 groups were created before //1 packet could make the zone->world->zone trip... so let it error. - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Ran out of group IDs before the server sent us more."); + Log.Out(Logs::General, Logs::Error, "Ran out of group IDs before the server sent us more."); return(0); } if(cur_groupid > (last_groupid - /*50*/995)) { diff --git a/zone/zone.cpp b/zone/zone.cpp index 1ae1d237b..b4394377f 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -90,7 +90,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); + Log.Out(Logs::General, Logs::Status, "Booting %s (%d:%d)", zonename, iZoneID, iInstanceID); numclients = 0; zone = new Zone(iZoneID, iInstanceID, zonename); @@ -117,13 +117,13 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { log_levels[i]=0; //set to zero on a bogue char } zone->loglevelvar = log_levels[0]; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "General logging level: %i", zone->loglevelvar); + Log.Out(Logs::General, Logs::Status, "General logging level: %i", zone->loglevelvar); zone->merchantvar = log_levels[1]; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Merchant logging level: %i", zone->merchantvar); + Log.Out(Logs::General, Logs::Status, "Merchant logging level: %i", zone->merchantvar); zone->tradevar = log_levels[2]; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Trade logging level: %i", zone->tradevar); + Log.Out(Logs::General, Logs::Status, "Trade logging level: %i", zone->tradevar); zone->lootvar = log_levels[3]; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loot logging level: %i", zone->lootvar); + Log.Out(Logs::General, Logs::Status, "Loot logging level: %i", zone->lootvar); } else { zone->loglevelvar = uint8(atoi(tmp)); //continue supporting only command logging (for now) @@ -144,8 +144,8 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { delete pack; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); + Log.Out(Logs::General, Logs::Normal, "---- Zone server %s, listening on port:%i ----", zonename, ZoneConfig::get()->ZonePort); + Log.Out(Logs::General, Logs::Status, "Zone Bootup: %s (%i: %i)", zonename, iZoneID, iInstanceID); parse->Init(); UpdateWindowTitle(); zone->GetTimeSync(); @@ -167,11 +167,11 @@ bool Zone::LoadZoneObjects() { zoneid, instanceversion); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Loading Objects from DB: %s",results.ErrorMessage().c_str()); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Objects from DB..."); + Log.Out(Logs::General, Logs::Status, "Loading Objects from DB..."); for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[9]) == 0) { @@ -288,7 +288,7 @@ bool Zone::LoadGroundSpawns() { memset(&groundspawn, 0, sizeof(groundspawn)); int gsindex=0; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Ground Spawns from DB..."); + Log.Out(Logs::General, Logs::Status, "Loading Ground Spawns from DB..."); database.LoadGroundSpawns(zoneid, GetInstanceVersion(), &groundspawn); uint32 ix=0; char* name=0; @@ -402,7 +402,7 @@ uint32 Zone::GetTempMerchantQuantity(uint32 NPCID, uint32 Slot) { } void Zone::LoadTempMerchantData() { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Temporary Merchant Lists..."); + Log.Out(Logs::General, Logs::Status, "Loading Temporary Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.npcid, " @@ -420,7 +420,7 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; @@ -453,7 +453,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -474,7 +474,7 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { } void Zone::GetMerchantDataForZoneLoad() { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Merchant Lists..."); + Log.Out(Logs::General, Logs::Status, "Loading Merchant Lists..."); std::string query = StringFormat( "SELECT " "DISTINCT ml.merchantid, " @@ -497,7 +497,7 @@ void Zone::GetMerchantDataForZoneLoad() { std::map >::iterator cur; uint32 npcid = 0; if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "No Merchant Data found for %s.", GetShortName()); + Log.Out(Logs::General, Logs::None, "No Merchant Data found for %s.", GetShortName()); return; } for (auto row = results.begin(); row != results.end(); ++row) { @@ -547,7 +547,7 @@ void Zone::LoadMercTemplates(){ "`merc_stance_entries` ORDER BY `class_id`, `proficiency_id`, `stance_id`"; auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadMercTemplates()"); else { for (auto row = results.begin(); row != results.end(); ++row) { MercStanceInfo tempMercStanceInfo; @@ -570,7 +570,7 @@ void Zone::LoadMercTemplates(){ "ORDER BY MTyp.race_id, MS.class_id, MTyp.proficiency_id;"; results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadMercTemplates()"); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadMercTemplates()"); return; } @@ -614,7 +614,7 @@ void Zone::LoadLevelEXPMods(){ const std::string query = "SELECT level, exp_mod, aa_exp_mod FROM level_exp_mods"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadEXPLevelMods()"); return; } @@ -638,7 +638,7 @@ void Zone::LoadMercSpells(){ "ORDER BY msl.class_id, msl.proficiency_id, msle.spell_type, msle.minlevel, msle.slot;"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadMercSpells()"); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadMercSpells()"); return; } @@ -660,7 +660,7 @@ void Zone::LoadMercSpells(){ } if(MERC_DEBUG > 0) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); + Log.Out(Logs::General, Logs::None, "Mercenary Debug: Loaded %i merc spells.", merc_spells_list[1].size() + merc_spells_list[2].size() + merc_spells_list[9].size() + merc_spells_list[12].size()); } @@ -707,11 +707,11 @@ void Zone::Shutdown(bool quite) } zone->ldon_trap_entry_list.clear(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); + Log.Out(Logs::General, Logs::Status, "Zone Shutdown: %s (%i)", zone->GetShortName(), zone->GetZoneID()); petition_list.ClearPetitions(); zone->GotCurTime(false); if (!quite) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Normal, "Zone shutdown: going to sleep"); + Log.Out(Logs::General, Logs::Normal, "Zone shutdown: going to sleep"); ZoneLoaded = false; zone->ResetAuth(); @@ -725,19 +725,19 @@ void Zone::Shutdown(bool quite) void Zone::LoadZoneDoors(const char* zone, int16 version) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading doors for %s ...", zone); + Log.Out(Logs::General, Logs::Status, "Loading doors for %s ...", zone); uint32 maxid; int32 count = database.GetDoorsCount(&maxid, zone, version); if(count < 1) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "... No doors loaded."); + Log.Out(Logs::General, Logs::Status, "... No doors loaded."); return; } Door *dlist = new Door[count]; if(!database.LoadDoors(count, dlist, zone, version)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load doors."); + Log.Out(Logs::General, Logs::Error, "... Failed to load doors."); delete[] dlist; return; } @@ -801,12 +801,12 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) database.GetZoneLongName(short_name, &long_name, file_name, &psafe_x, &psafe_y, &psafe_z, &pgraveyard_id, &pMaxClients); if(graveyard_id() > 0) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Graveyard ID is %i.", graveyard_id()); + Log.Out(Logs::General, Logs::None, "Graveyard ID is %i.", graveyard_id()); bool GraveYardLoaded = database.GetZoneGraveyard(graveyard_id(), &pgraveyard_zoneid, &pgraveyard_x, &pgraveyard_y, &pgraveyard_z, &pgraveyard_heading); if(GraveYardLoaded) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); + Log.Out(Logs::General, Logs::None, "Loaded a graveyard for zone %s: graveyard zoneid is %u x is %f y is %f z is %f heading is %f.", short_name, graveyard_zoneid(), graveyard_x(), graveyard_y(), graveyard_z(), graveyard_heading()); else - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); + Log.Out(Logs::General, Logs::Error, "Unable to load the graveyard id %i for zone %s.", graveyard_id(), short_name); } if (long_name == 0) { long_name = strcpy(new char[18], "Long zone missing"); @@ -814,7 +814,7 @@ Zone::Zone(uint32 in_zoneid, uint32 in_instanceid, const char* in_short_name) autoshutdown_timer.Start(AUTHENTICATION_TIMEOUT * 1000, false); Weather_Timer = new Timer(60000); Weather_Timer->Start(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); + Log.Out(Logs::General, Logs::None, "The next weather check for zone: %s will be in %i seconds.", short_name, Weather_Timer->GetRemainingTime()/1000); zone_weather = 0; weather_intensity = 0; blocked_spells = nullptr; @@ -899,56 +899,56 @@ Zone::~Zone() { bool Zone::Init(bool iStaticZone) { SetStaticZone(iStaticZone); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn conditions..."); + Log.Out(Logs::General, Logs::Status, "Loading spawn conditions..."); if(!spawn_conditions.LoadSpawnConditions(short_name, instanceid)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn conditions failed, continuing without them."); + Log.Out(Logs::General, Logs::Error, "Loading spawn conditions failed, continuing without them."); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading static zone points..."); + Log.Out(Logs::General, Logs::Status, "Loading static zone points..."); if (!database.LoadStaticZonePoints(&zone_point_list, short_name, GetInstanceVersion())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); + Log.Out(Logs::General, Logs::Error, "Loading static zone points failed."); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn groups..."); + Log.Out(Logs::General, Logs::Status, "Loading spawn groups..."); if (!database.LoadSpawnGroups(short_name, GetInstanceVersion(), &spawn_group_list)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn groups failed."); + Log.Out(Logs::General, Logs::Error, "Loading spawn groups failed."); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading spawn2 points..."); + Log.Out(Logs::General, Logs::Status, "Loading spawn2 points..."); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading spawn2 points failed."); + Log.Out(Logs::General, Logs::Error, "Loading spawn2 points failed."); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading player corpses..."); + Log.Out(Logs::General, Logs::Status, "Loading player corpses..."); if (!database.LoadCharacterCorpses(zoneid, instanceid)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading player corpses failed."); + Log.Out(Logs::General, Logs::Error, "Loading player corpses failed."); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading traps..."); + Log.Out(Logs::General, Logs::Status, "Loading traps..."); if (!database.LoadTraps(short_name, GetInstanceVersion())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading traps failed."); + Log.Out(Logs::General, Logs::Error, "Loading traps failed."); return false; } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading adventure flavor text..."); + Log.Out(Logs::General, Logs::Status, "Loading adventure flavor text..."); LoadAdventureFlavor(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading ground spawns..."); + Log.Out(Logs::General, Logs::Status, "Loading ground spawns..."); if (!LoadGroundSpawns()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading ground spawns failed. continuing."); + Log.Out(Logs::General, Logs::Error, "Loading ground spawns failed. continuing."); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading World Objects from DB..."); + Log.Out(Logs::General, Logs::Status, "Loading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading World Objects failed. continuing."); + Log.Out(Logs::General, Logs::Error, "Loading World Objects failed. continuing."); } //load up the zone's doors (prints inside) @@ -1005,10 +1005,10 @@ bool Zone::Init(bool iStaticZone) { } } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading timezone data..."); + Log.Out(Logs::General, Logs::Status, "Loading timezone data..."); zone->zone_time.setEQTimeZone(database.GetZoneTZ(zoneid, GetInstanceVersion())); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); + Log.Out(Logs::General, Logs::Status, "Init Finished: ZoneID = %d, Time Offset = %d", zoneid, zone->zone_time.getEQTimeZone()); LoadTickItems(); @@ -1019,32 +1019,32 @@ bool Zone::Init(bool iStaticZone) { } void Zone::ReloadStaticData() { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading Zone Static Data..."); + Log.Out(Logs::General, Logs::Status, "Reloading Zone Static Data..."); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading static zone points..."); + Log.Out(Logs::General, Logs::Status, "Reloading static zone points..."); zone_point_list.Clear(); if (!database.LoadStaticZonePoints(&zone_point_list, GetShortName(), GetInstanceVersion())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Loading static zone points failed."); + Log.Out(Logs::General, Logs::Error, "Loading static zone points failed."); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading traps..."); + Log.Out(Logs::General, Logs::Status, "Reloading traps..."); entity_list.RemoveAllTraps(); if (!database.LoadTraps(GetShortName(), GetInstanceVersion())) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading traps failed."); + Log.Out(Logs::General, Logs::Error, "Reloading traps failed."); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading ground spawns..."); + Log.Out(Logs::General, Logs::Status, "Reloading ground spawns..."); if (!LoadGroundSpawns()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading ground spawns failed. continuing."); + Log.Out(Logs::General, Logs::Error, "Reloading ground spawns failed. continuing."); } entity_list.RemoveAllObjects(); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Reloading World Objects from DB..."); + Log.Out(Logs::General, Logs::Status, "Reloading World Objects from DB..."); if (!LoadZoneObjects()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Reloading World Objects failed. continuing."); + Log.Out(Logs::General, Logs::Error, "Reloading World Objects failed. continuing."); } entity_list.RemoveAllDoors(); @@ -1060,7 +1060,7 @@ void Zone::ReloadStaticData() { if (!LoadZoneCFG(zone->GetShortName(), zone->GetInstanceVersion(), true)) // try loading the zone name... LoadZoneCFG(zone->GetFileName(), zone->GetInstanceVersion()); // if that fails, try the file name, then load defaults - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zone Static Data Reloaded."); + Log.Out(Logs::General, Logs::Status, "Zone Static Data Reloaded."); } bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDefault) @@ -1072,7 +1072,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.Out(Logs::General, Logs::Error, "Error loading the Zone Config."); return false; } } @@ -1087,7 +1087,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe if(!database.GetZoneCFG(database.GetZoneID(filename), 0, &newzone_data, can_bind, can_combat, can_levitate, can_castoutdoor, is_city, is_hotzone, allow_mercs, zone_type, default_ruleset, &map_name)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error loading the Zone Config."); + Log.Out(Logs::General, Logs::Error, "Error loading the Zone Config."); return false; } } @@ -1098,7 +1098,7 @@ bool Zone::LoadZoneCFG(const char* filename, uint16 instance_id, bool DontLoadDe strcpy(newzone_data.zone_long_name, GetLongName()); strcpy(newzone_data.zone_short_name2, GetShortName()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Successfully loaded Zone Config."); + Log.Out(Logs::General, Logs::Status, "Successfully loaded Zone Config."); return true; } @@ -1403,11 +1403,11 @@ void Zone::ChangeWeather() weathertimer = weatherTimerRule*1000; Weather_Timer->Start(weathertimer); } - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); + Log.Out(Logs::General, Logs::None, "The next weather check for zone: %s will be in %i seconds.", zone->GetShortName(), Weather_Timer->GetRemainingTime()/1000); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); + Log.Out(Logs::General, Logs::None, "The weather for zone: %s has changed. Old weather was = %i. New weather is = %i The next check will be in %i seconds. Rain chance: %i, Rain duration: %i, Snow chance %i, Snow duration: %i", zone->GetShortName(), tmpOldWeather, zone_weather,Weather_Timer->GetRemainingTime()/1000,rainchance,rainduration,snowchance,snowduration); this->weatherSend(); } } @@ -1492,7 +1492,7 @@ void Zone::Repop(uint32 delay) { quest_manager.ClearAllTimers(); if (!database.PopulateZoneSpawnList(zoneid, spawn2_list, GetInstanceVersion(), delay)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); + Log.Out(Logs::General, Logs::None, "Error in Zone::Repop: database.PopulateZoneSpawnList failed"); initgrids_timer.Start(); @@ -1580,8 +1580,8 @@ ZonePoint* Zone::GetClosestZonePoint(float x, float y, float z, uint32 to, Clien { if(client) client->CheatDetected(MQZoneUnknownDest, x, y, z); // Someone is trying to use /zone - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, ". %f x %f y %f z ", x, y, z); + Log.Out(Logs::General, Logs::Status, "WARNING: Closest zone point for zone id %d is %f, you might need to update your zone_points table if you dont arrive at the right spot.", to, closest_dist); + Log.Out(Logs::General, Logs::Status, ". %f x %f y %f z ", x, y, z); } if(closest_dist > max_distance2) @@ -1861,7 +1861,7 @@ void Zone::LoadBlockedSpells(uint32 zoneid) blocked_spells = new ZoneSpellsBlocked[totalBS]; if(!database.LoadBlockedSpells(totalBS, blocked_spells, zoneid)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "... Failed to load blocked spells."); + Log.Out(Logs::General, Logs::Error, "... Failed to load blocked spells."); ClearBlockedSpells(); } } @@ -1996,7 +1996,7 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2017,7 +2017,7 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2059,7 +2059,7 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2105,7 +2105,7 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2153,7 +2153,7 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2228,7 +2228,7 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -2262,7 +2262,7 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 18c357bc2..58df1a7fb 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,7 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } @@ -112,7 +112,7 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } @@ -201,7 +201,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -212,7 +212,7 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -225,7 +225,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -255,7 +255,7 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } @@ -426,7 +426,7 @@ void ZoneDatabase::GetEventLogs(const char* name,char* target,uint32 account_id, void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) { if (!container) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); + Log.Out(Logs::General, Logs::Error, "Programming error: LoadWorldContainer passed nullptr pointer"); return; } @@ -434,7 +434,7 @@ void ZoneDatabase::LoadWorldContainer(uint32 parentid, ItemInst* container) "FROM object_contents WHERE parentid = %i", parentid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in DB::LoadWorldContainer: %s", results.ErrorMessage().c_str()); return; } @@ -499,7 +499,7 @@ void ZoneDatabase::SaveWorldContainer(uint32 zone_id, uint32 parent_id, const It augslot[0], augslot[1], augslot[2], augslot[3], augslot[4], augslot[5]); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::SaveWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -511,7 +511,7 @@ void ZoneDatabase::DeleteWorldContainer(uint32 parent_id, uint32 zone_id) std::string query = StringFormat("DELETE FROM object_contents WHERE parentid = %i AND zoneid = %i", parent_id, zone_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::DeleteWorldContainer: %s", results.ErrorMessage().c_str()); } @@ -523,14 +523,14 @@ Trader_Struct* ZoneDatabase::LoadTraderItem(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id = %i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.Out(Logs::Detail, Logs::Trading, "Failed to load trader information!\n"); return loadti; } loadti->Code = BazaarTrader_ShowItems; for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[4]) < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.Out(Logs::Detail, Logs::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -548,13 +548,13 @@ TraderCharges_Struct* ZoneDatabase::LoadTraderItemWithCharges(uint32 char_id) std::string query = StringFormat("SELECT * FROM trader WHERE char_id=%i ORDER BY slot_id LIMIT 80", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Failed to load trader information!\n"); + Log.Out(Logs::Detail, Logs::Trading, "Failed to load trader information!\n"); return loadti; } for (auto row = results.begin(); row != results.end(); ++row) { if (atoi(row[5]) >= 80 || atoi(row[5]) < 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad Slot number when trying to load trader information!\n"); + Log.Out(Logs::Detail, Logs::Trading, "Bad Slot number when trying to load trader information!\n"); continue; } @@ -574,7 +574,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { return nullptr; if (results.RowCount() == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Bad result from query\n"); fflush(stdout); + Log.Out(Logs::Detail, Logs::Trading, "Bad result from query\n"); fflush(stdout); return nullptr; } @@ -587,7 +587,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { const Item_Struct *item = database.GetItem(ItemID); if(!item) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item\n"); + Log.Out(Logs::Detail, Logs::Trading, "Unable to create item\n"); fflush(stdout); return nullptr; } @@ -597,7 +597,7 @@ ItemInst* ZoneDatabase::LoadSingleTraderItem(uint32 CharID, int SerialNumber) { ItemInst* inst = database.CreateItem(item); if(!inst) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Unable to create item instance\n"); + Log.Out(Logs::Detail, Logs::Trading, "Unable to create item instance\n"); fflush(stdout); return nullptr; } @@ -619,25 +619,25 @@ void ZoneDatabase::SaveTraderItem(uint32 CharID, uint32 ItemID, uint32 SerialNum CharID, ItemID, SerialNumber, Charges, ItemCost, Slot); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to save trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemCharges(int CharID, uint32 SerialNumber, int32 Charges) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); + Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderItemCharges(%i, %i, %i)", CharID, SerialNumber, Charges); std::string query = StringFormat("UPDATE trader SET charges = %i WHERE char_id = %i AND serialnumber = %i", Charges, CharID, SerialNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update charges for trader item: %i for char_id: %i, the error was: %s\n", SerialNumber, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charges, uint32 NewPrice) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); + Log.Out(Logs::Detail, Logs::Trading, "ZoneDatabase::UpdateTraderPrice(%i, %i, %i, %i)", CharID, ItemID, Charges, NewPrice); const Item_Struct *item = database.GetItem(ItemID); @@ -645,12 +645,12 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg return; if(NewPrice == 0) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); + Log.Out(Logs::Detail, Logs::Trading, "Removing Trader items from the DB for CharID %i, ItemID %i", CharID, ItemID); std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i AND item_id = %i",CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to remove trader item(s): %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -661,7 +661,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID, Charges); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); return; } @@ -671,7 +671,7 @@ void ZoneDatabase::UpdateTraderItemPrice(int CharID, uint32 ItemID, uint32 Charg NewPrice, CharID, ItemID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update price for trader item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 char_id){ @@ -680,7 +680,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ const std::string query = "DELETE FROM trader"; auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete all trader items data, the error was: %s\n", results.ErrorMessage().c_str()); return; } @@ -688,7 +688,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 char_id){ std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i", char_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n", char_id, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { @@ -696,7 +696,7 @@ void ZoneDatabase::DeleteTraderItem(uint32 CharID,uint16 SlotID) { std::string query = StringFormat("DELETE FROM trader WHERE char_id = %i And slot_id = %i", CharID, SlotID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete trader item data for char_id: %i, the error was: %s\n",CharID, results.ErrorMessage().c_str()); } void ZoneDatabase::DeleteBuyLines(uint32 CharID) { @@ -705,7 +705,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { const std::string query = "DELETE FROM buyer"; auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete all buyer items data, the error was: %s\n",results.ErrorMessage().c_str()); return; } @@ -713,7 +713,7 @@ void ZoneDatabase::DeleteBuyLines(uint32 CharID) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i", CharID); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete buyer item data for charid: %i, the error was: %s\n",CharID,results.ErrorMessage().c_str()); } @@ -722,7 +722,7 @@ void ZoneDatabase::AddBuyLine(uint32 CharID, uint32 BuySlot, uint32 ItemID, cons CharID, BuySlot, ItemID, ItemName, Quantity, Price); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to save buline item: %i for char_id: %i, the error was: %s\n", ItemID, CharID, results.ErrorMessage().c_str()); } @@ -730,7 +730,7 @@ void ZoneDatabase::RemoveBuyLine(uint32 CharID, uint32 BuySlot) { std::string query = StringFormat("DELETE FROM buyer WHERE charid = %i AND buyslot = %i", CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to delete buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -743,7 +743,7 @@ void ZoneDatabase::UpdateBuyLine(uint32 CharID, uint32 BuySlot, uint32 Quantity) std::string query = StringFormat("UPDATE buyer SET quantity = %i WHERE charid = %i AND buyslot = %i", Quantity, CharID, BuySlot); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to update quantity in buyslot %i for charid: %i, the error was: %s\n", BuySlot, CharID, results.ErrorMessage().c_str()); } @@ -1219,7 +1219,7 @@ bool ZoneDatabase::LoadCharacterBindPoint(uint32 character_id, PlayerProfile_Str bool ZoneDatabase::SaveCharacterLanguage(uint32 character_id, uint32 lang_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_languages` (id, lang_id, value) VALUES (%u, %u, %u)", character_id, lang_id, value); QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterLanguage for character ID: %i, lang_id:%u value:%u done", character_id, lang_id, value); return true; } @@ -1231,10 +1231,10 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u /* Save Home Bind Point */ std::string query = StringFormat("REPLACE INTO `character_bind` (id, zone_id, instance_id, x, y, z, heading, is_home)" " VALUES (%u, %u, %u, %f, %f, %f, %f, %i)", character_id, zone_id, instance_id, x, y, z, heading, is_home); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); + Log.Out(Logs::General, Logs::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } @@ -1245,20 +1245,20 @@ bool ZoneDatabase::SaveCharacterMaterialColor(uint32 character_id, uint32 slot_i uint8 blue = (color & 0x000000FF); std::string query = StringFormat("REPLACE INTO `character_material` (id, slot, red, green, blue, color, use_tint) VALUES (%u, %u, %u, %u, %u, %u, 255)", character_id, slot_id, red, green, blue, color); auto results = QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterMaterialColor for character ID: %i, slot_id: %u color: %u done", character_id, slot_id, color); return true; } bool ZoneDatabase::SaveCharacterSkill(uint32 character_id, uint32 skill_id, uint32 value){ std::string query = StringFormat("REPLACE INTO `character_skills` (id, skill_id, value) VALUES (%u, %u, %u)", character_id, skill_id, value); auto results = QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterSkill for character ID: %i, skill_id:%u value:%u done", character_id, skill_id, value); return true; } bool ZoneDatabase::SaveCharacterDisc(uint32 character_id, uint32 slot_id, uint32 disc_id){ std::string query = StringFormat("REPLACE INTO `character_disciplines` (id, slot_id, disc_id) VALUES (%u, %u, %u)", character_id, slot_id, disc_id); auto results = QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterDisc for character ID: %i, slot:%u disc_id:%u done", character_id, slot_id, disc_id); return true; } @@ -1270,7 +1270,7 @@ bool ZoneDatabase::SaveCharacterTribute(uint32 character_id, PlayerProfile_Struc if (pp->tributes[i].tribute > 0 && pp->tributes[i].tribute != TRIBUTE_NONE){ std::string query = StringFormat("REPLACE INTO `character_tribute` (id, tier, tribute) VALUES (%u, %u, %u)", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterTribute for character ID: %i, tier:%u tribute:%u done", character_id, pp->tributes[i].tier, pp->tributes[i].tribute); } } return true; @@ -1281,7 +1281,7 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i DoEscapeString(bandolier_name_esc, bandolier_name, strlen(bandolier_name)); std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } @@ -1596,7 +1596,7 @@ bool ZoneDatabase::SaveCharacterData(uint32 character_id, uint32 account_id, Pla m_epp->expended_aa ); auto results = database.QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterData %i, done... Took %f seconds", character_id, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); return true; } @@ -1637,7 +1637,7 @@ bool ZoneDatabase::SaveCharacterCurrency(uint32 character_id, PlayerProfile_Stru pp->currentEbonCrystals, pp->careerEbonCrystals); auto results = database.QueryDatabase(query); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Saving Currency for character ID: %i, done", character_id); + Log.Out(Logs::General, Logs::None, "Saving Currency for character ID: %i, done", character_id); return true; } @@ -1646,7 +1646,7 @@ bool ZoneDatabase::SaveCharacterAA(uint32 character_id, uint32 aa_id, uint32 cur " VALUES (%u, %u, %u)", character_id, aa_id, current_level); auto results = QueryDatabase(rquery); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); + Log.Out(Logs::General, Logs::None, "Saving AA for character ID: %u, aa_id: %u current_level: %u", character_id, aa_id, current_level); return true; } @@ -2341,7 +2341,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { std::string query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error While Deleting Merc Buffs before save: %s", results.ErrorMessage().c_str()); return; } @@ -2367,7 +2367,7 @@ void ZoneDatabase::SaveMercBuffs(Merc *merc) { buffs[buffCount].caston_z, buffs[buffCount].ExtraDIChance); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Saving Merc Buffs: %s", results.ErrorMessage().c_str()); break; } } @@ -2386,7 +2386,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { merc->GetMercID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); return; } @@ -2431,7 +2431,7 @@ void ZoneDatabase::LoadMercBuffs(Merc *merc) { query = StringFormat("DELETE FROM merc_buffs WHERE MercId = %u", merc->GetMercID()); results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Loading Merc Buffs: %s", results.ErrorMessage().c_str()); } @@ -2447,14 +2447,14 @@ bool ZoneDatabase::DeleteMerc(uint32 merc_id) { auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Deleting Merc Buffs: %s", results.ErrorMessage().c_str()); } query = StringFormat("DELETE FROM mercs WHERE MercID = '%u'", merc_id); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Deleting Merc: %s", results.ErrorMessage().c_str()); return false; } @@ -2472,7 +2472,7 @@ void ZoneDatabase::LoadMercEquipment(Merc *merc) { merc->GetLevel(), merc->GetLevel()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error Loading Merc Inventory: %s", results.ErrorMessage().c_str()); return; } @@ -2646,7 +2646,7 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2665,7 +2665,7 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } @@ -2696,7 +2696,7 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked* into, uint32 zoneid) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Loading Blocked Spells from database..."); + Log.Out(Logs::General, Logs::Status, "Loading Blocked Spells from database..."); std::string query = StringFormat("SELECT id, spellid, type, x, y, z, x_diff, y_diff, z_diff, message " "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); @@ -2825,7 +2825,7 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::mapCharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3059,7 +3059,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3087,7 +3087,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3128,7 +3128,7 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } @@ -3860,7 +3860,7 @@ Corpse* ZoneDatabase::SummonBuriedCharacterCorpses(uint32 char_id, uint32 dest_z NewCorpse->SetDecayTimer(RuleI(Character, CorpseDecayTimeMS)); NewCorpse->Spawn(); if (!UnburyCharacterCorpse(NewCorpse->GetCorpseDBID(), dest_zone_id, dest_instance_id, dest_x, dest_y, dest_z, dest_heading)) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); + Log.Out(Logs::General, Logs::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } } @@ -3903,7 +3903,7 @@ bool ZoneDatabase::SummonAllCharacterCorpses(uint32 char_id, uint32 dest_zone_id ++CorpseCount; } else{ - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Unable to construct a player corpse for character id %u.", char_id); + Log.Out(Logs::General, Logs::Error, "Unable to construct a player corpse for character id %u.", char_id); } } diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 8797ed7fa..53235176b 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -44,12 +44,12 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { zoning = true; if (app->size != sizeof(ZoneChange_Struct)) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); + Log.Out(Logs::General, Logs::None, "Wrong size: OP_ZoneChange, size=%d, expected %d", app->size, sizeof(ZoneChange_Struct)); return; } #if EQDEBUG >= 5 - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Zone request from %s", GetName()); + Log.Out(Logs::General, Logs::None, "Zone request from %s", GetName()); DumpPacket(app); #endif ZoneChange_Struct* zc=(ZoneChange_Struct*)app->pBuffer; @@ -97,7 +97,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { CheatDetected(MQZone, zc->x, zc->y, zc->z); Message(13, "Invalid unsolicited zone request."); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.Out(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -129,7 +129,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //if we didnt get a zone point, or its to a different zone, //then we assume this is invalid. if(!zone_point || zone_point->target_zone_id != target_zone_id) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); + Log.Out(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%d'.", GetName(), target_zone_id); CheatDetected(MQGate, zc->x, zc->y, zc->z); SendZoneCancel(zc); return; @@ -160,7 +160,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(target_zone_name == nullptr) { //invalid zone... Message(13, "Invalid target zone ID."); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); + Log.Out(Logs::General, Logs::Error, "Zoning %s: Unable to get zone name for zone id '%d'.", GetName(), target_zone_id); SendZoneCancel(zc); return; } @@ -173,7 +173,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { if(!database.GetSafePoints(target_zone_name, database.GetInstanceVersion(target_instance_id), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //invalid zone... Message(13, "Invalid target zone while getting safe points."); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); + Log.Out(Logs::General, Logs::Error, "Zoning %s: Unable to get safe coordinates for zone '%s'.", GetName(), target_zone_name); SendZoneCancel(zc); return; } @@ -193,7 +193,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { switch(zone_mode) { case EvacToSafeCoords: case ZoneToSafeCoords: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); + Log.Out(Logs::General, Logs::None, "Zoning %s to safe coords (%f,%f,%f) in %s (%d)", GetName(), safe_x, safe_y, safe_z, target_zone_name, target_zone_id); dest_x = safe_x; dest_y = safe_y; dest_z = safe_z; @@ -253,7 +253,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //could not find a valid reason for them to be zoning, stop it. CheatDetected(MQZoneUnknownDest, 0.0, 0.0, 0.0); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); + Log.Out(Logs::General, Logs::Error, "Zoning %s: Invalid unsolicited zone request to zone id '%s'. Not near a zone point.", GetName(), target_zone_name); SendZoneCancel(zc); return; default: @@ -288,7 +288,7 @@ void Client::Handle_OP_ZoneChange(const EQApplicationPacket *app) { //we have successfully zoned DoZoneSuccess(zc, target_zone_id, target_instance_id, dest_x, dest_y, dest_z, dest_h, ignorerestrictions); } else { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); + Log.Out(Logs::General, Logs::Error, "Zoning %s: Rules prevent this char from zoning into '%s'", GetName(), target_zone_name); SendZoneError(zc, myerror); } } @@ -312,7 +312,7 @@ void Client::SendZoneCancel(ZoneChange_Struct *zc) { void Client::SendZoneError(ZoneChange_Struct *zc, int8 err) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); + Log.Out(Logs::General, Logs::Error, "Zone %i is not available because target wasn't found or character insufficent level", zc->zoneID); SetPortExemption(true); @@ -347,7 +347,7 @@ void Client::DoZoneSuccess(ZoneChange_Struct *zc, uint16 zone_id, uint32 instanc if(this->GetPet()) entity_list.RemoveFromHateLists(this->GetPet()); - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); + Log.Out(Logs::General, Logs::Status, "Zoning '%s' to: %s (%i) - (%i) x=%f, y=%f, z=%f", m_pp.name, database.GetZoneName(zone_id), zone_id, instance_id, dest_x, dest_y, dest_z); //set the player's coordinates in the new zone so they have them //when they zone into it @@ -472,7 +472,7 @@ void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, ZonePC(zoneID, instance_id, x, y, z, heading, ignorerestrictions, zm); break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); + Log.Out(Logs::General, Logs::Error, "Client::ProcessMovePC received a reguest to perform an unsupported client zone operation."); break; } } @@ -534,7 +534,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z heading = m_pp.binds[0].heading; zonesummon_ignorerestrictions = 1; - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); + Log.Out(Logs::General, Logs::None, "Player %s has died and will be zoned to bind point in zone: %s at LOC x=%f, y=%f, z=%f, heading=%f", GetName(), pZoneName, m_pp.binds[0].x, m_pp.binds[0].y, m_pp.binds[0].z, m_pp.binds[0].heading); break; case SummonPC: zonesummon_x = x_pos = x; @@ -543,14 +543,14 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z SetHeading(heading); break; case Rewind: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); + Log.Out(Logs::General, Logs::None, "%s has requested a /rewind from %f, %f, %f, to %f, %f, %f in %s", GetName(), x_pos, y_pos, z_pos, rewind_x, rewind_y, rewind_z, zone->GetShortName()); zonesummon_x = x_pos = x; zonesummon_y = y_pos = y; zonesummon_z = z_pos = z; SetHeading(heading); break; default: - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); + Log.Out(Logs::General, Logs::Error, "Client::ZonePC() received a reguest to perform an unsupported client zone operation."); ReadyToZone = false; break; } @@ -680,7 +680,7 @@ void Client::ZonePC(uint32 zoneID, uint32 instance_id, float x, float y, float z safe_delete(outapp); } - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); + Log.Out(Logs::Detail, Logs::None, "Player %s has requested a zoning to LOC x=%f, y=%f, z=%f, heading=%f in zoneid=%i", GetName(), x, y, z, heading, zoneID); //Clear zonesummon variables if we're zoning to our own zone //Client wont generate a zone change packet to the server in this case so //They aren't needed and it keeps behavior on next zone attempt from being undefined. @@ -768,7 +768,7 @@ void Client::SetZoneFlag(uint32 zone_id) { std::string query = StringFormat("INSERT INTO zone_flags (charID,zoneID) VALUES(%d,%d)", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "MySQL Error while trying to set zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } void Client::ClearZoneFlag(uint32 zone_id) { @@ -781,7 +781,7 @@ void Client::ClearZoneFlag(uint32 zone_id) { std::string query = StringFormat("DELETE FROM zone_flags WHERE charID=%d AND zoneID=%d", CharacterID(), zone_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "MySQL Error while trying to clear zone flag for %s: %s", GetName(), results.ErrorMessage().c_str()); } @@ -791,7 +791,7 @@ void Client::LoadZoneFlags() { std::string query = StringFormat("SELECT zoneID from zone_flags WHERE charID=%d", CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(EQEmuLogSys::General, EQEmuLogSys::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); + Log.Out(Logs::General, Logs::Error, "MySQL Error while trying to load zone flags for %s: %s", GetName(), results.ErrorMessage().c_str()); return; } @@ -854,23 +854,23 @@ bool Client::CanBeInZone() { char flag_needed[128]; if(!database.GetSafePoints(zone->GetShortName(), zone->GetInstanceVersion(), &safe_x, &safe_y, &safe_z, &minstatus, &minlevel, flag_needed)) { //this should not happen... - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Unable to query zone info for ourself '%s'", zone->GetShortName()); return(false); } if(GetLevel() < minlevel) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Character does not meet min level requirement (%d < %d)!", GetLevel(), minlevel); return(false); } if(Admin() < minstatus) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Character does not meet min status requirement (%d < %d)!", Admin(), minstatus); return(false); } if(flag_needed[0] != '\0') { //the flag needed string is not empty, meaning a flag is required. if(Admin() < minStatusToIgnoreZoneFlags && !HasZoneFlag(zone->GetZoneID())) { - Log.Out(EQEmuLogSys::Detail, EQEmuLogSys::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); + Log.Out(Logs::Detail, Logs::None, "[CLIENT] Character does not have the flag to be in this zone (%s)!", flag_needed); return(false); } } From 1ae69aa18019dc0935bd42e9e7bd53c99c4c7eda Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:35:15 -0600 Subject: [PATCH 180/707] Update debug levels --- common/eqemu_logsys.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d77ee3b6b..d92fc25aa 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -28,9 +28,9 @@ namespace Logs{ enum DebugLevel { - General = 0, /* 0 - Low-Level general debugging, useful info on single line */ - Moderate, /* 1 - Informational based, used in functions, when particular things load */ - Detail, /* 2 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ + General = 1, /* 1 - Low-Level general debugging, useful info on single line */ + Moderate, /* 2 - Informational based, used in functions, when particular things load */ + Detail, /* 3 - Use this for extreme detail in logging, usually in extreme debugging in the stack or interprocess communication */ }; /* From 3320867b108bd4b45d0eb54dd6c270bee82b2760 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:40:58 -0600 Subject: [PATCH 181/707] delete world/world_logsys.cpp --- world/CMakeLists.txt | 1 - world/world_logsys.cpp | 59 ------------------------------------------ 2 files changed, 60 deletions(-) delete mode 100644 world/world_logsys.cpp diff --git a/world/CMakeLists.txt b/world/CMakeLists.txt index a9dd63478..fa13aef5d 100644 --- a/world/CMakeLists.txt +++ b/world/CMakeLists.txt @@ -25,7 +25,6 @@ SET(world_sources queryserv.cpp ucs.cpp wguild_mgr.cpp - world_logsys.cpp world_config.cpp worlddb.cpp zonelist.cpp diff --git a/world/world_logsys.cpp b/world/world_logsys.cpp deleted file mode 100644 index 3cfada073..000000000 --- a/world/world_logsys.cpp +++ /dev/null @@ -1,59 +0,0 @@ - -#include "../common/debug.h" -#include "../common/logsys.h" -#include "../common/string_util.h" - -#include "zoneserver.h" -#include "client.h" - -#include -#include - - -void log_message_clientVA(LogType type, Client *who, const char *fmt, va_list args) { - - std::string prefix_buffer = StringFormat("[%s] %s: ", log_type_info[type].name, who->GetAccountName()); - - LogFile->writePVA(EQEmuLog::Debug, prefix_buffer.c_str(), fmt, args); -} - -void log_message_client(LogType type, Client *who, const char *fmt, ...) { - va_list args; - va_start(args, fmt); - log_message_clientVA(type, who, fmt, args); - va_end(args); -} - -void log_message_zoneVA(LogType type, ZoneServer *who, const char *fmt, va_list args) { - - std::string prefix_buffer, zone_tag; - const char *zone_name=who->GetZoneName(); - - if (zone_name == nullptr) - zone_tag = StringFormat("[%d]", who->GetID()); - else - zone_tag = StringFormat("[%d] [%s]",who->GetID(),zone_name); - - prefix_buffer = StringFormat("[%s] %s ", log_type_info[type].name, zone_tag.c_str()); - - LogFile->writePVA(EQEmuLog::Debug, prefix_buffer.c_str(), fmt, args); -} - -void log_message_zone(LogType type, ZoneServer *who, const char *fmt, ...) { - va_list args; - va_start(args, fmt); - log_message_zoneVA(type, who, fmt, args); - va_end(args); -} - - - - - - - - - - - - From b71f808cb87dc3f8518ee1c436b582485ed8480c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:43:11 -0600 Subject: [PATCH 182/707] Gut some more debug functions --- common/debug.cpp | 191 +---------------------------------------------- common/debug.h | 5 +- 2 files changed, 2 insertions(+), 194 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 7dbd28751..6f5426927 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -80,193 +80,4 @@ EQEmuLog::~EQEmuLog() fclose(fp[i]); } } -} - -bool EQEmuLog::open(LogIDs id) -{ - if (!logFileValid) { - return false; - } - if (id >= MaxLogID) { - return false; - } - LockMutex lock(&MOpen); - if (pLogStatus[id] & 4) { - return false; - } - if (fp[id]) { - //cerr<<"Warning: LogFile already open"<= MaxLogID) { - return false; - } - - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) { - return false; - } - LockMutex lock(&MLog[id]); - if (!logFileValid) { - return false; //check again for threading race reasons (to avoid two mutexes) - } - - va_list argptr, tmpargptr; - va_start(argptr, fmt); - - // Log.Log(id, vStringFormat(fmt, argptr).c_str()); - - return true; -} - -//write with Prefix and a VA_list -bool EQEmuLog::writePVA(LogIDs id, const char *prefix, const char *fmt, va_list argptr) -{ - if (!logFileValid) { - return false; - } - if (id >= MaxLogID) { - return false; - } - bool dofile = false; - if (pLogStatus[id] & 1) { - dofile = open(id); - } - if (!(dofile || pLogStatus[id] & 2)) { - return false; - } - LockMutex lock(&MLog[id]); - if (!logFileValid) { - return false; //check again for threading race reasons (to avoid two mutexes) - } - time_t aclock; - struct tm *newtime; - time( &aclock ); /* Get time in seconds */ - newtime = localtime( &aclock ); /* Convert time to struct */ - va_list tmpargptr; - if (dofile) { - #ifndef NO_PIDLOG - fprintf(fp[id], "[%02d.%02d. - %02d:%02d:%02d] %s", newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); - #else - fprintf(fp[id], "%04i [%02d.%02d. - %02d:%02d:%02d] %s", getpid(), newtime->tm_mon + 1, newtime->tm_mday, newtime->tm_hour, newtime->tm_min, newtime->tm_sec, prefix); - #endif - va_copy(tmpargptr, argptr); - vfprintf( fp[id], fmt, tmpargptr ); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "[%s] %s", LogNames[id], prefix); - vfprintf( stderr, fmt, argptr ); - } - /* Console Output */ - else { - - -#ifdef _WINDOWS - HANDLE console_handle; - console_handle = GetStdHandle(STD_OUTPUT_HANDLE); - - CONSOLE_FONT_INFOEX info = { 0 }; - info.cbSize = sizeof(info); - info.dwFontSize.Y = 12; // leave X as zero - info.FontWeight = FW_NORMAL; - wcscpy(info.FaceName, L"Lucida Console"); - SetCurrentConsoleFontEx(console_handle, NULL, &info); - - if (id == EQEmuLog::LogIDs::Status){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Error){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } - if (id == EQEmuLog::LogIDs::Normal){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightGreen); } - if (id == EQEmuLog::LogIDs::Debug){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::Yellow); } - if (id == EQEmuLog::LogIDs::Quest){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightCyan); } - if (id == EQEmuLog::LogIDs::Commands){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightMagenta); } - if (id == EQEmuLog::LogIDs::Crash){ SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::LightRed); } -#endif - - fprintf(stdout, "[%s] %s", LogNames[id], prefix); - vfprintf(stdout, fmt, argptr); - -#ifdef _WINDOWS - /* Always set back to white*/ - SetConsoleTextAttribute(console_handle, ConsoleColor::Colors::White); -#endif - } - } - va_end(argptr); - if (dofile) { - fprintf(fp[id], "\n"); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - fprintf(stderr, "\n"); - } else { - fprintf(stdout, "\n"); - } - } - if (dofile) { - fflush(fp[id]); - } - return true; -} - -bool EQEmuLog::writeNTS(LogIDs id, bool dofile, const char *fmt, ...) -{ - va_list argptr, tmpargptr; - va_start(argptr, fmt); - if (dofile) { - va_copy(tmpargptr, argptr); - vfprintf( fp[id], fmt, tmpargptr ); - } - if (pLogStatus[id] & 2) { - if (pLogStatus[id] & 8) { - vfprintf( stderr, fmt, argptr ); - } else { - vfprintf( stdout, fmt, argptr ); - } - } - va_end(argptr); - return true; -}; \ No newline at end of file +} \ No newline at end of file diff --git a/common/debug.h b/common/debug.h index 5c32eadce..0a1ab0fc3 100644 --- a/common/debug.h +++ b/common/debug.h @@ -91,11 +91,8 @@ public: MaxLogID /* Max, used in functions to get the max log ID */ }; - bool write(LogIDs id, const char *fmt, ...); - bool writePVA(LogIDs id, const char *prefix, const char *fmt, va_list args); + private: - bool open(LogIDs id); - bool writeNTS(LogIDs id, bool dofile, const char *fmt, ...); // no error checking, assumes is open, no locking, no timestamp, no newline Mutex MOpen; Mutex MLog[MaxLogID]; From e5f641d6b22ca11175c5b9c682d2b0b35e31bb6c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:45:18 -0600 Subject: [PATCH 183/707] Delete logsys_eqemu.cpp --- common/CMakeLists.txt | 1 - common/logsys_eqemu.cpp | 40 ---------------------------------------- 2 files changed, 41 deletions(-) delete mode 100644 common/logsys_eqemu.cpp diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 2a98f5cfb..f42288aae 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -33,7 +33,6 @@ SET(common_sources ipc_mutex.cpp item.cpp logsys.cpp - logsys_eqemu.cpp md5.cpp memory_mapped_file.cpp misc.cpp diff --git a/common/logsys_eqemu.cpp b/common/logsys_eqemu.cpp deleted file mode 100644 index f91de2cea..000000000 --- a/common/logsys_eqemu.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 "debug.h" -#include "logsys.h" -#include "string_util.h" - -#include -#include - -#include - -void log_message(LogType type, const char *fmt, ...) { - va_list args; - va_start(args, fmt); - log_messageVA(type, fmt, args); - va_end(args); -} - -void log_messageVA(LogType type, const char *fmt, va_list args) { - std::string prefix_buffer = StringFormat("[%s] ", log_type_info[type].name); - - LogFile->writePVA(EQEmuLog::Debug, prefix_buffer.c_str(), fmt, args); -} - From 9eb05ff9991a3db1f60d5d084def61847d260ffa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:46:34 -0600 Subject: [PATCH 184/707] Delete zone/zone_logsys.cpp --- zone/CMakeLists.txt | 1 - zone/zone_logsys.cpp | 68 -------------------------------------------- 2 files changed, 69 deletions(-) delete mode 100644 zone/zone_logsys.cpp diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 8cd086405..5da25e64f 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -116,7 +116,6 @@ SET(zone_sources waypoints.cpp worldserver.cpp zone.cpp - zone_logsys.cpp zone_config.cpp zonedb.cpp zoning.cpp diff --git a/zone/zone_logsys.cpp b/zone/zone_logsys.cpp deleted file mode 100644 index 10d563de7..000000000 --- a/zone/zone_logsys.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 "../common/debug.h" -#include "../common/logsys.h" -#include "../common/base_packet.h" - -#include "mob.h" - -#include - -void log_message_mob(LogType type, Mob *who, const char *fmt, ...) { - // if(!who->IsLoggingEnabled()) - // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common - - char prefix_buffer[256]; - snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName()); - prefix_buffer[255] = '\0'; - - va_list args; - va_start(args, fmt); - LogFile->writePVA(EQEmuLog::Debug, prefix_buffer, fmt, args); - va_end(args); -} - -void log_message_mobVA(LogType type, Mob *who, const char *fmt, va_list args) { - // if(!who->IsLoggingEnabled()) - // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common - - char prefix_buffer[256]; - snprintf(prefix_buffer, 255, "[%s] %s: ", log_type_info[type].name, who->GetName()); - prefix_buffer[255] = '\0'; - - LogFile->writePVA(EQEmuLog::Debug, prefix_buffer, fmt, args); -} - -void log_hex_mob(LogType type, Mob *who, const char *data, uint32 length, uint8 padding) { - // if(!who->IsLoggingEnabled()) - // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common - - log_hex(type,data,length,padding); -} - -void log_packet_mob(LogType type, Mob *who, const BasePacket *p) { - // if(!who->IsLoggingEnabled()) - // return; //could prolly put this in the macro, but it feels even dirtier than prototyping this in common - - char buffer[80]; - p->build_header_dump(buffer); - log_message(type,"[%s] %s: %s", log_type_info[type].name, who->GetName(), buffer); - log_hex(type,(const char *)p->pBuffer,p->size); -} - From f81a8b716b532597272d8ee7a26f00e53ba8b6cb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:52:32 -0600 Subject: [PATCH 185/707] Rip out load_log_settings in all projects --- client_files/export/main.cpp | 3 --- client_files/import/main.cpp | 3 --- common/logsys.cpp | 13 +++++++++---- common/logsys.h | 4 +--- queryserv/queryserv.cpp | 6 ------ shared_memory/main.cpp | 3 --- ucs/ucs.cpp | 5 ----- world/net.cpp | 6 ------ zone/net.cpp | 9 --------- 9 files changed, 10 insertions(+), 42 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 5152cf008..45dd34cec 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -45,9 +45,6 @@ int main(int argc, char **argv) { } const EQEmuConfig *config = EQEmuConfig::get(); - if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Out(Logs::General, Logs::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); - } SharedDatabase database; Log.Out(Logs::General, Logs::Status, "Connecting to database..."); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index f390d2b0b..8567723ce 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -43,9 +43,6 @@ int main(int argc, char **argv) { } const EQEmuConfig *config = EQEmuConfig::get(); - if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Out(Logs::General, Logs::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); - } SharedDatabase database; Log.Out(Logs::General, Logs::Status, "Connecting to database..."); diff --git a/common/logsys.cpp b/common/logsys.cpp index c01baf04e..f1fa6ed53 100644 --- a/common/logsys.cpp +++ b/common/logsys.cpp @@ -16,6 +16,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +/* + #include "debug.h" #include "eq_packet.h" #include "logsys.h" @@ -37,8 +39,9 @@ const char *log_category_names[NUMBER_OF_LOG_CATEGORIES] = { static LogTypeStatus real_log_type_info[NUMBER_OF_LOG_TYPES+1] = { #include "logtypes.h" - { false, NUMBER_OF_LOG_CATEGORIES, "BAD TYPE" } /* dummy trailing record */ + { false, NUMBER_OF_LOG_CATEGORIES, "BAD TYPE" } /* dummy trailing record }; + const LogTypeStatus *log_type_info = real_log_type_info; @@ -50,7 +53,7 @@ void log_hex(LogType type, const void *data, unsigned long length, unsigned char uint32 offset; for(offset=0;offsetbuild_header_dump(buffer); - log_message(type,"%s", buffer); + //log_message(type,"%s", buffer); log_hex(type,(const char *)p->pBuffer,p->size); } @@ -68,7 +71,7 @@ void log_raw_packet(LogType type, uint16 seq, const BasePacket *p) { return; char buffer[196]; p->build_raw_header_dump(buffer, seq); - log_message(type,buffer); + //log_message(type,buffer); log_hex(type,(const char *)p->pBuffer,p->size); } @@ -156,3 +159,5 @@ bool load_log_settings(const char *filename) { return(true); } + +*/ \ No newline at end of file diff --git a/common/logsys.h b/common/logsys.h index d65ecb928..8c2d7bd9f 100644 --- a/common/logsys.h +++ b/common/logsys.h @@ -65,8 +65,6 @@ extern const LogTypeStatus *log_type_info; // For log_packet, et all. class BasePacket; -extern void log_message(LogType type, const char *fmt, ...); -extern void log_messageVA(LogType type, const char *fmt, va_list args); extern void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding=4); extern void log_packet(LogType type, const BasePacket *p); extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); @@ -116,7 +114,7 @@ extern void log_toggle(LogType t); #define is_log_enabled( type ) \ log_type_info[ type ].enabled -extern bool load_log_settings(const char *filename); +// extern bool load_log_settings(const char *filename); #endif /*LOGSYS_H_*/ diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index f5233c29e..b67d8ad4f 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -87,12 +87,6 @@ int main() { return 1; } - /* Initialize Logging */ - if (!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(Logs::Detail, Logs::QS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); - else - Log.Out(Logs::Detail, Logs::QS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - if (signal(SIGINT, CatchSignal) == SIG_ERR) { Log.Out(Logs::Detail, Logs::QS_Server, "Could not set signal handler"); return 1; diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index dc2817f9a..ddc42cbc3 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -47,9 +47,6 @@ int main(int argc, char **argv) { } const EQEmuConfig *config = EQEmuConfig::get(); - if(!load_log_settings(config->LogSettingsFile.c_str())) { - Log.Out(Logs::General, Logs::Error, "Warning: unable to read %s.", config->LogSettingsFile.c_str()); - } SharedDatabase database; Log.Out(Logs::General, Logs::Status, "Connecting to database..."); diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 241d50775..1bbb66c16 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -89,11 +89,6 @@ int main() { Config = ucsconfig::get(); - if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(Logs::Detail, Logs::UCS_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); - else - Log.Out(Logs::Detail, Logs::UCS_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - WorldShortName = Config->ShortName; Log.Out(Logs::Detail, Logs::UCS_Server, "Connecting to MySQL..."); diff --git a/world/net.cpp b/world/net.cpp index bab38026b..8914415a4 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -133,12 +133,6 @@ int main(int argc, char** argv) { } const WorldConfig *Config=WorldConfig::get(); - if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(Logs::Detail, Logs::World_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); - else - Log.Out(Logs::Detail, Logs::World_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - - Log.Out(Logs::Detail, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG diff --git a/zone/net.cpp b/zone/net.cpp index 987124ea1..a299da25a 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -155,11 +155,6 @@ int main(int argc, char** argv) { } const ZoneConfig *Config=ZoneConfig::get(); - if(!load_log_settings(Config->LogSettingsFile.c_str())) - Log.Out(Logs::Detail, Logs::Zone_Server, "Warning: Unable to read %s", Config->LogSettingsFile.c_str()); - else - Log.Out(Logs::Detail, Logs::Zone_Server, "Log settings loaded from %s", Config->LogSettingsFile.c_str()); - worldserver.SetPassword(Config->SharedKey.c_str()); Log.Out(Logs::Detail, Logs::Zone_Server, "Connecting to MySQL..."); @@ -207,10 +202,6 @@ int main(int argc, char** argv) { #endif const char *log_ini_file = "./log.ini"; - if(!load_log_settings(log_ini_file)) - Log.Out(Logs::Detail, Logs::Zone_Server, "Warning: Unable to read %s", log_ini_file); - else - Log.Out(Logs::Detail, Logs::Zone_Server, "Log settings loaded from %s", log_ini_file); Log.Out(Logs::Detail, Logs::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); From 7fac4d5f524e16b67c12a093ffbb1da2d440b0f7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 02:56:51 -0600 Subject: [PATCH 186/707] More gutting of logsys.cpp/h --- zone/client_packet.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 1347fa2d5..785b464cd 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -398,7 +398,7 @@ void ClearMappedOpcode(EmuOpcode op) // client methods int Client::HandlePacket(const EQApplicationPacket *app) { - if(is_log_enabled(CLIENT__NET_IN_TRACE)) { + if(Log.log_settings[Logs::LogCategory::Netcode].log_to_console > 0) { char buffer[64]; app->build_header_dump(buffer); Log.Out(Logs::Detail, Logs::Client_Server_Packet, "Dispatch opcode: %s", buffer); From b3bedef7af1cfc1c2a0995c9770019c537406647 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 03:23:36 -0600 Subject: [PATCH 187/707] Bunch of crazy changes to remove logsys --- common/eq_stream.cpp | 20 ++++++++++---------- common/eqemu_logsys.cpp | 20 ++++++++++++++++++++ common/eqemu_logsys.h | 2 ++ common/logsys.cpp | 11 +---------- common/logsys.h | 8 +++++--- common/patches/rof.cpp | 26 +++++++++++++------------- common/patches/rof2.cpp | 26 +++++++++++++------------- common/patches/sod.cpp | 18 +++++++++--------- common/patches/sof.cpp | 4 ++-- common/patches/ss_define.h | 8 ++++---- common/patches/underfoot.cpp | 18 +++++++++--------- 11 files changed, 88 insertions(+), 73 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index c409e275b..aa08070bb 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -93,7 +93,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(EQProtocolPacket *p) { EQRawApplicationPacket *ap=nullptr; Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, p->size); - _raw(NET__APP_CREATE_HEX, 0xFFFF, p); + // _raw(NET__APP_CREATE_HEX, 0xFFFF, p); ap = p->MakeAppPacket(); return ap; } @@ -102,7 +102,7 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf { EQRawApplicationPacket *ap=nullptr; Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len); - _hex(NET__APP_CREATE_HEX, buf, len); + Log.Hex(Logs::Netcode, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; } @@ -133,7 +133,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (!Session && p->opcode!=OP_SessionRequest && p->opcode!=OP_SessionResponse) { Log.Out(Logs::Detail, Logs::Netcode, _L "Session not initialized, packet ignored" __L); - _raw(NET__DEBUG, 0xFFFF, p); + // _raw(NET__DEBUG, 0xFFFF, p); return; } @@ -144,7 +144,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) subpacket_length=*(p->pBuffer+processed); EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+processed+1,subpacket_length); Log.Out(Logs::Detail, Logs::Netcode, _L "Extracting combined packet of length %d" __L, subpacket_length); - _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); + // _raw(NET__NET_CREATE_HEX, 0xFFFF, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; @@ -185,7 +185,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Packet Queue size=%d" __L, PacketQueue.size()); @@ -194,7 +194,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } else if (check == SeqPast) { Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Packet: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); //we already got this packet but it was out of order } else { // In case we did queue one before as well. @@ -210,7 +210,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(p->pBuffer+2,p->size-2); Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined packet of length %d" __L, seq, subp->size); - _raw(NET__NET_CREATE_HEX, seq, subp); + // _raw(NET__NET_CREATE_HEX, seq, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; @@ -235,7 +235,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) SeqOrder check=CompareSequence(NextInSeq,seq); if (check == SeqFuture) { Log.Out(Logs::Detail, Logs::Netcode, _L "Future OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); PacketQueue[seq]=p->Copy(); Log.Out(Logs::Detail, Logs::Netcode, _L "OP_Fragment Queue size=%d" __L, PacketQueue.size()); @@ -244,7 +244,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } else if (check == SeqPast) { Log.Out(Logs::Detail, Logs::Netcode, _L "Duplicate OP_Fragment: Expecting Seq=%d, but got Seq=%d" __L, NextInSeq, seq); - _raw(NET__DEBUG, seq, p); + // _raw(NET__DEBUG, seq, p); SendOutOfOrderAck(seq); } else { // In case we did queue one before as well. @@ -263,7 +263,7 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) if (*(p->pBuffer+2)==0x00 && *(p->pBuffer+3)==0x19) { EQProtocolPacket *subp=MakeProtocolPacket(oversize_buffer,oversize_offset); Log.Out(Logs::Detail, Logs::Netcode, _L "seq %d, Extracting combined oversize packet of length %d" __L, seq, subp->size); - //_raw(NET__NET_CREATE_HEX, subp); + //// _raw(NET__NET_CREATE_HEX, subp); subp->copyInfo(p); ProcessPacket(subp); delete subp; diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 6f9611012..b8302fe20 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -18,9 +18,11 @@ #include "eqemu_logsys.h" +// #include "base_packet.h" #include "platform.h" #include "string_util.h" #include "database.h" +#include "misc.h" #include #include @@ -162,6 +164,24 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m #endif } +void EQEmuLogSys::Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding) { + return; + char buffer[80]; + uint32 offset; + for (offset = 0; offset < length; offset += 16) { + build_hex_line((const char *)data, length, offset, buffer, padding); + // log_message(type, "%s", buffer); //%s is to prevent % escapes in the ascii + } +} + +void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) { + return; + char buffer[196]; + p->build_raw_header_dump(buffer, seq); + //log_message(type,buffer); + EQEmuLogSys::Hex(log_category, (const char *)p->pBuffer, p->size); +} + void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d92fc25aa..5288128fc 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -129,6 +129,8 @@ public: void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); + void Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding); + void Raw(uint16 log_category, uint16 seq, const BasePacket *p); struct LogSettings{ uint8 log_to_file; diff --git a/common/logsys.cpp b/common/logsys.cpp index f1fa6ed53..8e56ea9d7 100644 --- a/common/logsys.cpp +++ b/common/logsys.cpp @@ -46,16 +46,7 @@ const LogTypeStatus *log_type_info = real_log_type_info; -void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding) { - if(!is_log_enabled(type)) - return; - char buffer[80]; - uint32 offset; - for(offset=0;offset #include "types.h" @@ -70,7 +71,6 @@ extern void log_packet(LogType type, const BasePacket *p); extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #ifndef DISABLE_LOGSYS -/* these are macros which do not use ..., and work for anybody */ #define _hex( type, data, len) \ do { \ if(log_type_info[ type ].enabled) { \ @@ -83,7 +83,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); log_packet(type, packet); \ } \ } while(false) - #define _raw( type, seq, packet) \ + #define // _raw( type, seq, packet) \ do { \ if(log_type_info[ type ].enabled) { \ log_raw_packet(type, seq, packet); \ @@ -93,7 +93,7 @@ extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); #else #define _hex( type, data, len) {} #define _pkt( type, packet) {} - #define _raw( type, seq, packet) {} + #define // _raw( type, seq, packet) {} #endif //!DISABLE_LOGSYS #ifdef ZONE class Mob; @@ -114,6 +114,8 @@ extern void log_toggle(LogType t); #define is_log_enabled( type ) \ log_type_info[ type ].enabled +*/ + // extern bool load_log_settings(const char *filename); #endif /*LOGSYS_H_*/ diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 33eac8c24..53b0e9fed 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -592,7 +592,7 @@ namespace RoF delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -986,7 +986,7 @@ namespace RoF structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -1062,7 +1062,7 @@ namespace RoF VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -1090,7 +1090,7 @@ namespace RoF GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2567,7 +2567,7 @@ namespace RoF outapp->WriteUInt32(outapp->size - 9); CRC32::SetEQChecksum(outapp->pBuffer, outapp->size - 1, 8); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); delete in; @@ -2809,7 +2809,7 @@ namespace RoF } } - _hex(NET__ERROR, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); FINISH_ENCODE(); } @@ -3567,7 +3567,7 @@ namespace RoF VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -3905,7 +3905,7 @@ namespace RoF Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4299,7 +4299,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4313,7 +4313,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4327,7 +4327,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4341,7 +4341,7 @@ namespace RoF { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4503,7 +4503,7 @@ namespace RoF emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); - _hex(NET__ERROR, eq, sizeof(structs::MoveItem_Struct)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::MoveItem_Struct)); FINISH_DIRECT_DECODE(); } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index 7421eefbd..d376bfb5e 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -658,7 +658,7 @@ namespace RoF2 delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -1052,7 +1052,7 @@ namespace RoF2 structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -1128,7 +1128,7 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -1156,7 +1156,7 @@ namespace RoF2 GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2651,7 +2651,7 @@ namespace RoF2 outapp->WriteUInt32(outapp->size - 9); CRC32::SetEQChecksum(outapp->pBuffer, outapp->size - 1, 8); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); delete in; @@ -2893,7 +2893,7 @@ namespace RoF2 } } - _hex(NET__ERROR, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); FINISH_ENCODE(); } @@ -3634,7 +3634,7 @@ namespace RoF2 VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -3976,7 +3976,7 @@ namespace RoF2 Log.Out(Logs::General, Logs::Netcode, "[ERROR] SPAWN ENCODE LOGIC PROBLEM: Buffer pointer is now %i from end", Buffer - (BufferStart + PacketSize)); } //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawn for %s packet is %i bytes", emu->name, outapp->size); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp, ack_req); } @@ -4371,7 +4371,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -4385,7 +4385,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4399,7 +4399,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -4413,7 +4413,7 @@ namespace RoF2 { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); @@ -4574,7 +4574,7 @@ namespace RoF2 emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); - _hex(NET__ERROR, eq, sizeof(structs::MoveItem_Struct)); + Log.Hex(Logs::Netcode, eq, sizeof(structs::MoveItem_Struct)); FINISH_DIRECT_DECODE(); } diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index a19c4c45d..1639e57ed 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -398,7 +398,7 @@ namespace SoD delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -717,7 +717,7 @@ namespace SoD structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -792,7 +792,7 @@ namespace SoD VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -819,7 +819,7 @@ namespace SoD GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2288,7 +2288,7 @@ namespace SoD VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -2964,7 +2964,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -2978,7 +2978,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -2992,7 +2992,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3006,7 +3006,7 @@ namespace SoD { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index e6f804c66..2e5776a5d 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -378,7 +378,7 @@ namespace SoF delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -2097,7 +2097,7 @@ namespace SoF delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending zone spawns"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 97f824983..1d59287ad 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -65,7 +65,7 @@ #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ + Log.Hex(Logs::Netcode, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ return; \ @@ -73,7 +73,7 @@ #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, (*p)->pBuffer, (*p)->size); \ + Log.Hex(Logs::Netcode, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ return; \ @@ -128,14 +128,14 @@ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ + Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ - _hex(NET__STRUCT_HEX, __packet->pBuffer, __packet->size); \ + Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); \ return; \ } diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 8ef3f8fb7..66b379840 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -533,7 +533,7 @@ namespace Underfoot delete[] __emu_buffer; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Sending inventory to client"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); dest->FastQueuePacket(&in, ack_req); } @@ -874,7 +874,7 @@ namespace Underfoot structs::GroupGeneric_Struct *ggs = (structs::GroupGeneric_Struct*)outapp->pBuffer; memcpy(ggs->name1, gjs->yourname, sizeof(ggs->name1)); memcpy(ggs->name2, gjs->membername, sizeof(ggs->name2)); - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; @@ -950,7 +950,7 @@ namespace Underfoot VARSTRUCT_ENCODE_TYPE(uint16, Buffer, 0); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); outapp = new EQApplicationPacket(OP_GroupLeadershipAAUpdate, sizeof(GroupLeadershipAAUpdate_Struct)); @@ -976,7 +976,7 @@ namespace Underfoot GLAAus->NPCMarkerID = emu->NPCMarkerID; memcpy(&GLAAus->LeaderAAs, &emu->leader_aas, sizeof(GLAAus->LeaderAAs)); - //_hex(NET__ERROR, __packet->pBuffer, __packet->size); + //Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); FINISH_ENCODE(); @@ -2554,7 +2554,7 @@ namespace Underfoot VARSTRUCT_ENCODE_TYPE(uint32, OutBuffer, x); } - //_hex(NET__ERROR, outapp->pBuffer, outapp->size); + //Log.Hex(Logs::Netcode, outapp->pBuffer, outapp->size); dest->FastQueuePacket(&outapp); delete in; } @@ -3277,7 +3277,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_Disband"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupGeneric_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupGeneric_Struct); @@ -3291,7 +3291,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3305,7 +3305,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupFollow2"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupFollow_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupFollow_Struct); @@ -3319,7 +3319,7 @@ namespace Underfoot { //EQApplicationPacket *in = __packet; //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Received incoming OP_GroupInvite"); - //_hex(NET__ERROR, in->pBuffer, in->size); + //Log.Hex(Logs::Netcode, in->pBuffer, in->size); DECODE_LENGTH_EXACT(structs::GroupInvite_Struct); SETUP_DIRECT_DECODE(GroupGeneric_Struct, structs::GroupInvite_Struct); From 14bac9f8c03437a60687ea164270ee25145994c3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 03:25:52 -0600 Subject: [PATCH 188/707] Remove occurrences of _pkt --- ucs/clientlist.cpp | 19 ------------------- ucs/database.cpp | 3 --- world/client.cpp | 3 --- zone/client_packet.cpp | 18 ------------------ zone/spells.cpp | 1 - zone/tasks.cpp | 11 ----------- zone/trading.cpp | 22 ---------------------- zone/worldserver.cpp | 1 - 8 files changed, 78 deletions(-) diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index e665cc8fd..a518aa1a8 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -323,7 +323,6 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { VARSTRUCT_ENCODE_TYPE(uint16, PacketBuffer, 0x3237); VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x0); - _pkt(UCS__PACKETS, outapp); c->QueuePacket(outapp); @@ -344,7 +343,6 @@ static void ProcessMailTo(Client *c, std::string MailMessage) { VARSTRUCT_ENCODE_STRING(PacketBuffer, "test"); // Doesn't matter what we send in this text field. VARSTRUCT_ENCODE_STRING(PacketBuffer, "1"); - _pkt(UCS__PACKETS, outapp); c->QueuePacket(outapp); @@ -421,7 +419,6 @@ static void ProcessCommandBuddy(Client *c, std::string Buddy) { database.RemoveFriendOrIgnore(c->GetCharID(), 1, Buddy.substr(1)); } - _pkt(UCS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -465,7 +462,6 @@ static void ProcessCommandIgnore(Client *c, std::string Ignoree) { VARSTRUCT_ENCODE_STRING(PacketBuffer, Ignoree.c_str()); - _pkt(UCS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -626,7 +622,6 @@ void Clientlist::Process() { while( KeyValid && !(*Iterator)->GetForceDisconnect() && (app = (EQApplicationPacket *)(*Iterator)->ClientStream->PopPacket())) { - _pkt(UCS__PACKETS, app); EmuOpcode opcode = app->GetOpcode(); @@ -943,7 +938,6 @@ void Client::SendMailBoxes() { VARSTRUCT_ENCODE_STRING(PacketBuffer, s.c_str()); VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1087,7 +1081,6 @@ void Client::JoinChannels(std::string ChannelNameList) { sprintf(PacketBuffer, "%s", JoinedChannelsList.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1104,7 +1097,6 @@ void Client::JoinChannels(std::string ChannelNameList) { VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x00); VARSTRUCT_ENCODE_STRING(PacketBuffer, ChannelMessage.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1174,7 +1166,6 @@ void Client::LeaveChannels(std::string ChannelNameList) { sprintf(PacketBuffer, "%s", JoinedChannelsList.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1191,7 +1182,6 @@ void Client::LeaveChannels(std::string ChannelNameList) { VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x00); VARSTRUCT_ENCODE_STRING(PacketBuffer, ChannelMessage.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1275,7 +1265,6 @@ void Client::SendChannelList() { VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x00); VARSTRUCT_ENCODE_STRING(PacketBuffer, ChannelMessage.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1516,7 +1505,6 @@ void Client::SendChannelMessage(std::string ChannelName, std::string Message, Cl if(UnderfootOrLater) VARSTRUCT_ENCODE_STRING(PacketBuffer, "SPAM:0:"); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); safe_delete(outapp); @@ -1554,7 +1542,6 @@ void Client::AnnounceJoin(ChatChannel *Channel, Client *c) { VARSTRUCT_ENCODE_STRING(PacketBuffer, Channel->GetName().c_str()); VARSTRUCT_ENCODE_STRING(PacketBuffer, c->GetName().c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1574,7 +1561,6 @@ void Client::AnnounceLeave(ChatChannel *Channel, Client *c) { VARSTRUCT_ENCODE_STRING(PacketBuffer, Channel->GetName().c_str()); VARSTRUCT_ENCODE_STRING(PacketBuffer, c->GetName().c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -1599,7 +1585,6 @@ void Client::GeneralChannelMessage(std::string Message) { VARSTRUCT_ENCODE_TYPE(uint8, PacketBuffer, 0x00); VARSTRUCT_ENCODE_STRING(PacketBuffer, Message.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); safe_delete(outapp); @@ -2290,7 +2275,6 @@ void Client::SendNotification(int MailBoxNumber, std::string Subject, std::strin VARSTRUCT_ENCODE_STRING(PacketBuffer, From.c_str()); VARSTRUCT_ENCODE_STRING(PacketBuffer, Subject.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -2311,7 +2295,6 @@ void Client::ChangeMailBox(int NewMailBox) { VARSTRUCT_ENCODE_INTSTRING(buf, NewMailBox); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -2340,7 +2323,6 @@ void Client::SendFriends() { VARSTRUCT_ENCODE_STRING(PacketBuffer, (*Iterator).c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); @@ -2363,7 +2345,6 @@ void Client::SendFriends() { VARSTRUCT_ENCODE_STRING(PacketBuffer, Ignoree.c_str()); - _pkt(UCS__PACKETS, outapp); QueuePacket(outapp); diff --git a/ucs/database.cpp b/ucs/database.cpp index cb7bd3d51..dee5072fb 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -331,7 +331,6 @@ void Database::SendHeaders(Client *client) { VARSTRUCT_ENCODE_INTSTRING(packetBuffer, unknownField3); VARSTRUCT_ENCODE_INTSTRING(packetBuffer, results.RowCount()); - _pkt(UCS__PACKETS, outapp); client->QueuePacket(outapp); @@ -369,7 +368,6 @@ void Database::SendHeaders(Client *client) { VARSTRUCT_ENCODE_STRING(packetBuffer, row[2]); VARSTRUCT_ENCODE_STRING(packetBuffer, row[3]); - _pkt(UCS__PACKETS, outapp); client->QueuePacket(outapp); @@ -419,7 +417,6 @@ void Database::SendBody(Client *client, int messageNumber) { packetBuffer--; // Overwrite the null terminator VARSTRUCT_ENCODE_TYPE(uint8, packetBuffer, 0x0a); - _pkt(UCS__PACKETS, outapp); client->QueuePacket(outapp); diff --git a/world/client.cpp b/world/client.cpp index bcf709373..9b92b668e 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -916,7 +916,6 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { EmuOpcode opcode = app->GetOpcode(); Log.Out(Logs::Detail, Logs::World_Server,"Recevied EQApplicationPacket"); - _pkt(WORLD__CLIENT_TRACE,app); if (!eqs->CheckState(ESTABLISHED)) { Log.Out(Logs::Detail, Logs::World_Server,"Client disconnected (net inactive on send)"); @@ -1006,7 +1005,6 @@ bool Client::HandlePacket(const EQApplicationPacket *app) { default: { Log.Out(Logs::Detail, Logs::World_Server,"Received unknown EQApplicationPacket"); - _pkt(WORLD__CLIENT_ERR,app); return true; } } @@ -1257,7 +1255,6 @@ bool Client::GenPassKey(char* key) { void Client::QueuePacket(const EQApplicationPacket* app, bool ack_req) { Log.Out(Logs::Detail, Logs::World_Server, "Sending EQApplicationPacket OpCode 0x%04x",app->GetOpcode()); - _pkt(WORLD__CLIENT_TRACE, app); ack_req = true; // It's broke right now, dont delete this line till fix it. =P eqs->QueuePacket(app, ack_req); diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 785b464cd..20f58cc12 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -3436,7 +3436,6 @@ void Client::Handle_OP_Barter(const EQApplicationPacket *app) // uint32 Action = VARSTRUCT_DECODE_TYPE(uint32, Buf); - _pkt(TRADING__BARTER, app); switch (Action) { @@ -3606,7 +3605,6 @@ void Client::Handle_OP_BazaarInspect(const EQApplicationPacket *app) void Client::Handle_OP_BazaarSearch(const EQApplicationPacket *app) { - _pkt(TRADING__PACKETS, app); if (app->size == sizeof(BazaarSearch_Struct)) { @@ -9798,7 +9796,6 @@ void Client::Handle_OP_OpenContainer(const EQApplicationPacket *app) void Client::Handle_OP_OpenGuildTributeMaster(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_OpenGuildTributeMaster of length %d", app->size); - _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) printf("Error in OP_OpenGuildTributeMaster. Expected size of: %zu, but got: %i\n", sizeof(StartTribute_Struct), app->size); @@ -9830,7 +9827,6 @@ void Client::Handle_OP_OpenInventory(const EQApplicationPacket *app) void Client::Handle_OP_OpenTributeMaster(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_OpenTributeMaster of length %d", app->size); - _pkt(TRIBUTE__IN, app); if (app->size != sizeof(StartTribute_Struct)) printf("Error in OP_OpenTributeMaster. Expected size of: %zu, but got: %i\n", sizeof(StartTribute_Struct), app->size); @@ -11700,7 +11696,6 @@ void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) Log.Out(Logs::Detail, Logs::Spells, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); - _pkt(SPELLS__REZ, app); OPRezzAnswer(ra->action, ra->spellid, ra->zone_id, ra->instance_id, ra->x, ra->y, ra->z); @@ -11766,7 +11761,6 @@ void Client::Handle_OP_SaveOnZoneReq(const EQApplicationPacket *app) void Client::Handle_OP_SelectTribute(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_SelectTribute of length %d", app->size); - _pkt(TRIBUTE__IN, app); //we should enforce being near a real tribute master to change this //but im not sure how I wanna do that right now. @@ -13391,7 +13385,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) // SoF sends 1 or more unhandled OP_Trader packets of size 96 when a trade has completed. // I don't know what they are for (yet), but it doesn't seem to matter that we ignore them. - _pkt(TRADING__PACKETS, app); uint32 max_items = 80; @@ -13498,7 +13491,6 @@ void Client::Handle_OP_Trader(const EQApplicationPacket *app) TraderStatus_Struct* tss = (TraderStatus_Struct*)outapp->pBuffer; tss->Code = BazaarTrader_StartTraderMode2; QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); } } @@ -13539,7 +13531,6 @@ void Client::Handle_OP_TraderBuy(const EQApplicationPacket *app) // // Client has elected to buy an item from a Trader // - _pkt(TRADING__PACKETS, app); if (app->size == sizeof(TraderBuy_Struct)){ @@ -13622,7 +13613,6 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) // This is when a potential purchaser right clicks on this client who is in Trader mode to // browse their goods. // - _pkt(TRADING__PACKETS, app); TraderClick_Struct* tcs = (TraderClick_Struct*)app->pBuffer; @@ -13653,7 +13643,6 @@ void Client::Handle_OP_TraderShop(const EQApplicationPacket *app) QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); if (outtcs->Approval) { this->BulkSendTraderInventory(Customer->CharacterID()); @@ -13740,7 +13729,6 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app) void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeItem of length %d", app->size); - _pkt(TRIBUTE__IN, app); //player donates an item... if (app->size != sizeof(TributeItem_Struct)) @@ -13759,7 +13747,6 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) t->tribute_points = TributeItem(t->slot, t->quantity); Log.Out(Logs::Detail, Logs::Tribute, "Sending tribute item reply with %d points", t->tribute_points); - _pkt(TRIBUTE__OUT, app); QueuePacket(app); } @@ -13769,7 +13756,6 @@ void Client::Handle_OP_TributeItem(const EQApplicationPacket *app) void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeMoney of length %d", app->size); - _pkt(TRIBUTE__IN, app); //player donates money if (app->size != sizeof(TributeMoney_Struct)) @@ -13788,7 +13774,6 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) t->tribute_points = TributeMoney(t->platinum); Log.Out(Logs::Detail, Logs::Tribute, "Sending tribute money reply with %d points", t->tribute_points); - _pkt(TRIBUTE__OUT, app); QueuePacket(app); } @@ -13798,7 +13783,6 @@ void Client::Handle_OP_TributeMoney(const EQApplicationPacket *app) void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeNPC of length %d", app->size); - _pkt(TRIBUTE__IN, app); return; } @@ -13806,7 +13790,6 @@ void Client::Handle_OP_TributeNPC(const EQApplicationPacket *app) void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeToggle of length %d", app->size); - _pkt(TRIBUTE__IN, app); if (app->size != sizeof(uint32)) Log.Out(Logs::General, Logs::Error, "Invalid size on OP_TributeToggle packet"); @@ -13820,7 +13803,6 @@ void Client::Handle_OP_TributeToggle(const EQApplicationPacket *app) void Client::Handle_OP_TributeUpdate(const EQApplicationPacket *app) { Log.Out(Logs::Detail, Logs::Tribute, "Received OP_TributeUpdate of length %d", app->size); - _pkt(TRIBUTE__IN, app); //sent when the client changes their tribute settings... if (app->size != sizeof(TributeInfo_Struct)) diff --git a/zone/spells.cpp b/zone/spells.cpp index ddee8f965..a9bc59f15 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3865,7 +3865,6 @@ void Corpse::CastRezz(uint16 spellid, Mob* Caster) rezz->unknown088 = 0x00000000; // We send this to world, because it needs to go to the player who may not be in this zone. worldserver.RezzPlayer(outapp, rez_experience, corpse_db_id, OP_RezzRequest); - _pkt(SPELLS__REZ, outapp); safe_delete(outapp); } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 47155d62f..e20e71f4c 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -1097,7 +1097,6 @@ void TaskManager::SendTaskSelector(Client *c, Mob *mob, int TaskCount, int *Task Ptr = Ptr + strlen(Ptr) + 1; } - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -1197,7 +1196,6 @@ void TaskManager::SendTaskSelectorNew(Client *c, Mob *mob, int TaskCount, int *T outapp->WriteString("Text3 Test"); outapp->WriteString(StartZone); // Zone number in ascii } - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2346,7 +2344,6 @@ void ClientTaskState::SendTaskHistory(Client *c, int TaskIndex) { } } - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2375,7 +2372,6 @@ void Client::SendTaskActivityComplete(int TaskID, int ActivityID, int TaskIndex, //tac->unknown5 = 0x00000001; tac->unknown5 = TaskIncomplete; - _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); safe_delete(outapp); @@ -2407,7 +2403,6 @@ void Client::SendTaskFailed(int TaskID, int TaskIndex) { tac->unknown5 = 0; // 0 for task complete or failed. Log.Out(Logs::General, Logs::Tasks, "[UPDATE] TaskFailed"); - _pkt(TASKS__PACKETS, outapp); QueuePacket(outapp); safe_delete(outapp); @@ -2464,7 +2459,6 @@ void TaskManager::SendCompletedTasksToClient(Client *c, ClientTaskState *State) buf = buf + 4; } - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2506,7 +2500,6 @@ void TaskManager::SendTaskActivityShort(Client *c, int TaskID, int ActivityID, i tass->ActivityType = 0xffffffff; tass->unknown4 = 0x00000000; - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2594,7 +2587,6 @@ void TaskManager::SendTaskActivityLong(Client *c, int TaskID, int ActivityID, in tat->unknown1 = 0x00000001; - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2673,7 +2665,6 @@ void TaskManager::SendTaskActivityNew(Client *c, int TaskID, int ActivityID, int outapp->WriteString(itoa(Tasks[TaskID]->Activity[ActivityID].ZoneID)); - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2856,7 +2847,6 @@ void TaskManager::SendActiveTaskDescription(Client *c, int TaskID, int SequenceN tdt = (TaskDescriptionTrailer_Struct*)Ptr; tdt->Points = 0x00000000; // Points Count - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -2920,7 +2910,6 @@ void ClientTaskState::CancelTask(Client *c, int SequenceNumber, bool RemoveFromD cts->unknown4 = 0x00000002; Log.Out(Logs::General, Logs::Tasks, "[UPDATE] CancelTask"); - _pkt(TASKS__PACKETS, outapp); c->QueuePacket(outapp); safe_delete(outapp); diff --git a/zone/trading.cpp b/zone/trading.cpp index d87483199..0fd36ad37 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1002,7 +1002,6 @@ void Client::Trader_ShowItems(){ outints->Code = BazaarTrader_ShowItems; QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); safe_delete(TraderItems); } @@ -1026,7 +1025,6 @@ void Client::SendTraderPacket(Client* Trader, uint32 Unknown72) QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); } @@ -1059,7 +1057,6 @@ void Client::Trader_StartTrader() { QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); @@ -1077,7 +1074,6 @@ void Client::Trader_StartTrader() { entity_list.QueueClients(this, outapp, false); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); } @@ -1129,7 +1125,6 @@ void Client::Trader_EndTrader() { entity_list.QueueClients(this, outapp, false); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); @@ -1143,7 +1138,6 @@ void Client::Trader_EndTrader() { QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); @@ -1325,7 +1319,6 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Cu tdis->ItemID = SerialNumber; tdis->Unknown012 = 0; - _pkt(TRADING__PACKETS, outapp); Customer->QueuePacket(outapp); safe_delete(outapp); @@ -1355,7 +1348,6 @@ void Client::NukeTraderItem(uint16 Slot,int16 Charges,uint16 Quantity,Client* Cu Quantity = 1; for(int i = 0; i < Quantity; i++) { - _pkt(TRADING__PACKETS, outapp2); this->QueuePacket(outapp2); } @@ -1609,7 +1601,6 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat Trader->QueuePacket(outapp2); - _pkt(TRADING__PACKETS, outapp2); if(RuleB(Bazaar, AuditTrail)) BazaarAuditTrail(Trader->GetName(), GetName(), BuyItem->GetItem()->Name, outtbs->Quantity, outtbs->Price, 0); @@ -1618,7 +1609,6 @@ void Client::BuyTraderItem(TraderBuy_Struct* tbs,Client* Trader,const EQApplicat Trader->QueuePacket(outapp); - _pkt(TRADING__PACKETS, outapp); safe_delete(outapp); safe_delete(outapp2); @@ -1858,7 +1848,6 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint brds->Unknown012 = 0xFFFFFFFF; brds->Unknown016 = 0xFFFFFFFF; this->QueuePacket(outapp2); - _pkt(TRADING__PACKETS,outapp2); safe_delete(outapp2); return; } @@ -1926,7 +1915,6 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint this->QueuePacket(outapp); - _pkt(TRADING__PACKETS,outapp); safe_delete(outapp); safe_delete_array(buffer); @@ -1943,7 +1931,6 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint this->QueuePacket(outapp2); - _pkt(TRADING__PACKETS,outapp2); safe_delete(outapp2); } @@ -2021,7 +2008,6 @@ static void UpdateTraderCustomerPriceChanged(uint32 CustomerID, TraderCharges_St Log.Out(Logs::Detail, Logs::Trading, "Telling customer to remove item %i with %i charges and S/N %i", ItemID, Charges, gis->SerialNumber[i]); - _pkt(TRADING__PACKETS, outapp); Customer->QueuePacket(outapp); } @@ -2346,7 +2332,6 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { VARSTRUCT_ENCODE_TYPE(uint32, buf, 0); // Flag for + Items , probably ItemCount VARSTRUCT_ENCODE_STRING(buf, buyer->GetName()); // Seller Name - _pkt(TRADING__BARTER, outapp); QueuePacket(outapp); safe_delete(outapp); @@ -2429,7 +2414,6 @@ void Client::ShowBuyLines(const EQApplicationPacket *app) { VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); VARSTRUCT_ENCODE_STRING(Buf, Buyer->GetName()); - _pkt(TRADING__BARTER, outapp); QueuePacket(outapp); } } @@ -2679,7 +2663,6 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { sprintf(Buf, "%s", ItemName); Buf += 64; - _pkt(TRADING__BARTER, outapp); QueuePacket(outapp); // This next packet goes to the Buyer and produces the 'You've bought from for ' @@ -2742,7 +2725,6 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { VARSTRUCT_ENCODE_STRING(Buf, Buyer->GetName()); - _pkt(TRADING__BARTER, outapp3); QueuePacket(outapp3); safe_delete(outapp3); @@ -2774,7 +2756,6 @@ void Client::SellToBuyer(const EQApplicationPacket *app) { VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); VARSTRUCT_ENCODE_STRING(Buf, Buyer->GetName()); - _pkt(TRADING__BARTER, outapp4); Buyer->QueuePacket(outapp4); safe_delete(outapp4); @@ -2820,7 +2801,6 @@ void Client::ToggleBuyerMode(bool TurnOn) { entity_list.QueueClients(this, outapp, false); - _pkt(TRADING__BARTER, outapp); safe_delete(outapp); Buyer = TurnOn; @@ -2899,7 +2879,6 @@ void Client::UpdateBuyLine(const EQApplicationPacket *app) { VARSTRUCT_ENCODE_TYPE(uint32, Buf, 0); VARSTRUCT_ENCODE_STRING(Buf, GetName()); - _pkt(TRADING__BARTER, outapp); QueuePacket(outapp); safe_delete(outapp); } @@ -2954,7 +2933,6 @@ void Client::BuyerItemSearch(const EQApplicationPacket *app) { bisr->Action = Barter_BuyerSearch; bisr->ResultCount = Count; - _pkt(TRADING__BARTER, outapp); QueuePacket(outapp); safe_delete(outapp); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 225063ec1..468dc88c0 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -684,7 +684,6 @@ void WorldServer::Process() { sizeof(Resurrect_Struct)); memcpy(outapp->pBuffer, &srs->rez, sizeof(Resurrect_Struct)); client->QueuePacket(outapp); - _pkt(SPELLS__REZ, outapp); safe_delete(outapp); break; } From 83906af9b68eeb2383caa06768ec8e8a059ea6fe Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 03:53:35 -0600 Subject: [PATCH 189/707] Buildable state with converting hex packet dumps --- common/eq_stream.cpp | 2 +- common/eqemu_logsys.cpp | 5 +++-- common/eqemu_logsys.h | 3 +-- common/logsys.cpp | 11 ++++++++++- world/launcher_link.cpp | 2 +- world/login_server.cpp | 2 +- world/zoneserver.cpp | 2 +- zone/worldserver.cpp | 2 +- 8 files changed, 19 insertions(+), 10 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index aa08070bb..cdb2e9d26 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -1112,7 +1112,7 @@ uint32 newlength=0; ProcessQueue(); } else { Log.Out(Logs::Detail, Logs::Netcode, _L "Incoming packet failed checksum" __L); - _hex(NET__NET_CREATE_HEX, buffer, length); + Log.Hex(Logs::Netcode, buffer, length); } } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index b8302fe20..e790e3830 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -24,6 +24,7 @@ #include "database.h" #include "misc.h" + #include #include #include @@ -173,7 +174,7 @@ void EQEmuLogSys::Hex(uint16 log_category, const void *data, unsigned long lengt // log_message(type, "%s", buffer); //%s is to prevent % escapes in the ascii } } - +/* void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) { return; char buffer[196]; @@ -181,7 +182,7 @@ void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) { //log_message(type,buffer); EQEmuLogSys::Hex(log_category, (const char *)p->pBuffer, p->size); } - +*/ void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 5288128fc..57562b904 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -129,8 +129,7 @@ public: void MakeDirectory(std::string directory_name); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); - void Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding); - void Raw(uint16 log_category, uint16 seq, const BasePacket *p); + void Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding = 4); struct LogSettings{ uint8 log_to_file; diff --git a/common/logsys.cpp b/common/logsys.cpp index 8e56ea9d7..f1fa6ed53 100644 --- a/common/logsys.cpp +++ b/common/logsys.cpp @@ -46,7 +46,16 @@ const LogTypeStatus *log_type_info = real_log_type_info; -z +void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding) { + if(!is_log_enabled(type)) + return; + char buffer[80]; + uint32 offset; + for(offset=0;offsetPopPacket())) { - _hex(WORLD__ZONE_TRACE,pack->pBuffer,pack->size); + Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); if (!authenticated) { if (WorldConfig::get()->SharedKey.length() > 0) { if (pack->opcode == ServerOP_ZAAuth && pack->size == 16) { diff --git a/world/login_server.cpp b/world/login_server.cpp index 0bec7cef3..20ca570c0 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -97,7 +97,7 @@ bool LoginServer::Process() { while((pack = tcpc->PopPacket())) { Log.Out(Logs::Detail, Logs::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); - _hex(WORLD__LS_TRACE,pack->pBuffer,pack->size); + Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); switch(pack->opcode) { case 0: diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 94b1e8853..85840cba4 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -177,7 +177,7 @@ bool ZoneServer::Process() { } ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - _hex(WORLD__ZONE_TRACE,pack->pBuffer,pack->size); + Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); if (!authenticated) { if (WorldConfig::get()->SharedKey.length() > 0) { if (pack->opcode == ServerOP_ZAAuth && pack->size == 16) { diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 468dc88c0..2efaa5a98 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -141,7 +141,7 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { Log.Out(Logs::Detail, Logs::Zone_Server, "Got 0x%04x from world:", pack->opcode); - _hex(ZONE__WORLD_TRACE,pack->pBuffer,pack->size); + Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); switch(pack->opcode) { case 0: { break; From a4e96b46ca3613d4880b039bee82030177c354ec Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 03:59:51 -0600 Subject: [PATCH 190/707] Delete logsys.cpp and logsys.h --- common/CMakeLists.txt | 2 - common/logsys.cpp | 163 ------------------------------------------ common/logsys.h | 122 ------------------------------- 3 files changed, 287 deletions(-) delete mode 100644 common/logsys.cpp delete mode 100644 common/logsys.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index f42288aae..934a4b7b9 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -32,7 +32,6 @@ SET(common_sources guilds.cpp ipc_mutex.cpp item.cpp - logsys.cpp md5.cpp memory_mapped_file.cpp misc.cpp @@ -145,7 +144,6 @@ SET(common_headers item_struct.h languages.h linked_list.h - logsys.h logtypes.h loottable.h mail_oplist.h diff --git a/common/logsys.cpp b/common/logsys.cpp deleted file mode 100644 index f1fa6ed53..000000000 --- a/common/logsys.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 "debug.h" -#include "eq_packet.h" -#include "logsys.h" -#include "misc.h" - -#include -#include -#include - - -#define LOG_CATEGORY(category) #category , -const char *log_category_names[NUMBER_OF_LOG_CATEGORIES] = { - #include "logtypes.h" -}; - - -//this array is private to this file, only a const version of it is exposed -#define LOG_TYPE(category, type, enabled) { enabled, LOG_ ##category, #category "__" #type }, -static LogTypeStatus real_log_type_info[NUMBER_OF_LOG_TYPES+1] = -{ - #include "logtypes.h" - { false, NUMBER_OF_LOG_CATEGORIES, "BAD TYPE" } /* dummy trailing record -}; - -const LogTypeStatus *log_type_info = real_log_type_info; - - - -void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding) { - if(!is_log_enabled(type)) - return; - char buffer[80]; - uint32 offset; - for(offset=0;offsetbuild_header_dump(buffer); - //log_message(type,"%s", buffer); - log_hex(type,(const char *)p->pBuffer,p->size); -} - -void log_raw_packet(LogType type, uint16 seq, const BasePacket *p) { - if(!is_log_enabled(type)) - return; - char buffer[196]; - p->build_raw_header_dump(buffer, seq); - //log_message(type,buffer); - log_hex(type,(const char *)p->pBuffer,p->size); -} - - -void log_enable(LogType t) { - real_log_type_info[t].enabled = true; -} - -void log_disable(LogType t) { - real_log_type_info[t].enabled = false; -} - -void log_toggle(LogType t) { - real_log_type_info[t].enabled = !real_log_type_info[t].enabled; -} - - -bool load_log_settings(const char *filename) { - //this is a terrible algorithm, but im lazy today - FILE *f = fopen(filename, "r"); - if(f == nullptr) - return(false); - char linebuf[512], type_name[256], value[256]; - while(!feof(f)) { - if(fgets(linebuf, 512, f) == nullptr) - continue; -#ifdef _WINDOWS - if (sscanf(linebuf, "%[^=]=%[^\n]\n", type_name, value) != 2) - continue; -#else - if (sscanf(linebuf, "%[^=]=%[^\r\n]\n", type_name, value) != 2) - continue; -#endif - - if(type_name[0] == '\0' || type_name[0] == '#') - continue; - - //first make sure we understand the value - bool enabled; - if(!strcasecmp(value, "on") || !strcasecmp(value, "true") || !strcasecmp(value, "yes") || !strcasecmp(value, "enabled") || !strcmp(value, "1")) - enabled = true; - else if(!strcasecmp(value, "off") || !strcasecmp(value, "false") || !strcasecmp(value, "no") || !strcasecmp(value, "disabled") || !strcmp(value, "0")) - enabled = false; - else { - printf("Unable to parse value '%s' from %s. Skipping line.", value, filename); - continue; - } - - int r; - //first see if it is a category name - for(r = 0; r < NUMBER_OF_LOG_CATEGORIES; r++) { - if(!strcasecmp(log_category_names[r], type_name)) - break; - } - if(r != NUMBER_OF_LOG_CATEGORIES) { - //matched a category. - int k; - for(k = 0; k < NUMBER_OF_LOG_TYPES; k++) { - if(log_type_info[k].category != r) - continue; //does not match this category. - if(enabled) - log_enable(LogType(k)); - else - log_disable(LogType(k)); - } - continue; - } - - for(r = 0; r < NUMBER_OF_LOG_TYPES; r++) { - if(!strcasecmp(log_type_info[r].name, type_name)) - break; - } - if(r == NUMBER_OF_LOG_TYPES) { - printf("Unable to locate log type %s from file %s. Skipping line.", type_name, filename); - continue; - } - - //got it all figured out, do something now... - if(enabled) - log_enable(LogType(r)); - else - log_disable(LogType(r)); - } - fclose(f); - return(true); -} - - -*/ \ No newline at end of file diff --git a/common/logsys.h b/common/logsys.h deleted file mode 100644 index ea6c06f08..000000000 --- a/common/logsys.h +++ /dev/null @@ -1,122 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 LOGSYS_H_ -#define LOGSYS_H_ - -/* -* -* Usage: -* -* These are the main functions provided by logsys: -* - _log(TYPE, fmt, ...) - Log a message in any context -* - mlog(TYPE, fmt, ...) - Zone only. Log a message from a Mob:: context, prefixing it with the mob's name. -* - clog(TYPE, fmt, ...) - World only. Log a message from a Client:: context, prefixing it with the client's account name. -* - zlog(TYPE, fmt, ...) - World only. Log a message from a ZoneServer:: context, prefixing it with the zones id/name or ip/port. -* - _hex(TYPE, data, length) - Log hex dump in any context. -* - mhex(TYPE, data, length) - Zone only. Log a hex dump from a Mob:: context, prefixing it with the mob's name -* - _pkt(TYPE, BasePacket *) - Log a packet hex dump with header in any context. -* - mhex(TYPE, data, length) - Zone only. Log a packet hex dump from a Mob:: context, prefixing it with the mob's name -* Types are defined in logtypes.h -* -* this is very C-ish, not C++ish, but thats how I felt like writting it -*/ - -/* -#include -#include "types.h" - -#define LOG_CATEGORY(category) LOG_ ##category , -typedef enum { - #include "logtypes.h" - NUMBER_OF_LOG_CATEGORIES -} LogCategory; - -#define LOG_TYPE(category, type, enabled) category##__##type , -typedef enum { - #include "logtypes.h" - NUMBER_OF_LOG_TYPES -} LogType; - -extern const char *log_category_names[NUMBER_OF_LOG_CATEGORIES]; - -typedef struct { - bool enabled; - LogCategory category; - const char *name; -} LogTypeStatus; - -//expose a read-only pointer -extern const LogTypeStatus *log_type_info; - -// For log_packet, et all. -class BasePacket; - -extern void log_hex(LogType type, const void *data, unsigned long length, unsigned char padding=4); -extern void log_packet(LogType type, const BasePacket *p); -extern void log_raw_packet(LogType type, uint16 seq, const BasePacket *p); - -#ifndef DISABLE_LOGSYS - #define _hex( type, data, len) \ - do { \ - if(log_type_info[ type ].enabled) { \ - log_hex(type, (const char *)data, len); \ - } \ - } while(false) - #define _pkt( type, packet) \ - do { \ - if(log_type_info[ type ].enabled) { \ - log_packet(type, packet); \ - } \ - } while(false) - #define // _raw( type, seq, packet) \ - do { \ - if(log_type_info[ type ].enabled) { \ - log_raw_packet(type, seq, packet); \ - } \ - } while(false) - -#else - #define _hex( type, data, len) {} - #define _pkt( type, packet) {} - #define // _raw( type, seq, packet) {} -#endif //!DISABLE_LOGSYS -#ifdef ZONE - class Mob; - extern void log_hex_mob(LogType type, Mob *who, const char *data, uint32 length); - #define mhex( type, data, len) \ - do { \ - if(IsLoggingEnabled()) \ - if(log_type_info[ type ].enabled) { \ - log_hex_mob(type, this, data, len); \ - } \ - } while(false) -#endif - -extern void log_enable(LogType t); -extern void log_disable(LogType t); -extern void log_toggle(LogType t); - -#define is_log_enabled( type ) \ - log_type_info[ type ].enabled - -*/ - -// extern bool load_log_settings(const char *filename); - -#endif /*LOGSYS_H_*/ - From b6587cc9e2a0f9f9d698eb602c76c5a842413e39 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 04:03:45 -0600 Subject: [PATCH 191/707] Removal of logsys.h from #include(s) --- common/debug.h | 2 +- common/eq_stream_ident.cpp | 2 +- common/guild_base.cpp | 2 +- common/patches/rof.cpp | 2 +- common/patches/rof2.cpp | 2 +- common/patches/sod.cpp | 2 +- common/patches/sof.cpp | 2 +- common/patches/titanium.cpp | 2 +- common/patches/underfoot.cpp | 2 +- common/rulesys.cpp | 2 +- common/spdat.cpp | 2 +- common/struct_strategy.cpp | 2 +- world/client.h | 2 +- world/eqw_http_handler.cpp | 2 +- world/eqw_parser.cpp | 2 +- world/launcher_link.cpp | 2 +- world/launcher_list.cpp | 2 +- world/lfplist.cpp | 2 +- world/queryserv.cpp | 2 +- world/ucs.cpp | 2 +- zone/client_mods.cpp | 2 +- zone/inventory.cpp | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/common/debug.h b/common/debug.h index 0a1ab0fc3..4fc28a8ad 100644 --- a/common/debug.h +++ b/common/debug.h @@ -67,7 +67,7 @@ #include #endif -#include "logsys.h" + #include "../common/mutex.h" #include diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index 22b9f77b4..b42bd4037 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -2,7 +2,7 @@ #include "eqemu_logsys.h" #include "eq_stream_ident.h" #include "eq_stream_proxy.h" -#include "logsys.h" + EQStreamIdentifier::~EQStreamIdentifier() { while(!m_identified.empty()) { diff --git a/common/guild_base.cpp b/common/guild_base.cpp index ae653e0eb..a9ad6cce0 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -18,7 +18,7 @@ #include "guild_base.h" #include "database.h" -#include "logsys.h" + //#include "misc_functions.h" #include "string_util.h" #include diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index 53b0e9fed..d04954d44 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2,7 +2,7 @@ #include "../eqemu_logsys.h" #include "rof.h" #include "../opcodemgr.h" -#include "../logsys.h" + #include "../eq_stream_ident.h" #include "../crc32.h" diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index d376bfb5e..cfb582c29 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2,7 +2,7 @@ #include "../eqemu_logsys.h" #include "rof2.h" #include "../opcodemgr.h" -#include "../logsys.h" + #include "../eq_stream_ident.h" #include "../crc32.h" diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 1639e57ed..9f318674b 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -2,7 +2,7 @@ #include "../eqemu_logsys.h" #include "sod.h" #include "../opcodemgr.h" -#include "../logsys.h" + #include "../eq_stream_ident.h" #include "../crc32.h" diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 2e5776a5d..4337d712e 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -2,7 +2,7 @@ #include "../eqemu_logsys.h" #include "sof.h" #include "../opcodemgr.h" -#include "../logsys.h" + #include "../eq_stream_ident.h" #include "../crc32.h" diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index a19872c14..852baa089 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -2,7 +2,7 @@ #include "../eqemu_logsys.h" #include "titanium.h" #include "../opcodemgr.h" -#include "../logsys.h" + #include "../eq_stream_ident.h" #include "../crc32.h" #include "../races.h" diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 66b379840..12f7a3354 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -2,7 +2,7 @@ #include "../eqemu_logsys.h" #include "underfoot.h" #include "../opcodemgr.h" -#include "../logsys.h" + #include "../eq_stream_ident.h" #include "../crc32.h" diff --git a/common/rulesys.cpp b/common/rulesys.cpp index aeca625da..8f0c908a1 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -17,7 +17,7 @@ */ #include "rulesys.h" -#include "logsys.h" + #include "database.h" #include "string_util.h" #include diff --git a/common/spdat.cpp b/common/spdat.cpp index 3bbca4af2..6359d51dd 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -70,7 +70,7 @@ */ -#include "../common/logsys.h" + #include "../common/logtypes.h" #include "../common/eqemu_logsys.h" diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 8df723f6b..7c57b0d4d 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -2,7 +2,7 @@ #include "debug.h" #include "eqemu_logsys.h" #include "struct_strategy.h" -#include "logsys.h" + #include "eq_stream.h" #include diff --git a/world/client.h b/world/client.h index 9014051ed..7c460fe9a 100644 --- a/world/client.h +++ b/world/client.h @@ -24,7 +24,7 @@ #include "../common/linked_list.h" #include "../common/timer.h" //#include "zoneserver.h" -#include "../common/logsys.h" + #include "../common/eq_packet_structs.h" #include "cliententry.h" diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index ba2e5b21c..36fdf714c 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -21,7 +21,7 @@ #include "eqw_parser.h" #include "eqw.h" #include "http_request.h" -#include "../common/logsys.h" + #include "worlddb.h" #include "console.h" diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index 49c1317f5..e7b72bf38 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -24,7 +24,7 @@ #include "eqw_parser.h" #include "eqw.h" #include "../common/eqdb.h" -#include "../common/logsys.h" + #include "worlddb.h" #ifndef GvCV_set diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index b748f7c23..3e7059969 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -20,7 +20,7 @@ #include "launcher_link.h" #include "launcher_list.h" #include "world_config.h" -#include "../common/logsys.h" + #include "../common/md5.h" #include "../common/packet_dump.h" #include "../common/servertalk.h" diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index b00da266d..01f64bfec 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -20,7 +20,7 @@ #include "../common/debug.h" #include "launcher_list.h" #include "launcher_link.h" -#include "../common/logsys.h" + #include "eql_config.h" LauncherList::LauncherList() diff --git a/world/lfplist.cpp b/world/lfplist.cpp index f04a833dd..2dccc4a3c 100644 --- a/world/lfplist.cpp +++ b/world/lfplist.cpp @@ -21,7 +21,7 @@ #include "clientlist.h" #include "zoneserver.h" #include "zonelist.h" -#include "../common/logsys.h" + #include "../common/misc_functions.h" extern ClientList client_list; diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 6457d7e6c..370fae5fc 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -4,7 +4,7 @@ #include "world_config.h" #include "clientlist.h" #include "zonelist.h" -#include "../common/logsys.h" + #include "../common/logtypes.h" #include "../common/md5.h" #include "../common/emu_tcp_connection.h" diff --git a/world/ucs.cpp b/world/ucs.cpp index 13032d091..11cff6a69 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -2,7 +2,7 @@ #include "../common/eqemu_logsys.h" #include "ucs.h" #include "world_config.h" -#include "../common/logsys.h" + #include "../common/logtypes.h" #include "../common/md5.h" #include "../common/emu_tcp_connection.h" diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index f3c17a4d2..fc49e1526 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -18,7 +18,7 @@ #include "../common/debug.h" #include "../common/eqemu_logsys.h" -#include "../common/logsys.h" + #include "../common/rulesys.h" #include "../common/spdat.h" diff --git a/zone/inventory.cpp b/zone/inventory.cpp index d498e22f9..56ad5e904 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -18,7 +18,7 @@ #include "../common/debug.h" #include "../common/eqemu_logsys.h" -#include "../common/logsys.h" + #include "../common/string_util.h" #include "quest_parser_collection.h" #include "worldserver.h" From d1572790b16361c43a9962d9bda18d084bc866f1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 04:15:26 -0600 Subject: [PATCH 192/707] Remove eqemu_error.cpp/.h as they are useless --- common/CMakeLists.txt | 2 - common/eqemu_error.cpp | 135 ----------------------------------------- common/eqemu_error.h | 36 ----------- world/net.cpp | 3 +- zone/net.cpp | 7 +-- 5 files changed, 2 insertions(+), 181 deletions(-) delete mode 100644 common/eqemu_error.cpp delete mode 100644 common/eqemu_error.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 934a4b7b9..4e5791330 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -18,7 +18,6 @@ SET(common_sources eqdb_res.cpp eqemu_exception.cpp eqemu_config.cpp - eqemu_error.cpp eqemu_logsys.cpp eq_packet.cpp eq_stream.cpp @@ -119,7 +118,6 @@ SET(common_headers eqemu_exception.h eqemu_config.h eqemu_config_elements.h - eqemu_error.h eqemu_logsys.h eq_packet.h eq_stream.h diff --git a/common/eqemu_error.cpp b/common/eqemu_error.cpp deleted file mode 100644 index ff9a7bbd6..000000000 --- a/common/eqemu_error.cpp +++ /dev/null @@ -1,135 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 -*/ -#ifdef _WINDOWS -#include -#endif -#include "eqemu_error.h" -#include "linked_list.h" -#include "mutex.h" -#include "misc_functions.h" -#include -#include -#ifdef _WINDOWS - #include -#endif - -void UpdateWindowTitle(char* iNewTitle = 0); -void CatchSignal(int sig_num); - -const char* EQEMuErrorText[EQEMuError_MaxErrorID] = { "ErrorID# 0, No Error", - "MySQL Error #1405 or #2001 means your mysql server rejected the username and password you presented it.", - "MySQL Error #2003 means you were unable to connect to the mysql server.", - "MySQL Error #2005 means you there are too many connections on the mysql server. The server is overloaded.", - "MySQL Error #2007 means you the server is out of memory. The server is overloaded.", - }; - -LinkedList* EQEMuErrorList; -Mutex* MEQEMuErrorList; -AutoDelete< LinkedList > ADEQEMuErrorList(&EQEMuErrorList); -AutoDelete ADMEQEMuErrorList(&MEQEMuErrorList); - -const char* GetErrorText(uint32 iError) { - if (iError >= EQEMuError_MaxErrorID) - return "ErrorID# out of range"; - else - return EQEMuErrorText[iError]; -} - -void AddEQEMuError(eEQEMuError iError, bool iExitNow) { - if (!iError) - return; - if (!EQEMuErrorList) { - EQEMuErrorList = new LinkedList; - MEQEMuErrorList = new Mutex; - } - LockMutex lock(MEQEMuErrorList); - - LinkedListIterator iterator(*EQEMuErrorList); - iterator.Reset(); - while (iterator.MoreElements()) { - if (iterator.GetData()[0] == 1) { -//Umm... this gets a big WTF... -// if (*((uint32*) iterator.GetData()[1]) == iError) -//not sure whats going on, using a character as a pointer.... - if (*((eEQEMuError*) &(iterator.GetData()[1])) == iError) - return; - } - iterator.Advance(); - } - - char* tmp = new char[6]; - tmp[0] = 1; - tmp[5] = 0; - *((uint32*) &tmp[1]) = iError; - EQEMuErrorList->Append(tmp); - - if (iExitNow) - CatchSignal(2); -} - -void AddEQEMuError(char* iError, bool iExitNow) { - if (!iError) - return; - if (!EQEMuErrorList) { - EQEMuErrorList = new LinkedList; - MEQEMuErrorList = new Mutex; - } - LockMutex lock(MEQEMuErrorList); - char* tmp = strcpy(new char[strlen(iError) + 1], iError); - EQEMuErrorList->Append(tmp); - - if (iExitNow) - CatchSignal(2); -} - -uint32 CheckEQEMuError() { - if (!EQEMuErrorList) - return 0; - uint32 ret = 0; - char* tmp = 0; - bool HeaderPrinted = false; - LockMutex lock(MEQEMuErrorList); - - while ((tmp = EQEMuErrorList->Pop() )) { - if (!HeaderPrinted) { - fprintf(stdout, "===============================\nRuntime errors:\n\n"); - HeaderPrinted = true; - } - if (tmp[0] == 1) { - fprintf(stdout, "%s\n", GetErrorText(*((uint32*) &tmp[1]))); - fprintf(stdout, "For more information on this error, visit http://www.eqemu.net/eqemuerror.php?id=%u\n\n", *((uint32*) &tmp[1])); - } - else { - fprintf(stdout, "%s\n\n", tmp); - } - safe_delete(tmp); - ret++; - } - return ret; -} - -void CheckEQEMuErrorAndPause() { -#ifdef _WINDOWS - if (CheckEQEMuError()) { - fprintf(stdout, "Hit any key to exit\n"); - UpdateWindowTitle("Error"); - getch(); - } -#endif -} - diff --git a/common/eqemu_error.h b/common/eqemu_error.h deleted file mode 100644 index ffc5d69ed..000000000 --- a/common/eqemu_error.h +++ /dev/null @@ -1,36 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 EQEMuError_H -#define EQEMuError_H - -#include "../common/types.h" - -enum eEQEMuError { EQEMuError_NoError, - EQEMuError_Mysql_1405, - EQEMuError_Mysql_2003, - EQEMuError_Mysql_2005, - EQEMuError_Mysql_2007, - EQEMuError_MaxErrorID }; - -void AddEQEMuError(eEQEMuError iError, bool iExitNow = false); -void AddEQEMuError(char* iError, bool iExitNow = false); -uint32 CheckEQEMuError(); -void CheckEQEMuErrorAndPause(); - -#endif - diff --git a/world/net.cpp b/world/net.cpp index 8914415a4..529643d08 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -34,7 +34,7 @@ #include "../common/version.h" #include "../common/eqtime.h" #include "../common/timeoutmgr.h" -#include "../common/eqemu_error.h" + #include "../common/opcodemgr.h" #include "../common/guilds.h" #include "../common/eq_stream_ident.h" @@ -498,7 +498,6 @@ int main(int argc, char** argv) { Log.Out(Logs::Detail, Logs::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); - CheckEQEMuErrorAndPause(); return 0; } diff --git a/zone/net.cpp b/zone/net.cpp index a299da25a..ab2e06871 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -28,7 +28,7 @@ #include "../common/eq_packet_structs.h" #include "../common/mutex.h" #include "../common/version.h" -#include "../common/eqemu_error.h" + #include "../common/packet_dump_file.h" #include "../common/opcodemgr.h" #include "../common/guilds.h" @@ -221,19 +221,16 @@ int main(int argc, char** argv) { Log.Out(Logs::Detail, Logs::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { Log.Out(Logs::General, Logs::Error, "Loading npcs faction lists FAILED!"); - CheckEQEMuErrorAndPause(); return 1; } Log.Out(Logs::Detail, Logs::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { Log.Out(Logs::General, Logs::Error, "Loading loot FAILED!"); - CheckEQEMuErrorAndPause(); return 1; } Log.Out(Logs::Detail, Logs::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { Log.Out(Logs::General, Logs::Error, "Loading skill caps FAILED!"); - CheckEQEMuErrorAndPause(); return 1; } @@ -244,7 +241,6 @@ int main(int argc, char** argv) { Log.Out(Logs::Detail, Logs::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { Log.Out(Logs::General, Logs::Error, "Loading base data FAILED!"); - CheckEQEMuErrorAndPause(); return 1; } @@ -512,7 +508,6 @@ int main(int argc, char** argv) { safe_delete(taskmanager); command_deinit(); safe_delete(parse); - CheckEQEMuErrorAndPause(); Log.Out(Logs::Detail, Logs::Zone_Server, "Proper zone shutdown complete."); return 0; } From bc4aa08adfe9814173fbf8c4a65aef946d9efa7c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Sun, 18 Jan 2015 04:33:04 -0600 Subject: [PATCH 193/707] Add crashtest command back in for crash log testing --- zone/command.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zone/command.cpp b/zone/command.cpp index d0882a687..06e4114d0 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -426,6 +426,7 @@ int command_init(void) { command_add("merchant_close_shop", "Closes a merchant shop", 100, command_merchantcloseshop) || command_add("close_shop", nullptr, 100, command_merchantcloseshop) || command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || + command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) || command_add("logtest", "Performs log performance testing.", 250, command_logtest) ) { @@ -10397,4 +10398,11 @@ void command_logtest(Client *c, const Seperator *sep){ Log.Out(Logs::General, Logs::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } +} + +void command_crashtest(Client *c, const Seperator *sep) +{ + c->Message(0, "Alright, now we get an GPF ;) "); + char* gpf = 0; + memcpy(gpf, "Ready to crash", 30); } \ No newline at end of file From 55d73f0b0707eea2ab251449bdfc5acb293f716e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:30:36 -0600 Subject: [PATCH 194/707] Remove Log.Hex references because we're not going to use them anyways per KLS --- common/patches/rof2.cpp | 3 --- common/patches/ss_define.h | 4 ---- 2 files changed, 7 deletions(-) diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index cfb582c29..cb49c8d53 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -4568,14 +4568,11 @@ namespace RoF2 DECODE_LENGTH_EXACT(structs::MoveItem_Struct); SETUP_DIRECT_DECODE(MoveItem_Struct, structs::MoveItem_Struct); - //Log.LogDebugType(Logs::General, Logs::Netcode, "[ERROR] Moved item from %u to %u", eq->from_slot.MainSlot, eq->to_slot.MainSlot); Log.Out(Logs::General, Logs::Netcode, "[ERROR] MoveItem SlotType from %i to %i, MainSlot from %i to %i, SubSlot from %i to %i, AugSlot from %i to %i, Unknown01 from %i to %i, Number %u", eq->from_slot.SlotType, eq->to_slot.SlotType, eq->from_slot.MainSlot, eq->to_slot.MainSlot, eq->from_slot.SubSlot, eq->to_slot.SubSlot, eq->from_slot.AugSlot, eq->to_slot.AugSlot, eq->from_slot.Unknown01, eq->to_slot.Unknown01, eq->number_in_stack); emu->from_slot = RoF2ToServerSlot(eq->from_slot); emu->to_slot = RoF2ToServerSlot(eq->to_slot); IN(number_in_stack); - Log.Hex(Logs::Netcode, eq, sizeof(structs::MoveItem_Struct)); - FINISH_DIRECT_DECODE(); } diff --git a/common/patches/ss_define.h b/common/patches/ss_define.h index 1d59287ad..aaa41db23 100644 --- a/common/patches/ss_define.h +++ b/common/patches/ss_define.h @@ -65,7 +65,6 @@ #define ENCODE_LENGTH_EXACT(struct_) \ if((*p)->size != sizeof(struct_)) { \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ - Log.Hex(Logs::Netcode, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ return; \ @@ -73,7 +72,6 @@ #define ENCODE_LENGTH_ATLEAST(struct_) \ if((*p)->size < sizeof(struct_)) { \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on outbound %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName((*p)->GetOpcode()), (*p)->size, sizeof(struct_)); \ - Log.Hex(Logs::Netcode, (*p)->pBuffer, (*p)->size); \ delete *p; \ *p = nullptr; \ return; \ @@ -128,14 +126,12 @@ if(__packet->size != sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ - Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); \ return; \ } #define DECODE_LENGTH_ATLEAST(struct_) \ if(__packet->size < sizeof(struct_)) { \ __packet->SetOpcode(OP_Unknown); /* invalidate the packet */ \ Log.Out(Logs::Detail, Logs::Netcode, "Wrong size on incoming %s (" #struct_ "): Got %d, expected at least %d", opcodes->EmuToName(__packet->GetOpcode()), __packet->size, sizeof(struct_)); \ - Log.Hex(Logs::Netcode, __packet->pBuffer, __packet->size); \ return; \ } From ee1c55a8135dcf7f246f88ca5f5b0150576ebd88 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:32:09 -0600 Subject: [PATCH 195/707] Remove Log.Hex remaining entries --- common/eq_stream.cpp | 1 - common/eqemu_logsys.cpp | 10 ---------- common/patches/rof.cpp | 4 ---- common/patches/rof2.cpp | 2 -- 4 files changed, 17 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index cdb2e9d26..1fef68a8e 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -1112,7 +1112,6 @@ uint32 newlength=0; ProcessQueue(); } else { Log.Out(Logs::Detail, Logs::Netcode, _L "Incoming packet failed checksum" __L); - Log.Hex(Logs::Netcode, buffer, length); } } diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index e790e3830..e7e7a00b8 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -164,16 +164,6 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m SetConsoleTextAttribute(console_handle, Console::Color::White); #endif } - -void EQEmuLogSys::Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding) { - return; - char buffer[80]; - uint32 offset; - for (offset = 0; offset < length; offset += 16) { - build_hex_line((const char *)data, length, offset, buffer, padding); - // log_message(type, "%s", buffer); //%s is to prevent % escapes in the ascii - } -} /* void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) { return; diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index d04954d44..c0d6b4ddf 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -2809,8 +2809,6 @@ namespace RoF } } - Log.Hex(Logs::Netcode, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); - FINISH_ENCODE(); } @@ -4503,8 +4501,6 @@ namespace RoF emu->to_slot = RoFToServerSlot(eq->to_slot); IN(number_in_stack); - Log.Hex(Logs::Netcode, eq, sizeof(structs::MoveItem_Struct)); - FINISH_DIRECT_DECODE(); } diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index cb49c8d53..bd2245dc3 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -2893,8 +2893,6 @@ namespace RoF2 } } - Log.Hex(Logs::Netcode, eq, sizeof(structs::SendAA_Struct) + emu->total_abilities*sizeof(structs::AA_Ability)); - FINISH_ENCODE(); } From e5542788111eaadabc230b1bf1b1022cfebb8cf0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:32:24 -0600 Subject: [PATCH 196/707] Remove Log.Raw function --- common/eqemu_logsys.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index e7e7a00b8..48703fb7c 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -164,15 +164,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m SetConsoleTextAttribute(console_handle, Console::Color::White); #endif } -/* -void EQEmuLogSys::Raw(uint16 log_category, uint16 seq, const BasePacket *p) { - return; - char buffer[196]; - p->build_raw_header_dump(buffer, seq); - //log_message(type,buffer); - EQEmuLogSys::Hex(log_category, (const char *)p->pBuffer, p->size); -} -*/ + void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...) { va_list args; From bf62d1fd2663106e5fe8c7cff8e0debe45578b99 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:32:46 -0600 Subject: [PATCH 197/707] Sort header functions --- common/eqemu_logsys.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 57562b904..fb1ae3c51 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -125,11 +125,10 @@ public: void CloseFileLogs(); void LoadLogSettingsDefaults(); - void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...); void MakeDirectory(std::string directory_name); + void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); - void Hex(uint16 log_category, const void *data, unsigned long length, unsigned char padding = 4); struct LogSettings{ uint8 log_to_file; From 87e212046f93071d29da603f1b20f290801c6332 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:33:52 -0600 Subject: [PATCH 198/707] Remove another Log.Hex straggler --- common/eq_stream.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 1fef68a8e..4d3fa5d46 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -102,7 +102,6 @@ EQRawApplicationPacket *EQStream::MakeApplicationPacket(const unsigned char *buf { EQRawApplicationPacket *ap=nullptr; Log.Out(Logs::Detail, Logs::Netcode, _L "Creating new application packet, length %d" __L, len); - Log.Hex(Logs::Netcode, buf, len); ap = new EQRawApplicationPacket(buf, len); return ap; } From 2ecb91d0757d874699ec8a0963379d4508dc54fa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:35:28 -0600 Subject: [PATCH 199/707] Remove Log.Hex completely for real --- world/launcher_link.cpp | 1 - world/login_server.cpp | 1 - world/zoneserver.cpp | 1 - zone/worldserver.cpp | 1 - 4 files changed, 4 deletions(-) diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 3e7059969..9e8db6ea1 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -68,7 +68,6 @@ bool LauncherLink::Process() { ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); if (!authenticated) { if (WorldConfig::get()->SharedKey.length() > 0) { if (pack->opcode == ServerOP_ZAAuth && pack->size == 16) { diff --git a/world/login_server.cpp b/world/login_server.cpp index 20ca570c0..f411e7a72 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -97,7 +97,6 @@ bool LoginServer::Process() { while((pack = tcpc->PopPacket())) { Log.Out(Logs::Detail, Logs::World_Server,"Recevied ServerPacket from LS OpCode 0x04x",pack->opcode); - Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); switch(pack->opcode) { case 0: diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 85840cba4..de3f34435 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -177,7 +177,6 @@ bool ZoneServer::Process() { } ServerPacket *pack = 0; while((pack = tcpc->PopPacket())) { - Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); if (!authenticated) { if (WorldConfig::get()->SharedKey.length() > 0) { if (pack->opcode == ServerOP_ZAAuth && pack->size == 16) { diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index 2efaa5a98..a3967c051 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -141,7 +141,6 @@ void WorldServer::Process() { ServerPacket *pack = 0; while((pack = tcpc.PopPacket())) { Log.Out(Logs::Detail, Logs::Zone_Server, "Got 0x%04x from world:", pack->opcode); - Log.Hex(Logs::Netcode, pack->pBuffer, pack->size); switch(pack->opcode) { case 0: { break; From 2f74f07be7e79bbe8ff96bdb379bfe77f5cb7085 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:47:51 -0600 Subject: [PATCH 200/707] Add EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category) to replace the static map --- common/eqemu_logsys.cpp | 32 +++++++++++++++++++++----------- common/eqemu_logsys.h | 1 + 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 48703fb7c..9762f0315 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -64,17 +64,6 @@ namespace Console { }; } -// static Console::Color LogColors[MaxCategoryID] = { -// Console::Color::Yellow, // "Status", -// Console::Color::Yellow, // "Normal", -// Console::Color::LightRed, // "Error", -// Console::Color::LightGreen, // "Debug", -// Console::Color::LightCyan, // "Quest", -// Console::Color::LightMagenta, // "Command", -// Console::Color::LightRed // "Crash" -// }; - - EQEmuLogSys::EQEmuLogSys(){ on_log_gmsay_hook = [](uint16 log_type, std::string&) {}; } @@ -134,6 +123,27 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) } } +uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ + switch (log_category) { + case Logs::Status: + return Console::Color::Yellow; + case Logs::Normal: + return Console::Color::Yellow; + case Logs::Error: + return Console::Color::LightRed; + case Logs::Debug: + return Console::Color::LightGreen; + case Logs::Quests: + return Console::Color::LightCyan; + case Logs::Commands: + return Console::Color::LightMagenta; + case Logs::Crash: + return Console::Color::LightRed; + default: + return Console::Color::White; + } +} + void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string message) { /* Check if category enabled for process */ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index fb1ae3c51..fe960c8d0 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -129,6 +129,7 @@ public: void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); + uint16 GetConsoleColorFromCategory(uint16 log_category); struct LogSettings{ uint8 log_to_file; From b546848313f5877e3f80d6294a63e3cd3d24a7ac Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:54:01 -0600 Subject: [PATCH 201/707] Implement EQEmuLogSys::GetConsoleColorFromCategory in ProcessConsoleMessage --- common/eqemu_logsys.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 9762f0315..ad4cb13ae 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -159,12 +159,7 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m info.FontWeight = FW_NORMAL; wcscpy(info.FaceName, L"Lucida Console"); SetCurrentConsoleFontEx(console_handle, NULL, &info); - //if (LogColors[log_type]){ - // SetConsoleTextAttribute(console_handle, LogColors[log_type]); - //} - //else{ - SetConsoleTextAttribute(console_handle, Console::Color::White); - //} + SetConsoleTextAttribute(console_handle, EQEmuLogSys::GetConsoleColorFromCategory(log_category)); #endif std::cout << message << "\n"; From af53666fed3b0e862eed40381405bbd64c869962 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:54:28 -0600 Subject: [PATCH 202/707] Convert TimeBroadcast debug message to zone_server category --- zone/worldserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index a3967c051..f3211b7e1 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -767,7 +767,7 @@ void WorldServer::Process() { eqTime.minute, (eqTime.hour >= 13) ? "pm" : "am" ); - std::cout << "Time Broadcast Packet: " << timeMessage << std::endl; + Log.Out(Logs::General, Logs::Zone_Server, "Time Broadcast Packet: %s", timeMessage); zone->GotCurTime(true); //} //Test From 1c47e6b90d564c65172f1f4d3d4ea067f54e9158 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:56:52 -0600 Subject: [PATCH 203/707] Convert 'Unable to get raid id, char not found!' to Error Category --- common/database.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 6ef6c7485..8beb3336b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3488,7 +3488,7 @@ uint32 Database::GetRaidID(const char* name){ if (row == results.end()) { - std::cout << "Unable to get raid id, char not found!" << std::endl; + Log.Out(Logs::General, Logs::Error, "Unable to get raid id, char not found!"); return 0; } From b3eadea4737c232b0b007804413af4b6d3b36596 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 02:59:02 -0600 Subject: [PATCH 204/707] Convert 'Client linkdead' to Zone Status --- zone/client_process.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 52d1c900c..483dceac1 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -670,7 +670,7 @@ bool Client::Process() { if (client_state != CLIENT_LINKDEAD && !eqs->CheckState(ESTABLISHED)) { OnDisconnect(true); - std::cout << "Client linkdead: " << name << std::endl; + Log.Out(Logs::General, Logs::Zone_Server, "Client linkdead: %s", name); if (GetGM()) { if (GetMerc()) From abc2f9cace47b9c0a5a7ea7e5c95567d778e9247 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:00:32 -0600 Subject: [PATCH 205/707] Convert 'Dropping client:' to Zone Status --- zone/entity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 8fb5e541c..ec2be21f5 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -515,7 +515,7 @@ void EntityList::MobProcess() #ifdef _WINDOWS struct in_addr in; in.s_addr = mob->CastToClient()->GetIP(); - std::cout << "Dropping client: Process=false, ip=" << inet_ntoa(in) << ", port=" << mob->CastToClient()->GetPort() << std::endl; + Log.Out(Logs::General, Logs::Zone_Server, "Dropping client: Process=false, ip=%s port=%u", inet_ntoa(in), mob->CastToClient()->GetPort()); #endif zone->StartShutdownTimer(); Group *g = GetGroupByMob(mob); From e428b373ac4a485ffe436389338ac3f106c8c5a0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:02:00 -0600 Subject: [PATCH 206/707] Adjust category names --- common/eqemu_logsys.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index fe960c8d0..2ac824624 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -84,7 +84,7 @@ namespace Logs{ "AI", "Aggro", "Attack", - "Client_Server_Packet", + "Client Server Packet", "Combat", "Commands", "Crash", @@ -98,22 +98,22 @@ namespace Logs{ "Normal", "Object", "Pathing", - "QS_Server", + "QS Server", "Quests", "Rules", "Skills", "Spawns", "Spells", "Status", - "TCP_Connection", + "TCP Connection", "Tasks", "Tradeskills", "Trading", "Tribute", - "UCS_Server", - "WebInterface_Server", - "World_Server", - "Zone_Server", + "UCS Server", + "WebInterface Server", + "World Server", + "Zone Server", }; } From ab4595f56d3a7fbe55342f1ca035661d7384cbbd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:22:23 -0600 Subject: [PATCH 207/707] Remove QueryPerformanceCounter code --- common/debug.cpp | 2 ++ common/debug.h | 16 ---------------- common/eqemu_logsys.cpp | 5 +---- zone/net.cpp | 19 ------------------- 4 files changed, 3 insertions(+), 39 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 6f5426927..08d8ee8e2 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -1,3 +1,5 @@ + + #include #include diff --git a/common/debug.h b/common/debug.h index 4fc28a8ad..889903a88 100644 --- a/common/debug.h +++ b/common/debug.h @@ -110,20 +110,4 @@ private: extern EQEmuLog* LogFile; -#ifdef _EQDEBUG -class PerformanceMonitor { -public: - PerformanceMonitor(int64* ip) { - p = ip; - QueryPerformanceCounter(&tmp); - } - ~PerformanceMonitor() { - LARGE_INTEGER tmp2; - QueryPerformanceCounter(&tmp2); - *p += tmp2.QuadPart - tmp.QuadPart; - } - LARGE_INTEGER tmp; - int64* p; -}; -#endif #endif diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index ad4cb13ae..468529cda 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -118,9 +118,6 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) if (process_log){ process_log << time_stamp << " " << StringFormat("[%s] ", Logs::LogCategoryName[log_category]).c_str() << message << std::endl; } - else{ - // std::cout << "[DEBUG] " << ":: There currently is no log file open for this process " << "\n"; - } } uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ @@ -140,7 +137,7 @@ uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ case Logs::Crash: return Console::Color::LightRed; default: - return Console::Color::White; + return Console::Color::Yellow; } } diff --git a/zone/net.cpp b/zone/net.cpp index ab2e06871..c2ec1b629 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -455,25 +455,6 @@ int main(int argc, char** argv) { worldserver.AsyncConnect(); } -#if defined(_EQDEBUG) && defined(DEBUG_PC) - QueryPerformanceCounter(&tmp3); - mainloop_time += tmp3.QuadPart - tmp2.QuadPart; - if (!--tmp0) { - tmp0 = 200; - printf("Elapsed Tics : %9.0f (%1.4f sec)\n", (double)mainloop_time, ((double)mainloop_time/tmp.QuadPart)); - printf("NPCAI Tics : %9.0f (%1.2f%%)\n", (double)npcai_time, ((double)npcai_time/mainloop_time)*100); - printf("FindSpell Tics: %9.0f (%1.2f%%)\n", (double)findspell_time, ((double)findspell_time/mainloop_time)*100); - printf("AtkAllowd Tics: %9.0f (%1.2f%%)\n", (double)IsAttackAllowed_time, ((double)IsAttackAllowed_time/mainloop_time)*100); - printf("ClientPro Tics: %9.0f (%1.2f%%)\n", (double)clientprocess_time, ((double)clientprocess_time/mainloop_time)*100); - printf("ClientAtk Tics: %9.0f (%1.2f%%)\n", (double)clientattack_time, ((double)clientattack_time/mainloop_time)*100); - mainloop_time = 0; - npcai_time = 0; - findspell_time = 0; - IsAttackAllowed_time = 0; - clientprocess_time = 0; - clientattack_time = 0; - } -#endif #ifdef EQPROFILE #ifdef PROFILE_DUMP_TIME if(profile_dump_timer.Check()) { From d45bc6d26a4ff9fd102ad6829c4100bc331cf2c6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:25:46 -0600 Subject: [PATCH 208/707] General cleanup --- zone/net.cpp | 16 ++++------------ zone/worldserver.cpp | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index c2ec1b629..40ad52616 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -348,15 +348,10 @@ int main(int argc, char** argv) { //Advance the timer to our current point in time Timer::SetCurrentTime(); - //process stuff from world worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { Log.Out(Logs::Detail, Logs::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); - - // log_sys.CloseZoneLogs(); - // log_sys.StartZoneLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); - if (!eqsf.Open(Config->ZonePort)) { Log.Out(Logs::General, Logs::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); @@ -429,10 +424,8 @@ int main(int argc, char** argv) { if(net.raid_timer.Enabled() && net.raid_timer.Check()) entity_list.RaidProcess(); - entity_list.Process(); - - entity_list.MobProcess(); - + entity_list.Process(); + entity_list.MobProcess(); entity_list.BeaconProcess(); if (zone) { @@ -462,7 +455,7 @@ int main(int argc, char** argv) { } #endif #endif - } //end extra profiler block + } //end extra profiler block Sleep(ZoneTimerResolution); } @@ -504,8 +497,7 @@ void Shutdown() { Zone::Shutdown(true); RunLoops = false; - worldserver.Disconnect(); - // safe_delete(worldserver); + worldserver.Disconnect(); Log.Out(Logs::Detail, Logs::Zone_Server, "Shutting down..."); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index f3211b7e1..d08384515 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -131,7 +131,7 @@ void WorldServer::OnConnected() { SendPacket(pack); safe_delete(pack); } - +/* Zone Process Packets from World */ void WorldServer::Process() { WorldConnection::Process(); From 7503e292110e6e4d70980f5a873e5671bd3e3b3e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:28:00 -0600 Subject: [PATCH 209/707] Remove LogSettingsFile from config parsers which removes log.ini completely --- common/eqemu_config.cpp | 8 -------- common/eqemu_config.h | 2 -- zone/net.cpp | 2 -- 3 files changed, 12 deletions(-) diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp index 2fe10ee9d..a2483c9b8 100644 --- a/common/eqemu_config.cpp +++ b/common/eqemu_config.cpp @@ -254,10 +254,6 @@ void EQEmuConfig::do_files(TiXmlElement *ele) if (text) { OpCodesFile = text; } - text = ParseTextBlock(ele, "logsettings", true); - if (text) { - LogSettingsFile = text; - } text = ParseTextBlock(ele, "eqtime", true); if (text) { EQTimeFile = text; @@ -415,9 +411,6 @@ std::string EQEmuConfig::GetByName(const std::string &var_name) const if (var_name == "EQTimeFile") { return (EQTimeFile); } - if (var_name == "LogSettingsFile") { - return (LogSettingsFile); - } if (var_name == "MapDir") { return (MapDir); } @@ -483,7 +476,6 @@ void EQEmuConfig::Dump() const std::cout << "SpellsFile = " << SpellsFile << std::endl; std::cout << "OpCodesFile = " << OpCodesFile << std::endl; std::cout << "EQTimeFile = " << EQTimeFile << std::endl; - std::cout << "LogSettingsFile = " << LogSettingsFile << std::endl; std::cout << "MapDir = " << MapDir << std::endl; std::cout << "QuestDir = " << QuestDir << std::endl; std::cout << "PluginDir = " << PluginDir << std::endl; diff --git a/common/eqemu_config.h b/common/eqemu_config.h index 908d66aa1..1ad2174dc 100644 --- a/common/eqemu_config.h +++ b/common/eqemu_config.h @@ -80,7 +80,6 @@ class EQEmuConfig : public XMLParser std::string SpellsFile; std::string OpCodesFile; std::string EQTimeFile; - std::string LogSettingsFile; // From std::string MapDir; @@ -156,7 +155,6 @@ class EQEmuConfig : public XMLParser SpellsFile = "spells_us.txt"; OpCodesFile = "opcodes.conf"; EQTimeFile = "eqtime.cfg"; - LogSettingsFile = "log.ini"; // Dirs MapDir = "Maps"; QuestDir = "quests"; diff --git a/zone/net.cpp b/zone/net.cpp index 40ad52616..bbf0855cc 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -201,8 +201,6 @@ int main(int argc, char** argv) { } #endif - const char *log_ini_file = "./log.ini"; - Log.Out(Logs::Detail, Logs::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); From 2a6a3e419c61086a3bff7838b8685519ea06ab16 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:33:15 -0600 Subject: [PATCH 210/707] Remove logtypes.h from header includes and the file itself --- common/CMakeLists.txt | 1 - common/logtypes.h | 266 ------------------------------------------ common/spdat.cpp | 2 +- world/queryserv.cpp | 2 +- world/ucs.cpp | 2 +- zone/net.cpp | 9 +- 6 files changed, 6 insertions(+), 276 deletions(-) delete mode 100644 common/logtypes.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 4e5791330..1ddbeb94a 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -142,7 +142,6 @@ SET(common_headers item_struct.h languages.h linked_list.h - logtypes.h loottable.h mail_oplist.h md5.h diff --git a/common/logtypes.h b/common/logtypes.h deleted file mode 100644 index 8ebd48f9a..000000000 --- a/common/logtypes.h +++ /dev/null @@ -1,266 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2006 EQEMu Development Team (http://eqemulator.net) - - 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 LOG_CATEGORY -#define LOG_CATEGORY(name) -#endif -#ifndef LOG_TYPE -#define LOG_TYPE(cat, type, default_value) -#endif -#ifndef ENABLED -#define ENABLED true -#endif -#ifndef DISABLED -#define DISABLED false -#endif - - -LOG_CATEGORY( CHAT ) -LOG_TYPE( CHAT, SAY, DISABLED ) -LOG_TYPE( CHAT, EMOTE, DISABLED ) -LOG_TYPE( CHAT, OOC, DISABLED ) -LOG_TYPE( CHAT, GROUP, DISABLED ) -LOG_TYPE( CHAT, GUILD, DISABLED ) - -LOG_CATEGORY( MAIL ) -LOG_TYPE( MAIL, INIT, ENABLED ) -LOG_TYPE( MAIL, ERROR, ENABLED ) -LOG_TYPE( MAIL, CLIENT, DISABLED ) -LOG_TYPE( MAIL, TRACE, DISABLED ) -LOG_TYPE( MAIL, PACKETS, DISABLED) - -LOG_CATEGORY( CHANNELS ) -LOG_TYPE( CHANNELS, INIT, ENABLED ) -LOG_TYPE( CHANNELS, ERROR, ENABLED ) -LOG_TYPE( CHANNELS, CLIENT, DISABLED ) -LOG_TYPE( CHANNELS, TRACE, DISABLED ) -LOG_TYPE( CHANNELS, PACKETS, DISABLED) - -LOG_CATEGORY( UCS ) -LOG_TYPE( UCS, INIT, ENABLED ) -LOG_TYPE( UCS, ERROR, ENABLED ) -LOG_TYPE( UCS, CLIENT, DISABLED ) -LOG_TYPE( UCS, TRACE, DISABLED ) -LOG_TYPE( UCS, PACKETS, DISABLED) - -LOG_CATEGORY( QUERYSERV ) -LOG_TYPE( QUERYSERV, INIT, ENABLED ) -LOG_TYPE( QUERYSERV, ERROR, ENABLED ) -LOG_TYPE( QUERYSERV, CLIENT, DISABLED ) -LOG_TYPE( QUERYSERV, TRACE, DISABLED ) -LOG_TYPE( QUERYSERV, PACKETS, DISABLED) - -LOG_CATEGORY( SOCKET_SERVER) -LOG_TYPE( SOCKET_SERVER, INIT, ENABLED) -LOG_TYPE( SOCKET_SERVER, ERROR, ENABLED) -LOG_TYPE( SOCKET_SERVER, CLIENT, DISABLED) -LOG_TYPE( SOCKET_SERVER, TRACE, DISABLED) -LOG_TYPE( SOCKET_SERVER, PACKETS, DISABLED) - -LOG_CATEGORY( SPAWNS ) -LOG_TYPE( SPAWNS, MAIN, DISABLED ) -LOG_TYPE( SPAWNS, CONDITIONS, DISABLED ) -LOG_TYPE( SPAWNS, LIMITS, DISABLED ) - -LOG_CATEGORY( AI ) -LOG_TYPE( AI, ERROR, ENABLED ) -LOG_TYPE( AI, WAYPOINTS, DISABLED ) -LOG_TYPE( AI, BUFFS, DISABLED ) -LOG_TYPE( AI, SPELLS, DISABLED ) - -LOG_CATEGORY( PATHING) -LOG_TYPE( PATHING, DEBUG, DISABLED ) - -LOG_CATEGORY( QUESTS ) -LOG_TYPE( QUESTS, PATHING, DISABLED ) - -LOG_CATEGORY( SPELLS ) -LOG_TYPE( SPELLS, LOAD, DISABLED ) -LOG_TYPE( SPELLS, LOAD_ERR, DISABLED ) -LOG_TYPE( SPELLS, CASTING_ERR, DISABLED ) -LOG_TYPE( SPELLS, CASTING, DISABLED ) -LOG_TYPE( SPELLS, EFFECT_VALUES, DISABLED ) -LOG_TYPE( SPELLS, RESISTS, DISABLED ) -LOG_TYPE( SPELLS, STACKING, DISABLED ) -LOG_TYPE( SPELLS, BARDS, DISABLED ) -LOG_TYPE( SPELLS, BUFFS, DISABLED ) -LOG_TYPE( SPELLS, PROCS, DISABLED ) -LOG_TYPE( SPELLS, MODIFIERS, DISABLED ) -LOG_TYPE( SPELLS, CRITS, DISABLED ) -LOG_TYPE( SPELLS, REZ, DISABLED ) - -LOG_CATEGORY( FACTION ) - -LOG_CATEGORY( ZONE ) -LOG_TYPE( ZONE, GROUND_SPAWNS, DISABLED ) -LOG_TYPE( ZONE, SPAWNS, ENABLED) -LOG_TYPE( ZONE, INIT, ENABLED ) -LOG_TYPE( ZONE, INIT_ERR, ENABLED ) -LOG_TYPE( ZONE, WORLD, ENABLED ) -LOG_TYPE( ZONE, WORLD_ERR, ENABLED ) -LOG_TYPE( ZONE, WORLD_TRACE, DISABLED ) - -LOG_CATEGORY( TASKS ) -LOG_TYPE( TASKS, GLOBALLOAD, DISABLED ) -LOG_TYPE( TASKS, CLIENTLOAD, DISABLED ) -LOG_TYPE( TASKS, UPDATE, DISABLED ) -LOG_TYPE( TASKS, CLIENTSAVE, DISABLED ) -LOG_TYPE( TASKS, PACKETS, DISABLED ) -LOG_TYPE( TASKS, PROXIMITY, DISABLED ) - - -LOG_CATEGORY( TRADING ) -LOG_TYPE( TRADING, ERROR, ENABLED ) -LOG_TYPE( TRADING, CLIENT, DISABLED ) -LOG_TYPE( TRADING, NPC, DISABLED ) -LOG_TYPE( TRADING, HOLDER, DISABLED ) -LOG_TYPE( TRADING, BARTER, DISABLED ) -LOG_TYPE( TRADING, PACKETS, DISABLED ) - -LOG_CATEGORY( INVENTORY ) -LOG_TYPE( INVENTORY, ERROR, ENABLED ) -LOG_TYPE( INVENTORY, SLOTS, ENABLED ) -LOG_TYPE( INVENTORY, BANDOLIER, ENABLED ) - -LOG_CATEGORY( TRADESKILLS ) -LOG_TYPE( TRADESKILLS, IN, DISABLED ) -LOG_TYPE( TRADESKILLS, OUT, DISABLED ) -LOG_TYPE( TRADESKILLS, SQL, DISABLED ) -LOG_TYPE( TRADESKILLS, TRACE, DISABLED ) - -LOG_CATEGORY( TRIBUTE ) -LOG_TYPE( TRIBUTE, ERROR, DISABLED ) -LOG_TYPE( TRIBUTE, IN, DISABLED ) -LOG_TYPE( TRIBUTE, OUT, DISABLED ) - -LOG_CATEGORY( AA ) -LOG_TYPE( AA, ERROR, ENABLED ) -LOG_TYPE( AA, MESSAGE, DISABLED ) -LOG_TYPE( AA, IN, DISABLED ) -LOG_TYPE( AA, OUT, DISABLED ) -LOG_TYPE( AA, BONUSES, DISABLED ) - - -LOG_CATEGORY( DOORS ) -LOG_TYPE( DOORS, INFO, DISABLED ) - -LOG_CATEGORY( PETS ) -LOG_TYPE( PETS, AGGRO, DISABLED ) - -LOG_CATEGORY( COMBAT ) -LOG_TYPE( COMBAT, ATTACKS, DISABLED ) -LOG_TYPE( COMBAT, TOHIT, DISABLED ) -LOG_TYPE( COMBAT, MISSES, DISABLED ) -LOG_TYPE( COMBAT, DAMAGE, DISABLED ) -LOG_TYPE( COMBAT, HITS, DISABLED ) -LOG_TYPE( COMBAT, RANGED, DISABLED ) -LOG_TYPE( COMBAT, SPECIAL_ATTACKS, DISABLED ) -LOG_TYPE( COMBAT, PROCS, DISABLED ) - -LOG_CATEGORY( GUILDS ) -LOG_TYPE( GUILDS, ERROR, ENABLED ) -LOG_TYPE( GUILDS, ACTIONS, ENABLED ) -LOG_TYPE( GUILDS, DB, DISABLED ) -LOG_TYPE( GUILDS, PERMISSIONS, DISABLED ) -LOG_TYPE( GUILDS, REFRESH, DISABLED ) //inter-zone refresh comm -LOG_TYPE( GUILDS, IN_PACKETS, DISABLED ) -LOG_TYPE( GUILDS, OUT_PACKETS, DISABLED ) -LOG_TYPE( GUILDS, IN_PACKET_TRACE, DISABLED ) //hex dumps -LOG_TYPE( GUILDS, OUT_PACKET_TRACE, DISABLED ) //hex dumps -LOG_TYPE( GUILDS, BANK_ERROR, ENABLED ) - -LOG_CATEGORY( CLIENT ) -LOG_TYPE( CLIENT, ERROR, ENABLED ) -LOG_TYPE( CLIENT, DUELING, DISABLED ) -LOG_TYPE( CLIENT, SPELLS, DISABLED ) -LOG_TYPE( CLIENT, NET_ERR, ENABLED ) -LOG_TYPE( CLIENT, NET_IN_TRACE, DISABLED ) -LOG_TYPE( CLIENT, EXP, DISABLED ) - -LOG_CATEGORY( SKILLS ) -LOG_TYPE( SKILLS, GAIN, DISABLED ) - -LOG_CATEGORY( RULES ) -LOG_TYPE( RULES, ERROR, DISABLED ) -LOG_TYPE( RULES, CHANGE, DISABLED ) - -LOG_CATEGORY( NET ) -LOG_TYPE( NET, WORLD, ENABLED ) -LOG_TYPE( NET, OPCODES, ENABLED ) -LOG_TYPE( NET, IDENTIFY, ENABLED ) -LOG_TYPE( NET, IDENT_TRACE, ENABLED ) -LOG_TYPE( NET, STRUCTS, ENABLED ) -LOG_TYPE( NET, STRUCT_HEX, ENABLED ) -LOG_TYPE( NET, ERROR, ENABLED ) -LOG_TYPE( NET, DEBUG, DISABLED ) -LOG_TYPE( NET, APP_TRACE, DISABLED ) -LOG_TYPE( NET, APP_CREATE, DISABLED ) -LOG_TYPE( NET, APP_CREATE_HEX, DISABLED ) -LOG_TYPE( NET, NET_TRACE, DISABLED ) -LOG_TYPE( NET, NET_COMBINE, DISABLED ) -LOG_TYPE( NET, FRAGMENT, DISABLED ) -LOG_TYPE( NET, FRAGMENT_HEX, DISABLED ) -LOG_TYPE( NET, NET_CREATE, DISABLED ) -LOG_TYPE( NET, NET_CREATE_HEX, DISABLED ) -LOG_TYPE( NET, NET_ACKS, DISABLED ) -LOG_TYPE( NET, RATES, DISABLED ) - -LOG_CATEGORY( DATABASE ) - -LOG_CATEGORY( COMMON ) -LOG_TYPE( COMMON, ERROR, ENABLED ) -LOG_TYPE( COMMON, THREADS, ENABLED ) - -LOG_CATEGORY( LAUNCHER ) -LOG_TYPE( LAUNCHER, ERROR, ENABLED ) -LOG_TYPE( LAUNCHER, INIT, ENABLED ) -LOG_TYPE( LAUNCHER, STATUS, ENABLED ) -LOG_TYPE( LAUNCHER, NET, ENABLED ) -LOG_TYPE( LAUNCHER, WORLD, ENABLED ) - -LOG_CATEGORY( WORLD ) -LOG_TYPE( WORLD, CONFIG, ENABLED ) -LOG_TYPE( WORLD, INIT, ENABLED ) -LOG_TYPE( WORLD, INIT_ERR, ENABLED ) -LOG_TYPE( WORLD, CLIENT, ENABLED ) -LOG_TYPE( WORLD, ZONE, ENABLED ) -LOG_TYPE( WORLD, LS, ENABLED ) -LOG_TYPE( WORLD, CLIENT_ERR, ENABLED ) -LOG_TYPE( WORLD, ZONE_ERR, ENABLED ) -LOG_TYPE( WORLD, LS_ERR, ENABLED ) -LOG_TYPE( WORLD, SHUTDOWN, ENABLED ) -LOG_TYPE( WORLD, CLIENTLIST, DISABLED ) -LOG_TYPE( WORLD, CLIENTLIST_ERR, ENABLED ) -LOG_TYPE( WORLD, ZONELIST, ENABLED ) -LOG_TYPE( WORLD, ZONELIST_ERR, ENABLED ) -LOG_TYPE( WORLD, CLIENT_TRACE, DISABLED ) -LOG_TYPE( WORLD, ZONE_TRACE, DISABLED ) -LOG_TYPE( WORLD, LS_TRACE, DISABLED ) -LOG_TYPE( WORLD, CONSOLE, ENABLED ) -LOG_TYPE( WORLD, HTTP, ENABLED ) -LOG_TYPE( WORLD, HTTP_ERR, ENABLED ) -LOG_TYPE( WORLD, PERL, ENABLED ) -LOG_TYPE( WORLD, PERL_ERR, ENABLED ) -LOG_TYPE( WORLD, EQW, ENABLED ) -LOG_TYPE( WORLD, LAUNCH, ENABLED ) -LOG_TYPE( WORLD, LAUNCH_ERR, ENABLED ) -LOG_TYPE( WORLD, LAUNCH_TRACE, ENABLED ) - -#undef LOG_TYPE -#undef LOG_CATEGORY - diff --git a/common/spdat.cpp b/common/spdat.cpp index 6359d51dd..4b847b75e 100644 --- a/common/spdat.cpp +++ b/common/spdat.cpp @@ -71,7 +71,7 @@ */ -#include "../common/logtypes.h" + #include "../common/eqemu_logsys.h" #include "classes.h" diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 370fae5fc..171dcaa13 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -5,7 +5,7 @@ #include "clientlist.h" #include "zonelist.h" -#include "../common/logtypes.h" + #include "../common/md5.h" #include "../common/emu_tcp_connection.h" #include "../common/packet_dump.h" diff --git a/world/ucs.cpp b/world/ucs.cpp index 11cff6a69..4f9827a36 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -3,7 +3,7 @@ #include "ucs.h" #include "world_config.h" -#include "../common/logtypes.h" + #include "../common/md5.h" #include "../common/emu_tcp_connection.h" #include "../common/packet_dump.h" diff --git a/zone/net.cpp b/zone/net.cpp index bbf0855cc..18669cb8e 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -114,12 +114,9 @@ void Shutdown(); extern void MapOpcodes(); int main(int argc, char** argv) { - RegisterExecutablePlatform(ExePlatformZone); - - set_exception_handler(); - - const char *zone_name; - + RegisterExecutablePlatform(ExePlatformZone); + set_exception_handler(); + const char *zone_name; QServ = new QueryServ; if(argc == 3) { From 4d6c2be191de53df80bfbd165d61584a7f90120e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:36:50 -0600 Subject: [PATCH 211/707] Gut more of debug.cpp/.h --- common/debug.cpp | 18 ------------------ common/debug.h | 27 --------------------------- 2 files changed, 45 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 08d8ee8e2..6c47705bd 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -58,28 +58,10 @@ static volatile bool logFileValid = false; static EQEmuLog realLogFile; EQEmuLog *LogFile = &realLogFile; -static const char* FileNames[EQEmuLog::MaxLogID] = { "logs/eqemu", "logs/eqemu", "logs/eqemu_error", "logs/eqemu_debug", "logs/eqemu_quest", "logs/eqemu_commands", "logs/crash" }; -static const char* LogNames[EQEmuLog::MaxLogID] = { "Status", "Normal", "Error", "Debug", "Quest", "Command", "Crash" }; - EQEmuLog::EQEmuLog() { - pLogStatus[EQEmuLog::LogIDs::Status] = LOG_LEVEL_STATUS; - pLogStatus[EQEmuLog::LogIDs::Normal] = LOG_LEVEL_NORMAL; - pLogStatus[EQEmuLog::LogIDs::Error] = LOG_LEVEL_ERROR; - pLogStatus[EQEmuLog::LogIDs::Debug] = LOG_LEVEL_DEBUG; - pLogStatus[EQEmuLog::LogIDs::Quest] = LOG_LEVEL_QUEST; - pLogStatus[EQEmuLog::LogIDs::Commands] = LOG_LEVEL_COMMANDS; - pLogStatus[EQEmuLog::LogIDs::Crash] = LOG_LEVEL_CRASH; - logFileValid = true; } EQEmuLog::~EQEmuLog() { - logFileValid = false; - for (int i = 0; i < MaxLogID; i++) { - LockMutex lock(&MLog[i]); //to prevent termination race - if (fp[i]) { - fclose(fp[i]); - } - } } \ No newline at end of file diff --git a/common/debug.h b/common/debug.h index 889903a88..50567e0e8 100644 --- a/common/debug.h +++ b/common/debug.h @@ -78,34 +78,7 @@ class EQEmuLog { public: EQEmuLog(); ~EQEmuLog(); - - enum LogIDs { - Status = 0, /* This must stay the first entry in this list */ - Normal, /* Normal Logs */ - Error, /* Error Logs */ - Debug, /* Debug Logs */ - Quest, /* Quest Logs */ - Commands, /* Issued Comamnds */ - Crash, /* Crash Logs */ - Save, /* Client Saves */ - MaxLogID /* Max, used in functions to get the max log ID */ - }; - - private: - - Mutex MOpen; - Mutex MLog[MaxLogID]; - FILE* fp[MaxLogID]; - -/* LogStatus: bitwise variable - 1 = output to file - 2 = output to stdout - 4 = fopen error, dont retry - 8 = use stderr instead (2 must be set) -*/ - uint8 pLogStatus[MaxLogID]; - }; extern EQEmuLog* LogFile; From d7d1f9757b4a70659818d027ca4f9b53a3176aca Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:37:12 -0600 Subject: [PATCH 212/707] Removal of client_logs.cpp/.h --- zone/client.cpp | 4 -- zone/client_logs.cpp | 113 ------------------------------------------- zone/client_logs.h | 58 ---------------------- zone/zone.cpp | 3 -- 4 files changed, 178 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index d7b34f2b9..ac8646a9a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -349,10 +349,6 @@ Client::~Client() { m_tradeskill_object = nullptr; } -#ifdef CLIENT_LOGS - client_logs.unsubscribeAll(this); -#endif - ChangeSQLLog(nullptr); if(IsDueling() && GetDuelTarget() != 0) { Entity* entity = entity_list.GetID(GetDuelTarget()); diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp index de6278dcd..e69de29bb 100644 --- a/zone/client_logs.cpp +++ b/zone/client_logs.cpp @@ -1,113 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) - - 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 "../common/debug.h" -#include "../common/features.h" -#include "../common/eqemu_logsys.h" - -#ifdef CLIENT_LOGS -#include "client_logs.h" -#include "client.h" -#include "entity.h" -#include - -ClientLogs client_logs; - -char ClientLogs::_buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1]; - -void ClientLogs::subscribe(EQEmuLog::LogIDs id, Client *c) { - if(id >= EQEmuLog::MaxLogID) - return; - if(c == nullptr) - return; - - std::vector::iterator cur,end; - cur = entries[id].begin(); - end = entries[id].end(); - for(; cur != end; ++cur) { - if(*cur == c) { - printf("%s was already subscribed to %d\n", c->GetName(), id); - return; - } - } - - printf("%s has been subscribed to %d\n", c->GetName(), id); - entries[id].push_back(c); -} - -void ClientLogs::unsubscribe(EQEmuLog::LogIDs id, Client *c) { - if(id >= EQEmuLog::MaxLogID) - return; - if(c == nullptr) - return; - - std::vector::iterator cur,end; - cur = entries[id].begin(); - end = entries[id].end(); - for(; cur != end; ++cur) { - if(*cur == c) { - entries[id].erase(cur); - return; - } - } -} - -void ClientLogs::subscribeAll(Client *c) { - if(c == nullptr) - return; - int r; - for(r = EQEmuLog::Status; r < EQEmuLog::MaxLogID; r++) { - subscribe((EQEmuLog::LogIDs)r, c); - } -} - -void ClientLogs::unsubscribeAll(Client *c) { - if(c == nullptr) - return; - int r; - for(r = EQEmuLog::Status; r < EQEmuLog::MaxLogID; r++) { - unsubscribe((EQEmuLog::LogIDs)r, c); - } -} - -void ClientLogs::clear() { - int r; - for(r = EQEmuLog::Status; r < EQEmuLog::MaxLogID; r++) { - entries[r].clear(); - } -} - -void ClientLogs::msg(EQEmuLog::LogIDs id, const char *buf) { - if(id >= EQEmuLog::MaxLogID) - return; - std::vector::iterator cur,end; - cur = entries[id].begin(); - end = entries[id].end(); - for(; cur != end; ++cur) { - if(!(*cur)->InZone()) - continue; - - (*cur)->Message(CLIENT_LOG_CHANNEL, buf); - } -} - - - -#endif //CLIENT_LOGS - - - diff --git a/zone/client_logs.h b/zone/client_logs.h index aacefdba9..e69de29bb 100644 --- a/zone/client_logs.h +++ b/zone/client_logs.h @@ -1,58 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) - - 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 CLIENT_LOGS_H -#define CLIENT_LOGS_H - -#include "../common/debug.h" -#include "../common/features.h" - -#ifdef CLIENT_LOGS - -#define CLIENT_LOG_CHANNEL MT_Chat10Echo - -//trim messages to this length before sending to any clients -#define MAX_CLIENT_LOG_MESSAGE_LENGTH 512 - -#include - -class Client; - -class ClientLogs { -public: - - void subscribe(EQEmuLog::LogIDs id, Client *c); - void unsubscribe(EQEmuLog::LogIDs id, Client *c); - void subscribeAll(Client *c); - void unsubscribeAll(Client *c); - void clear(); //unsubscribes everybody - - void msg(EQEmuLog::LogIDs id, const char *buf); - -protected: - - std::vector entries[EQEmuLog::MaxLogID]; - - static char _buffer[MAX_CLIENT_LOG_MESSAGE_LENGTH+1]; -}; - -extern ClientLogs client_logs; - -#endif //CLIENT_LOGS -#endif - diff --git a/zone/zone.cpp b/zone/zone.cpp index b4394377f..3a81475a9 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -888,9 +888,6 @@ Zone::~Zone() { } safe_delete_array(aas); } -#ifdef CLIENT_LOGS - client_logs.clear(); -#endif safe_delete(GuildBanks); } From dda1806dfbd4851b062091054c0a24bac6028aab Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:38:07 -0600 Subject: [PATCH 213/707] File deletion of client_logs and CMakeLists.txt update --- zone/CMakeLists.txt | 2 -- zone/client_logs.cpp | 0 zone/client_logs.h | 0 3 files changed, 2 deletions(-) delete mode 100644 zone/client_logs.cpp delete mode 100644 zone/client_logs.h diff --git a/zone/CMakeLists.txt b/zone/CMakeLists.txt index 5da25e64f..d6c18bae0 100644 --- a/zone/CMakeLists.txt +++ b/zone/CMakeLists.txt @@ -9,7 +9,6 @@ SET(zone_sources bot.cpp botspellsai.cpp client.cpp - client_logs.cpp client_mods.cpp client_packet.cpp client_process.cpp @@ -128,7 +127,6 @@ SET(zone_headers bot.h bot_structs.h client.h - client_logs.h client_packet.h command.h common.h diff --git a/zone/client_logs.cpp b/zone/client_logs.cpp deleted file mode 100644 index e69de29bb..000000000 diff --git a/zone/client_logs.h b/zone/client_logs.h deleted file mode 100644 index e69de29bb..000000000 From fa83809130493376ba33acc1f7db37353f953f63 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:40:09 -0600 Subject: [PATCH 214/707] Removal of client_logs.h from #includes --- zone/client.cpp | 2 +- zone/command.cpp | 2 +- zone/net.cpp | 4 ++-- zone/zone.cpp | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index ac8646a9a..c0f9ff64b 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -47,7 +47,7 @@ extern volatile bool RunLoops; #include "petitions.h" #include "command.h" #include "string_ids.h" -#include "client_logs.h" + #include "guild_mgr.h" #include "quest_parser_collection.h" #include "queryserv.h" diff --git a/zone/command.cpp b/zone/command.cpp index 06e4114d0..fe8d3d9fd 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -53,7 +53,7 @@ #include "../common/string_util.h" #include "../common/eqemu_logsys.h" -#include "client_logs.h" + #include "command.h" #include "guild_mgr.h" #include "map.h" diff --git a/zone/net.cpp b/zone/net.cpp index 18669cb8e..078f9cdd7 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -45,7 +45,7 @@ #include "../common/spdat.h" #include "../common/eqemu_logsys.h" -#include "client_logs.h" + #include "zone_config.h" #include "masterentity.h" #include "worldserver.h" @@ -61,7 +61,7 @@ #include "quest_parser_collection.h" #include "embparser.h" #include "lua_parser.h" -#include "client_logs.h" + #include "questmgr.h" #include diff --git a/zone/zone.cpp b/zone/zone.cpp index 3a81475a9..ecfdb4cef 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -37,7 +37,6 @@ #include "../common/string_util.h" #include "../common/eqemu_logsys.h" -#include "client_logs.h" #include "guild_mgr.h" #include "map.h" #include "net.h" From 62ff6453ef876d71906b2ba44e5aaf6e3fcb5e1e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:43:30 -0600 Subject: [PATCH 215/707] Remove EQDEBUG preprocessor from debug --- common/debug.cpp | 4 ---- common/debug.h | 27 --------------------------- 2 files changed, 31 deletions(-) diff --git a/common/debug.cpp b/common/debug.cpp index 6c47705bd..1dfe0ad85 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -54,10 +54,6 @@ namespace ConsoleColor { #define va_copy(d,s) ((d) = (s)) #endif -static volatile bool logFileValid = false; -static EQEmuLog realLogFile; -EQEmuLog *LogFile = &realLogFile; - EQEmuLog::EQEmuLog() { } diff --git a/common/debug.h b/common/debug.h index 50567e0e8..42c0f8e76 100644 --- a/common/debug.h +++ b/common/debug.h @@ -16,31 +16,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -// Debug Levels -#ifndef EQDEBUG -#define EQDEBUG 1 -#else -////// File/Console options -// 0 <= Quiet mode Errors to file Status and Normal ignored -// 1 >= Status and Normal to console, Errors to file -// 2 >= Status, Normal, and Error to console and logfile -// 3 >= Lite debug -// 4 >= Medium debug -// 5 >= Debug release (Anything higher is not recommended for regular use) -// 6 == (Reserved for special builds) Login opcode debug All packets dumped -// 7 == (Reserved for special builds) Chat Opcode debug All packets dumped -// 8 == (Reserved for special builds) World opcode debug All packets dumped -// 9 == (Reserved for special builds) Zone Opcode debug All packets dumped -// 10 >= More than you ever wanted to know -// -///// -// Add more below to reserve for file's functions ect. -///// -// Any setup code based on defines should go here -// -#endif - - #if defined(_DEBUG) && defined(WIN32) #ifndef _CRTDBG_MAP_ALLOC #include @@ -81,6 +56,4 @@ public: private: }; -extern EQEmuLog* LogFile; - #endif From 89b16512d5e000932d947104b6a02d09c8ced82b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 03:49:25 -0600 Subject: [PATCH 216/707] Delete debug.cpp file and from cmake --- common/CMakeLists.txt | 1 - common/debug.cpp | 63 ------------------------------------------- common/debug.h | 13 --------- 3 files changed, 77 deletions(-) delete mode 100644 common/debug.cpp diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 1ddbeb94a..fe57eab59 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -9,7 +9,6 @@ SET(common_sources crc32.cpp database.cpp dbcore.cpp - debug.cpp emu_opcodes.cpp emu_tcp_connection.cpp emu_tcp_server.cpp diff --git a/common/debug.cpp b/common/debug.cpp deleted file mode 100644 index 1dfe0ad85..000000000 --- a/common/debug.cpp +++ /dev/null @@ -1,63 +0,0 @@ - - -#include -#include - -#ifdef _WINDOWS - #include - - #define snprintf _snprintf - #define vsnprintf _vsnprintf - #define strncasecmp _strnicmp - #define strcasecmp _stricmp - - #include - #include - #include - -namespace ConsoleColor { - enum Colors { - Black = 0, - Blue = 1, - Green = 2, - Cyan = 3, - Red = 4, - Magenta = 5, - Brown = 6, - LightGray = 7, - DarkGray = 8, - LightBlue = 9, - LightGreen = 10, - LightCyan = 11, - LightRed = 12, - LightMagenta = 13, - Yellow = 14, - White = 15, - }; -} - -#else - - #include - #include - -#endif - -#include "eqemu_logsys.h" -#include "debug.h" -#include "misc_functions.h" -#include "platform.h" -#include "eqemu_logsys.h" -#include "string_util.h" - -#ifndef va_copy - #define va_copy(d,s) ((d) = (s)) -#endif - -EQEmuLog::EQEmuLog() -{ -} - -EQEmuLog::~EQEmuLog() -{ -} \ No newline at end of file diff --git a/common/debug.h b/common/debug.h index 42c0f8e76..d6fbf3694 100644 --- a/common/debug.h +++ b/common/debug.h @@ -26,10 +26,6 @@ #ifndef EQDEBUG_H #define EQDEBUG_H -#ifndef _WINDOWS - #define DebugBreak() if(0) {} -#endif - #define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues #if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) ) // Packet Collector on win32 requires winsock.h due to latest pcap.h @@ -42,18 +38,9 @@ #include #endif - - #include "../common/mutex.h" #include #include -class EQEmuLog { -public: - EQEmuLog(); - ~EQEmuLog(); -private: -}; - #endif From 045125d328c14cf308ca9a6832ff7b807c709f59 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 04:02:45 -0600 Subject: [PATCH 217/707] Add types.h to a bunch of files --- common/clientversions.h | 2 ++ common/condition.h | 1 + common/debug.h | 6 +++--- common/eq_constants.h | 1 + common/moremath.cpp | 3 ++- common/moremath.h | 2 ++ common/proc_launcher.cpp | 1 + common/seperator.h | 3 ++- common/tcp_server.h | 2 +- 9 files changed, 15 insertions(+), 6 deletions(-) diff --git a/common/clientversions.h b/common/clientversions.h index ee70d481c..32108a633 100644 --- a/common/clientversions.h +++ b/common/clientversions.h @@ -1,6 +1,8 @@ #ifndef CLIENTVERSIONS_H #define CLIENTVERSIONS_H +#include "types.h" + static const uint32 BIT_Client62 = 1; static const uint32 BIT_Titanium = 2; static const uint32 BIT_SoF = 4; diff --git a/common/condition.h b/common/condition.h index bfbffe760..dde51cb6d 100644 --- a/common/condition.h +++ b/common/condition.h @@ -19,6 +19,7 @@ #define __CONDITION_H #include "debug.h" +#include "mutex.h" #ifndef WIN32 #include #endif diff --git a/common/debug.h b/common/debug.h index d6fbf3694..d21e49a7c 100644 --- a/common/debug.h +++ b/common/debug.h @@ -38,9 +38,9 @@ #include #endif -#include "../common/mutex.h" -#include -#include + + + #endif diff --git a/common/eq_constants.h b/common/eq_constants.h index 426d4a9e5..3ff7abd6b 100644 --- a/common/eq_constants.h +++ b/common/eq_constants.h @@ -19,6 +19,7 @@ #define EQ_CONSTANTS_H #include "skills.h" +#include "types.h" /* ** Item attributes diff --git a/common/moremath.cpp b/common/moremath.cpp index 84f0b8900..bd8412458 100644 --- a/common/moremath.cpp +++ b/common/moremath.cpp @@ -15,7 +15,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" + +#include "types.h" // Quagmire - i was really surprised, but i couldnt find the equivilent standard library function signed char sign(signed int tmp) { diff --git a/common/moremath.h b/common/moremath.h index d000a54b8..8f03bcea3 100644 --- a/common/moremath.h +++ b/common/moremath.h @@ -18,6 +18,8 @@ #ifndef MOREMATH_H #define MOREMATH_H +#include "types.h" + signed char sign(signed int tmp); signed char sign(double tmp); uint32 pow32(uint32 base, uint32 exponet); diff --git a/common/proc_launcher.cpp b/common/proc_launcher.cpp index 0ea0d9636..36f58de86 100644 --- a/common/proc_launcher.cpp +++ b/common/proc_launcher.cpp @@ -20,6 +20,7 @@ #include #include "debug.h" +#include "types.h" #include "proc_launcher.h" #ifdef _WINDOWS #include diff --git a/common/seperator.h b/common/seperator.h index 62054d137..7e81f8164 100644 --- a/common/seperator.h +++ b/common/seperator.h @@ -23,8 +23,9 @@ #ifndef SEPERATOR_H #define SEPERATOR_H -#include +#include "types.h" #include +#include class Seperator { diff --git a/common/tcp_server.h b/common/tcp_server.h index 3e28a7ac7..0bc1966c0 100644 --- a/common/tcp_server.h +++ b/common/tcp_server.h @@ -2,7 +2,7 @@ #define TCPSERVER_H_ #include "types.h" - +#include "mutex.h" #include #include From d41ba853cf4dd52a47e7f668ae47968dc6992ba3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 04:04:50 -0600 Subject: [PATCH 218/707] Added types.h to more files that relied on mutex.h to get to debug.h to get to types.h --- common/loottable.h | 1 + zone/perl_perlpacket.cpp | 1 + zone/perlpacket.h | 1 + 3 files changed, 3 insertions(+) diff --git a/common/loottable.h b/common/loottable.h index 8ad2f1e72..d046c0c08 100644 --- a/common/loottable.h +++ b/common/loottable.h @@ -19,6 +19,7 @@ #ifndef _EQEMU_LOOTTABLE_H #define _EQEMU_LOOTTABLE_H +#include "types.h" #pragma pack(1) struct LootTableEntries_Struct { diff --git a/zone/perl_perlpacket.cpp b/zone/perl_perlpacket.cpp index 05bbf01f6..4a9c70464 100644 --- a/zone/perl_perlpacket.cpp +++ b/zone/perl_perlpacket.cpp @@ -28,6 +28,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES #include "../common/debug.h" +#include "../common/types.h" #include "embperl.h" #ifdef seed diff --git a/zone/perlpacket.h b/zone/perlpacket.h index a81e84ad0..4f8e39f0e 100644 --- a/zone/perlpacket.h +++ b/zone/perlpacket.h @@ -21,6 +21,7 @@ #include #include +#include "../common/types.h" #include "../common/emu_opcodes.h" class Client; From 0b70706a6447532fb3f2c69be72deb3c9156f5a9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 04:09:02 -0600 Subject: [PATCH 219/707] Stuff --- common/debug.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/common/debug.h b/common/debug.h index d21e49a7c..0c5d32ee9 100644 --- a/common/debug.h +++ b/common/debug.h @@ -1,5 +1,5 @@ /* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) + Copyright (C) 2001-2015 EQEMu Development Team (http://eqemu.org) 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 @@ -38,9 +38,4 @@ #include #endif - - - - - #endif From 0d9b6703a61e6d0ea6073980b6d3a00d8212a8e5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 04:12:09 -0600 Subject: [PATCH 220/707] Rename debug.h to global_define.h, update cmakelists and such --- client_files/export/main.cpp | 2 +- client_files/import/main.cpp | 2 +- common/CMakeLists.txt | 2 +- common/SocketLib/HTTPSocket.cpp | 2 +- common/SocketLib/HttpdCookies.cpp | 2 +- common/SocketLib/HttpdSocket.cpp | 2 +- common/base_packet.cpp | 2 +- common/classes.cpp | 2 +- common/condition.h | 2 +- common/crash.cpp | 2 +- common/database.cpp | 2 +- common/database.h | 2 +- common/debug.h | 41 ------------------------------- common/emu_opcodes.cpp | 2 +- common/emu_tcp_connection.cpp | 2 +- common/emu_tcp_server.cpp | 2 +- common/eq_packet.cpp | 2 +- common/eq_stream.cpp | 2 +- common/eq_stream_factory.cpp | 2 +- common/eq_stream_ident.cpp | 2 +- common/eq_stream_proxy.cpp | 2 +- common/eqdb.cpp | 2 +- common/eqdb_res.cpp | 2 +- common/eqemu_config.cpp | 2 +- common/eqtime.cpp | 2 +- common/extprofile.cpp | 2 +- common/guilds.cpp | 2 +- common/item.cpp | 2 +- common/misc.cpp | 2 +- common/misc_functions.cpp | 2 +- common/mutex.cpp | 2 +- common/opcode_map.cpp | 2 +- common/packet_dump_file.cpp | 2 +- common/packet_functions.cpp | 2 +- common/patches/patches.cpp | 2 +- common/patches/rof.cpp | 2 +- common/patches/rof2.cpp | 2 +- common/patches/sod.cpp | 2 +- common/patches/sof.cpp | 2 +- common/patches/titanium.cpp | 2 +- common/patches/underfoot.cpp | 2 +- common/perl_eqdb.cpp | 2 +- common/perl_eqdb_res.cpp | 2 +- common/proc_launcher.cpp | 2 +- common/proc_launcher.h | 2 +- common/ptimer.cpp | 2 +- common/struct_strategy.cpp | 2 +- common/tcp_connection.cpp | 2 +- common/tcp_server.cpp | 2 +- common/timeoutmgr.cpp | 2 +- common/timer.h | 2 +- common/worldconn.cpp | 2 +- common/xml_parser.cpp | 2 +- common/xml_parser.h | 2 +- eqlaunch/eqlaunch.cpp | 2 +- eqlaunch/worldserver.cpp | 2 +- eqlaunch/zone_launch.cpp | 2 +- queryserv/database.cpp | 2 +- queryserv/database.h | 2 +- queryserv/queryserv.cpp | 2 +- queryserv/queryservconfig.cpp | 2 +- queryserv/worldserver.cpp | 2 +- shared_memory/base_data.cpp | 2 +- shared_memory/items.cpp | 2 +- shared_memory/loot.cpp | 2 +- shared_memory/main.cpp | 2 +- shared_memory/npc_faction.cpp | 2 +- shared_memory/skill_caps.cpp | 2 +- shared_memory/spells.cpp | 2 +- ucs/clientlist.cpp | 2 +- ucs/database.cpp | 2 +- ucs/database.h | 2 +- ucs/ucs.cpp | 2 +- ucs/ucsconfig.cpp | 2 +- ucs/worldserver.cpp | 2 +- world/adventure.cpp | 2 +- world/adventure.h | 2 +- world/adventure_manager.cpp | 2 +- world/adventure_manager.h | 2 +- world/adventure_template.h | 2 +- world/client.cpp | 2 +- world/cliententry.cpp | 2 +- world/clientlist.cpp | 2 +- world/console.cpp | 2 +- world/eql_config.cpp | 2 +- world/eqw.cpp | 2 +- world/eqw_http_handler.cpp | 2 +- world/eqw_parser.cpp | 2 +- world/http_request.cpp | 2 +- world/launcher_link.cpp | 2 +- world/launcher_list.cpp | 2 +- world/login_server.cpp | 2 +- world/login_server_list.cpp | 2 +- world/net.cpp | 4 +-- world/perl_eql_config.cpp | 2 +- world/perl_eqw.cpp | 2 +- world/perl_http_request.cpp | 2 +- world/queryserv.cpp | 2 +- world/ucs.cpp | 2 +- world/wguild_mgr.cpp | 2 +- world/world_config.cpp | 2 +- world/zonelist.cpp | 2 +- world/zoneserver.cpp | 2 +- zone/aa.cpp | 2 +- zone/aggro.cpp | 2 +- zone/attack.cpp | 2 +- zone/bonuses.cpp | 2 +- zone/bot.h | 2 +- zone/client.cpp | 2 +- zone/client_mods.cpp | 2 +- zone/client_packet.cpp | 2 +- zone/client_process.cpp | 2 +- zone/command.cpp | 2 +- zone/corpse.cpp | 2 +- zone/doors.cpp | 2 +- zone/effects.cpp | 2 +- zone/embparser.cpp | 2 +- zone/embparser_api.cpp | 2 +- zone/embperl.cpp | 2 +- zone/embxs.cpp | 2 +- zone/entity.cpp | 2 +- zone/exp.cpp | 2 +- zone/forage.cpp | 2 +- zone/groups.cpp | 2 +- zone/horse.cpp | 2 +- zone/inventory.cpp | 2 +- zone/loottables.cpp | 2 +- zone/map.cpp | 2 +- zone/mob_ai.cpp | 2 +- zone/net.cpp | 2 +- zone/npc.cpp | 2 +- zone/object.cpp | 2 +- zone/pathing.cpp | 2 +- zone/perl_client.cpp | 2 +- zone/perl_doors.cpp | 2 +- zone/perl_entity.cpp | 2 +- zone/perl_groups.cpp | 2 +- zone/perl_hateentry.cpp | 2 +- zone/perl_mob.cpp | 2 +- zone/perl_npc.cpp | 2 +- zone/perl_object.cpp | 2 +- zone/perl_perlpacket.cpp | 2 +- zone/perl_player_corpse.cpp | 2 +- zone/perl_questitem.cpp | 2 +- zone/perl_raids.cpp | 2 +- zone/perlpacket.cpp | 2 +- zone/petitions.cpp | 2 +- zone/pets.cpp | 2 +- zone/queryserv.cpp | 2 +- zone/quest_parser_collection.cpp | 2 +- zone/questmgr.cpp | 2 +- zone/spawn2.cpp | 2 +- zone/spawngroup.cpp | 2 +- zone/spell_effects.cpp | 2 +- zone/spells.cpp | 2 +- zone/tasks.cpp | 2 +- zone/tradeskills.cpp | 2 +- zone/trading.cpp | 2 +- zone/tribute.cpp | 2 +- zone/waypoints.cpp | 2 +- zone/worldserver.cpp | 2 +- zone/zone.cpp | 2 +- zone/zoning.cpp | 2 +- 163 files changed, 163 insertions(+), 204 deletions(-) delete mode 100644 common/debug.h diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 45dd34cec..c60b7266c 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -19,7 +19,7 @@ #include #include "../../common/eqemu_logsys.h" -#include "../../common/debug.h" +#include "../../common/global_define.h" #include "../../common/shareddb.h" #include "../../common/eqemu_config.h" #include "../../common/platform.h" diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 8567723ce..3d6511d8f 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -17,7 +17,7 @@ */ #include "../../common/eqemu_logsys.h" -#include "../../common/debug.h" +#include "../../common/global_define.h" #include "../../common/shareddb.h" #include "../../common/eqemu_config.h" #include "../../common/platform.h" diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index fe57eab59..cc5949d44 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -103,7 +103,6 @@ SET(common_headers data_verification.h database.h dbcore.h - debug.h deity.h emu_opcodes.h emu_oplist.h @@ -133,6 +132,7 @@ SET(common_headers features.h fixed_memory_hash_set.h fixed_memory_variable_hash_set.h + global_define.h guild_base.h guilds.h ipc_mutex.h diff --git a/common/SocketLib/HTTPSocket.cpp b/common/SocketLib/HTTPSocket.cpp index ecde78403..da4f2264c 100644 --- a/common/SocketLib/HTTPSocket.cpp +++ b/common/SocketLib/HTTPSocket.cpp @@ -40,7 +40,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef _WIN32 #pragma warning(disable:4786) #endif -#include "../debug.h" +#include "../global_define.h" #include #include #include diff --git a/common/SocketLib/HttpdCookies.cpp b/common/SocketLib/HttpdCookies.cpp index 4d9fccb1b..a40200aab 100644 --- a/common/SocketLib/HttpdCookies.cpp +++ b/common/SocketLib/HttpdCookies.cpp @@ -26,7 +26,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include "../debug.h" +#include "../global_define.h" #ifdef _WIN32 #pragma warning(disable:4786) #endif diff --git a/common/SocketLib/HttpdSocket.cpp b/common/SocketLib/HttpdSocket.cpp index bd803877a..8ed3041e4 100644 --- a/common/SocketLib/HttpdSocket.cpp +++ b/common/SocketLib/HttpdSocket.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifdef _WIN32 #pragma warning(disable:4786) #endif -#include "../debug.h" +#include "../global_define.h" #include "Utility.h" #include "HttpdCookies.h" #include "HttpdForm.h" diff --git a/common/base_packet.cpp b/common/base_packet.cpp index e871ea71f..ce6afe978 100644 --- a/common/base_packet.cpp +++ b/common/base_packet.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "base_packet.h" #include "misc.h" #include "packet_dump.h" diff --git a/common/classes.cpp b/common/classes.cpp index 6270656f4..1f54c9234 100644 --- a/common/classes.cpp +++ b/common/classes.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/classes.h" const char* GetEQClassName(uint8 class_, uint8 level) { diff --git a/common/condition.h b/common/condition.h index dde51cb6d..9c4cd9f7b 100644 --- a/common/condition.h +++ b/common/condition.h @@ -18,7 +18,7 @@ #ifndef __CONDITION_H #define __CONDITION_H -#include "debug.h" +#include "global_define.h" #include "mutex.h" #ifndef WIN32 #include diff --git a/common/crash.cpp b/common/crash.cpp index fee4dcddf..1f700f151 100644 --- a/common/crash.cpp +++ b/common/crash.cpp @@ -1,4 +1,4 @@ -#include "debug.h" +#include "global_define.h" #include "eqemu_logsys.h" #include "crash.h" diff --git a/common/database.cpp b/common/database.cpp index 8beb3336b..91edc8b4a 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/rulesys.h" #include diff --git a/common/database.h b/common/database.h index 424a0dfa9..e6515c5f6 100644 --- a/common/database.h +++ b/common/database.h @@ -21,7 +21,7 @@ #define AUTHENTICATION_TIMEOUT 60 #define INVALID_ID 0xFFFFFFFF -#include "debug.h" +#include "global_define.h" #include "eqemu_logsys.h" #include "types.h" #include "dbcore.h" diff --git a/common/debug.h b/common/debug.h deleted file mode 100644 index 0c5d32ee9..000000000 --- a/common/debug.h +++ /dev/null @@ -1,41 +0,0 @@ -/* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2015 EQEMu Development Team (http://eqemu.org) - - 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 -*/ - -#if defined(_DEBUG) && defined(WIN32) - #ifndef _CRTDBG_MAP_ALLOC - #include - #include - #endif -#endif - -#ifndef EQDEBUG_H -#define EQDEBUG_H - -#define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues -#if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) ) - // Packet Collector on win32 requires winsock.h due to latest pcap.h - // winsock.h must come before windows.h - #include -#endif - -#ifdef _WINDOWS - #include - #include -#endif - -#endif diff --git a/common/emu_opcodes.cpp b/common/emu_opcodes.cpp index 49da5e140..00f45fa25 100644 --- a/common/emu_opcodes.cpp +++ b/common/emu_opcodes.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 04111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "emu_opcodes.h" const char *OpcodeNames[_maxEmuOpcode+1] = { diff --git a/common/emu_tcp_connection.cpp b/common/emu_tcp_connection.cpp index 805b4b333..2ca55b975 100644 --- a/common/emu_tcp_connection.cpp +++ b/common/emu_tcp_connection.cpp @@ -23,7 +23,7 @@ crap into its own subclass of this object, it will clean things up tremendously. */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include diff --git a/common/emu_tcp_server.cpp b/common/emu_tcp_server.cpp index 985be6edd..4509c399f 100644 --- a/common/emu_tcp_server.cpp +++ b/common/emu_tcp_server.cpp @@ -1,4 +1,4 @@ -#include "debug.h" +#include "global_define.h" #include "emu_tcp_server.h" #include "emu_tcp_connection.h" diff --git a/common/eq_packet.cpp b/common/eq_packet.cpp index 60d892c23..ffc3666cb 100644 --- a/common/eq_packet.cpp +++ b/common/eq_packet.cpp @@ -17,7 +17,7 @@ */ #include "crc16.h" -#include "debug.h" +#include "global_define.h" #include "eq_packet.h" #include "misc.h" #include "op_codes.h" diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 4d3fa5d46..0c5c6cacf 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "eqemu_logsys.h" #include "eq_packet.h" #include "eq_stream.h" diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 4a75068b6..a6a1d800a 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -1,4 +1,4 @@ -#include "debug.h" +#include "global_define.h" #include "eqemu_logsys.h" #include "eq_stream_factory.h" diff --git a/common/eq_stream_ident.cpp b/common/eq_stream_ident.cpp index b42bd4037..6fef4275e 100644 --- a/common/eq_stream_ident.cpp +++ b/common/eq_stream_ident.cpp @@ -1,4 +1,4 @@ -#include "debug.h" +#include "global_define.h" #include "eqemu_logsys.h" #include "eq_stream_ident.h" #include "eq_stream_proxy.h" diff --git a/common/eq_stream_proxy.cpp b/common/eq_stream_proxy.cpp index 20fc4ea06..6de6941ed 100644 --- a/common/eq_stream_proxy.cpp +++ b/common/eq_stream_proxy.cpp @@ -1,5 +1,5 @@ -#include "debug.h" +#include "global_define.h" #include "eq_stream_proxy.h" #include "eq_stream.h" #include "struct_strategy.h" diff --git a/common/eqdb.cpp b/common/eqdb.cpp index 03746b0d4..2c912afba 100644 --- a/common/eqdb.cpp +++ b/common/eqdb.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "eqdb.h" #include "database.h" #include diff --git a/common/eqdb_res.cpp b/common/eqdb_res.cpp index f34229a1f..11d90459d 100644 --- a/common/eqdb_res.cpp +++ b/common/eqdb_res.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "eqdb_res.h" #include diff --git a/common/eqemu_config.cpp b/common/eqemu_config.cpp index a2483c9b8..6e1400904 100644 --- a/common/eqemu_config.cpp +++ b/common/eqemu_config.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqemu_config.h" #include "misc_functions.h" diff --git a/common/eqtime.cpp b/common/eqtime.cpp index dcb3db359..adfd86923 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -17,7 +17,7 @@ */ #include -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/eqtime.h" #include "../common/eq_packet_structs.h" diff --git a/common/extprofile.cpp b/common/extprofile.cpp index 0ea3fb7a1..f29ec1e6e 100644 --- a/common/extprofile.cpp +++ b/common/extprofile.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "extprofile.h" //Set defaults in the extended profile... diff --git a/common/guilds.cpp b/common/guilds.cpp index 6098c2e1b..408f28714 100644 --- a/common/guilds.cpp +++ b/common/guilds.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "misc_functions.h" #include "guilds.h" #include "database.h" diff --git a/common/item.cpp b/common/item.cpp index df078491e..af0921ce0 100644 --- a/common/item.cpp +++ b/common/item.cpp @@ -17,7 +17,7 @@ */ #include "classes.h" -#include "debug.h" +#include "global_define.h" #include "item.h" #include "races.h" #include "rulesys.h" diff --git a/common/misc.cpp b/common/misc.cpp index 61ac556f5..792dfcbab 100644 --- a/common/misc.cpp +++ b/common/misc.cpp @@ -2,7 +2,7 @@ // VS6 doesn't like the length of STL generated names: disabling #pragma warning(disable:4786) #endif -#include "debug.h" +#include "global_define.h" #include #include #include diff --git a/common/misc_functions.cpp b/common/misc_functions.cpp index 18171c0a8..dcdbad561 100644 --- a/common/misc_functions.cpp +++ b/common/misc_functions.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "misc_functions.h" #include #include diff --git a/common/mutex.cpp b/common/mutex.cpp index 7bea92b0d..1dfacb5bb 100644 --- a/common/mutex.cpp +++ b/common/mutex.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/mutex.h" #include diff --git a/common/opcode_map.cpp b/common/opcode_map.cpp index fdaaf3fa1..7c8fed281 100644 --- a/common/opcode_map.cpp +++ b/common/opcode_map.cpp @@ -1,4 +1,4 @@ -#include "debug.h" +#include "global_define.h" #include #include diff --git a/common/packet_dump_file.cpp b/common/packet_dump_file.cpp index 95a72bb60..514ea610b 100644 --- a/common/packet_dump_file.cpp +++ b/common/packet_dump_file.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include diff --git a/common/packet_functions.cpp b/common/packet_functions.cpp index 5860f9cc8..dbd10f14f 100644 --- a/common/packet_functions.cpp +++ b/common/packet_functions.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/common/patches/patches.cpp b/common/patches/patches.cpp index b993b57dd..55c0d4e8b 100644 --- a/common/patches/patches.cpp +++ b/common/patches/patches.cpp @@ -1,5 +1,5 @@ -#include "../debug.h" +#include "../global_define.h" #include "patches.h" #include "titanium.h" diff --git a/common/patches/rof.cpp b/common/patches/rof.cpp index c0d6b4ddf..6a575ca13 100644 --- a/common/patches/rof.cpp +++ b/common/patches/rof.cpp @@ -1,4 +1,4 @@ -#include "../debug.h" +#include "../global_define.h" #include "../eqemu_logsys.h" #include "rof.h" #include "../opcodemgr.h" diff --git a/common/patches/rof2.cpp b/common/patches/rof2.cpp index bd2245dc3..0c61145d0 100644 --- a/common/patches/rof2.cpp +++ b/common/patches/rof2.cpp @@ -1,4 +1,4 @@ -#include "../debug.h" +#include "../global_define.h" #include "../eqemu_logsys.h" #include "rof2.h" #include "../opcodemgr.h" diff --git a/common/patches/sod.cpp b/common/patches/sod.cpp index 9f318674b..eb53b333d 100644 --- a/common/patches/sod.cpp +++ b/common/patches/sod.cpp @@ -1,4 +1,4 @@ -#include "../debug.h" +#include "../global_define.h" #include "../eqemu_logsys.h" #include "sod.h" #include "../opcodemgr.h" diff --git a/common/patches/sof.cpp b/common/patches/sof.cpp index 4337d712e..4d3c61da7 100644 --- a/common/patches/sof.cpp +++ b/common/patches/sof.cpp @@ -1,4 +1,4 @@ -#include "../debug.h" +#include "../global_define.h" #include "../eqemu_logsys.h" #include "sof.h" #include "../opcodemgr.h" diff --git a/common/patches/titanium.cpp b/common/patches/titanium.cpp index 852baa089..21701de7e 100644 --- a/common/patches/titanium.cpp +++ b/common/patches/titanium.cpp @@ -1,4 +1,4 @@ -#include "../debug.h" +#include "../global_define.h" #include "../eqemu_logsys.h" #include "titanium.h" #include "../opcodemgr.h" diff --git a/common/patches/underfoot.cpp b/common/patches/underfoot.cpp index 12f7a3354..d0ae81fb5 100644 --- a/common/patches/underfoot.cpp +++ b/common/patches/underfoot.cpp @@ -1,4 +1,4 @@ -#include "../debug.h" +#include "../global_define.h" #include "../eqemu_logsys.h" #include "underfoot.h" #include "../opcodemgr.h" diff --git a/common/perl_eqdb.cpp b/common/perl_eqdb.cpp index 8e7fb1138..2cd9fa38d 100644 --- a/common/perl_eqdb.cpp +++ b/common/perl_eqdb.cpp @@ -28,7 +28,7 @@ typedef const char Const_char; #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/useperl.h" #include "eqdb.h" diff --git a/common/perl_eqdb_res.cpp b/common/perl_eqdb_res.cpp index b4f22affb..2782a6f05 100644 --- a/common/perl_eqdb_res.cpp +++ b/common/perl_eqdb_res.cpp @@ -28,7 +28,7 @@ typedef const char Const_char; #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/useperl.h" #include "eqdb_res.h" diff --git a/common/proc_launcher.cpp b/common/proc_launcher.cpp index 36f58de86..d44cc9c46 100644 --- a/common/proc_launcher.cpp +++ b/common/proc_launcher.cpp @@ -19,7 +19,7 @@ #include #include -#include "debug.h" +#include "global_define.h" #include "types.h" #include "proc_launcher.h" #ifdef _WINDOWS diff --git a/common/proc_launcher.h b/common/proc_launcher.h index 64133481e..6289579cd 100644 --- a/common/proc_launcher.h +++ b/common/proc_launcher.h @@ -18,7 +18,7 @@ #ifndef PROCLAUNCHER_H_ #define PROCLAUNCHER_H_ -#include "debug.h" +#include "global_define.h" #include #include diff --git a/common/ptimer.cpp b/common/ptimer.cpp index 76bc41419..b41a45677 100644 --- a/common/ptimer.cpp +++ b/common/ptimer.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "timer.h" #include "ptimer.h" diff --git a/common/struct_strategy.cpp b/common/struct_strategy.cpp index 7c57b0d4d..49f422177 100644 --- a/common/struct_strategy.cpp +++ b/common/struct_strategy.cpp @@ -1,5 +1,5 @@ -#include "debug.h" +#include "global_define.h" #include "eqemu_logsys.h" #include "struct_strategy.h" diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 58ea11822..f558d0596 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include diff --git a/common/tcp_server.cpp b/common/tcp_server.cpp index cfde2f24e..0f9b0445c 100644 --- a/common/tcp_server.cpp +++ b/common/tcp_server.cpp @@ -1,4 +1,4 @@ -#include "debug.h" +#include "global_define.h" #include "tcp_server.h" #include "../common/eqemu_logsys.h" diff --git a/common/timeoutmgr.cpp b/common/timeoutmgr.cpp index b7be6ee98..998195cb3 100644 --- a/common/timeoutmgr.cpp +++ b/common/timeoutmgr.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" //#define TIMEOUT_DEBUG diff --git a/common/timer.h b/common/timer.h index c4d89fe11..4b2719dc6 100644 --- a/common/timer.h +++ b/common/timer.h @@ -22,7 +22,7 @@ // Disgrace: for windows compile #ifdef _WINDOWS - #include "debug.h" + #include "global_define.h" int gettimeofday (timeval *tp, ...); #endif diff --git a/common/worldconn.cpp b/common/worldconn.cpp index 81b281174..e85d24a75 100644 --- a/common/worldconn.cpp +++ b/common/worldconn.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include diff --git a/common/xml_parser.cpp b/common/xml_parser.cpp index 7f84e0d47..f252ce177 100644 --- a/common/xml_parser.cpp +++ b/common/xml_parser.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "debug.h" +#include "global_define.h" #include "xml_parser.h" XMLParser::XMLParser() { diff --git a/common/xml_parser.h b/common/xml_parser.h index f96cbb044..38ed6d254 100644 --- a/common/xml_parser.h +++ b/common/xml_parser.h @@ -18,7 +18,7 @@ #ifndef XMLParser_H #define XMLParser_H -#include "debug.h" +#include "global_define.h" #include "tinyxml/tinyxml.h" #include "../common/types.h" diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index 6af623b5f..db737e9a5 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/proc_launcher.h" #include "../common/eqemu_config.h" diff --git a/eqlaunch/worldserver.cpp b/eqlaunch/worldserver.cpp index b9c7d6b91..a4b27a983 100644 --- a/eqlaunch/worldserver.cpp +++ b/eqlaunch/worldserver.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/servertalk.h" #include "../common/eqemu_config.h" diff --git a/eqlaunch/zone_launch.cpp b/eqlaunch/zone_launch.cpp index 7e211fb88..8c1e62223 100644 --- a/eqlaunch/zone_launch.cpp +++ b/eqlaunch/zone_launch.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/eqemu_config.h" #include "zone_launch.h" diff --git a/queryserv/database.cpp b/queryserv/database.cpp index b6c44f573..585417e37 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -18,7 +18,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include #include diff --git a/queryserv/database.h b/queryserv/database.h index a25d91611..adcb8c811 100644 --- a/queryserv/database.h +++ b/queryserv/database.h @@ -23,7 +23,7 @@ #define AUTHENTICATION_TIMEOUT 60 #define INVALID_ID 0xFFFFFFFF -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/types.h" #include "../common/dbcore.h" #include "../common/linked_list.h" diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index b67d8ad4f..e227f515f 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/opcodemgr.h" #include "../common/eq_stream_factory.h" diff --git a/queryserv/queryservconfig.cpp b/queryserv/queryservconfig.cpp index 0c44a7c87..716ae0618 100644 --- a/queryserv/queryservconfig.cpp +++ b/queryserv/queryservconfig.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "queryservconfig.h" queryservconfig *queryservconfig::_chat_config = nullptr; diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index 32e8756ef..2d2f288a4 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/md5.h" #include "../common/packet_dump.h" diff --git a/shared_memory/base_data.cpp b/shared_memory/base_data.cpp index c473101da..086256cda 100644 --- a/shared_memory/base_data.cpp +++ b/shared_memory/base_data.cpp @@ -17,7 +17,7 @@ */ #include "base_data.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" diff --git a/shared_memory/items.cpp b/shared_memory/items.cpp index 432458701..48b81b6fc 100644 --- a/shared_memory/items.cpp +++ b/shared_memory/items.cpp @@ -17,7 +17,7 @@ */ #include "items.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" diff --git a/shared_memory/loot.cpp b/shared_memory/loot.cpp index 81c0ef5a5..66982c05a 100644 --- a/shared_memory/loot.cpp +++ b/shared_memory/loot.cpp @@ -17,7 +17,7 @@ */ #include "loot.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index ddc42cbc3..345616e8f 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -19,7 +19,7 @@ #include #include "../common/eqemu_logsys.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/eqemu_config.h" #include "../common/platform.h" diff --git a/shared_memory/npc_faction.cpp b/shared_memory/npc_faction.cpp index 8a9575497..df33b7368 100644 --- a/shared_memory/npc_faction.cpp +++ b/shared_memory/npc_faction.cpp @@ -17,7 +17,7 @@ */ #include "npc_faction.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" diff --git a/shared_memory/skill_caps.cpp b/shared_memory/skill_caps.cpp index c8cc0838b..94205ce72 100644 --- a/shared_memory/skill_caps.cpp +++ b/shared_memory/skill_caps.cpp @@ -17,7 +17,7 @@ */ #include "skill_caps.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" diff --git a/shared_memory/spells.cpp b/shared_memory/spells.cpp index eb8f34777..444f3b466 100644 --- a/shared_memory/spells.cpp +++ b/shared_memory/spells.cpp @@ -17,7 +17,7 @@ */ #include "spells.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/shareddb.h" #include "../common/ipc_mutex.h" #include "../common/memory_mapped_file.h" diff --git a/ucs/clientlist.cpp b/ucs/clientlist.cpp index a518aa1a8..a643cdfa9 100644 --- a/ucs/clientlist.cpp +++ b/ucs/clientlist.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/string_util.h" #include "../common/eqemu_logsys.h" diff --git a/ucs/database.cpp b/ucs/database.cpp index dee5072fb..8b9d3f687 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -18,7 +18,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include #include diff --git a/ucs/database.h b/ucs/database.h index 382f71a43..fc9b96d19 100644 --- a/ucs/database.h +++ b/ucs/database.h @@ -23,7 +23,7 @@ #define AUTHENTICATION_TIMEOUT 60 #define INVALID_ID 0xFFFFFFFF -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/types.h" #include "../common/dbcore.h" #include "../common/linked_list.h" diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 1bbb66c16..fd9688def 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -18,7 +18,7 @@ */ #include "../common/eqemu_logsys.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "clientlist.h" #include "../common/opcodemgr.h" #include "../common/eq_stream_factory.h" diff --git a/ucs/ucsconfig.cpp b/ucs/ucsconfig.cpp index 4f055a6af..dd8c73ab8 100644 --- a/ucs/ucsconfig.cpp +++ b/ucs/ucsconfig.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "ucsconfig.h" ucsconfig *ucsconfig::_chat_config = nullptr; diff --git a/ucs/worldserver.cpp b/ucs/worldserver.cpp index 67bc81987..395d72e59 100644 --- a/ucs/worldserver.cpp +++ b/ucs/worldserver.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include #include diff --git a/world/adventure.cpp b/world/adventure.cpp index 83b98813d..6c08204a7 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/servertalk.h" #include "../common/extprofile.h" #include "../common/rulesys.h" diff --git a/world/adventure.h b/world/adventure.h index dec691eda..23255a5b5 100644 --- a/world/adventure.h +++ b/world/adventure.h @@ -1,7 +1,7 @@ #ifndef ADVENTURE_H #define ADVENTURE_H -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/types.h" #include "../common/timer.h" #include "adventure_template.h" diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 3f671ee97..47522ccec 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/misc_functions.h" #include "../common/string_util.h" #include "../common/servertalk.h" diff --git a/world/adventure_manager.h b/world/adventure_manager.h index ce6d7331a..5c9a4e560 100644 --- a/world/adventure_manager.h +++ b/world/adventure_manager.h @@ -1,7 +1,7 @@ #ifndef ADVENTURE_MANAGER_H #define ADVENTURE_MANAGER_H -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/types.h" #include "../common/timer.h" #include "adventure.h" diff --git a/world/adventure_template.h b/world/adventure_template.h index 86fc3d0f5..89f8b9915 100644 --- a/world/adventure_template.h +++ b/world/adventure_template.h @@ -1,7 +1,7 @@ #ifndef ADVENTURE_TEMPLATE_H #define ADVENTURE_TEMPLATE_H -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/types.h" #pragma pack(1) diff --git a/world/client.cpp b/world/client.cpp index 9b92b668e..b6f3e3153 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eq_packet.h" #include "../common/eq_stream_intf.h" #include "../common/misc.h" diff --git a/world/cliententry.cpp b/world/cliententry.cpp index 93adbc931..034b7ef9a 100644 --- a/world/cliententry.cpp +++ b/world/cliententry.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "cliententry.h" #include "clientlist.h" #include "login_server.h" diff --git a/world/clientlist.cpp b/world/clientlist.cpp index 53f989538..b6b22a6d4 100644 --- a/world/clientlist.cpp +++ b/world/clientlist.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "clientlist.h" #include "zoneserver.h" #include "zonelist.h" diff --git a/world/console.cpp b/world/console.cpp index fbf9415bd..2194bfed4 100644 --- a/world/console.cpp +++ b/world/console.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 85f98713d..d8b60d209 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "eql_config.h" #include "worlddb.h" #include "launcher_link.h" diff --git a/world/eqw.cpp b/world/eqw.cpp index 7ff709ec6..04d5d4c8b 100644 --- a/world/eqw.cpp +++ b/world/eqw.cpp @@ -18,7 +18,7 @@ #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqw.h" #include "eqw_parser.h" #include "world_config.h" diff --git a/world/eqw_http_handler.cpp b/world/eqw_http_handler.cpp index 36fdf714c..c30620747 100644 --- a/world/eqw_http_handler.cpp +++ b/world/eqw_http_handler.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqw_http_handler.h" #include "../common/SocketLib/Base64.h" #include "eqw_parser.h" diff --git a/world/eqw_parser.cpp b/world/eqw_parser.cpp index e7b72bf38..79e73ac22 100644 --- a/world/eqw_parser.cpp +++ b/world/eqw_parser.cpp @@ -20,7 +20,7 @@ #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqw_parser.h" #include "eqw.h" #include "../common/eqdb.h" diff --git a/world/http_request.cpp b/world/http_request.cpp index fa7bc78f1..af4b6c9b2 100644 --- a/world/http_request.cpp +++ b/world/http_request.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "http_request.h" #include "eqw_http_handler.h" #include "../common/eqdb.h" diff --git a/world/launcher_link.cpp b/world/launcher_link.cpp index 9e8db6ea1..bd8bfdc4b 100644 --- a/world/launcher_link.cpp +++ b/world/launcher_link.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "launcher_link.h" #include "launcher_list.h" #include "world_config.h" diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 01f64bfec..62657175a 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -17,7 +17,7 @@ */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "launcher_list.h" #include "launcher_link.h" diff --git a/world/login_server.cpp b/world/login_server.cpp index f411e7a72..450ecb0a3 100644 --- a/world/login_server.cpp +++ b/world/login_server.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/world/login_server_list.cpp b/world/login_server_list.cpp index e76b38b71..6104f4f0a 100644 --- a/world/login_server_list.cpp +++ b/world/login_server_list.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/world/net.cpp b/world/net.cpp index 529643d08..a4e560477 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include @@ -24,7 +24,7 @@ #include -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/queue.h" #include "../common/timer.h" diff --git a/world/perl_eql_config.cpp b/world/perl_eql_config.cpp index 19ea7c9f6..7cd7d0e2a 100644 --- a/world/perl_eql_config.cpp +++ b/world/perl_eql_config.cpp @@ -28,7 +28,7 @@ typedef const char Const_char; #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqw_parser.h" #include "eql_config.h" diff --git a/world/perl_eqw.cpp b/world/perl_eqw.cpp index 0a564164d..675eac26c 100644 --- a/world/perl_eqw.cpp +++ b/world/perl_eqw.cpp @@ -28,7 +28,7 @@ typedef const char Const_char; #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqw_parser.h" #include "eqw.h" diff --git a/world/perl_http_request.cpp b/world/perl_http_request.cpp index 12d70002c..cdd7e60f1 100644 --- a/world/perl_http_request.cpp +++ b/world/perl_http_request.cpp @@ -28,7 +28,7 @@ typedef const char Const_char; #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "eqw_parser.h" #include "http_request.h" diff --git a/world/queryserv.cpp b/world/queryserv.cpp index 171dcaa13..bf1af1e2e 100644 --- a/world/queryserv.cpp +++ b/world/queryserv.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "queryserv.h" #include "world_config.h" diff --git a/world/ucs.cpp b/world/ucs.cpp index 4f9827a36..e15007959 100644 --- a/world/ucs.cpp +++ b/world/ucs.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "ucs.h" #include "world_config.h" diff --git a/world/wguild_mgr.cpp b/world/wguild_mgr.cpp index 1b7f8739e..b2750ded2 100644 --- a/world/wguild_mgr.cpp +++ b/world/wguild_mgr.cpp @@ -17,7 +17,7 @@ */ #include "../common/eqemu_logsys.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "wguild_mgr.h" #include "../common/servertalk.h" #include "clientlist.h" diff --git a/world/world_config.cpp b/world/world_config.cpp index 2f9464e13..f57368a10 100644 --- a/world/world_config.cpp +++ b/world/world_config.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "world_config.h" WorldConfig *WorldConfig::_world_config = nullptr; diff --git a/world/zonelist.cpp b/world/zonelist.cpp index 52879cafa..22d783f5d 100644 --- a/world/zonelist.cpp +++ b/world/zonelist.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "zonelist.h" #include "zoneserver.h" #include "world_tcp_connection.h" diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index de3f34435..d8909dbd8 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "zoneserver.h" #include "clientlist.h" #include "login_server.h" diff --git a/zone/aa.cpp b/zone/aa.cpp index 5b3b82732..b6a1917b9 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -17,7 +17,7 @@ Copyright (C) 2001-2004 EQEMu Development Team (http://eqemulator.net) */ #include "../common/classes.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/eq_packet_structs.h" #include "../common/races.h" diff --git a/zone/aggro.cpp b/zone/aggro.cpp index d0b688e29..d49702146 100644 --- a/zone/aggro.cpp +++ b/zone/aggro.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/faction.h" #include "../common/rulesys.h" diff --git a/zone/attack.cpp b/zone/attack.cpp index ce97ae524..d304bf7b3 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eq_constants.h" #include "../common/eq_packet_structs.h" #include "../common/rulesys.h" diff --git a/zone/bonuses.cpp b/zone/bonuses.cpp index fcb7f0ef9..9af1d623d 100644 --- a/zone/bonuses.cpp +++ b/zone/bonuses.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "../common/classes.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/item.h" #include "../common/rulesys.h" #include "../common/skills.h" diff --git a/zone/bot.h b/zone/bot.h index 40b505c84..42e041861 100644 --- a/zone/bot.h +++ b/zone/bot.h @@ -12,7 +12,7 @@ #include "zonedb.h" #include "string_ids.h" #include "../common/misc_functions.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "guild_mgr.h" #include "worldserver.h" diff --git a/zone/client.cpp b/zone/client.cpp index c0f9ff64b..50ac4655c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index fc49e1526..0bd54308f 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/rulesys.h" diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 20f58cc12..6ecfae636 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -15,7 +15,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/opcodemgr.h" #include diff --git a/zone/client_process.cpp b/zone/client_process.cpp index 483dceac1..c60c17298 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -20,7 +20,7 @@ */ #include "../common/eqemu_logsys.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/zone/command.cpp b/zone/command.cpp index fe8d3d9fd..47f5517ab 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -42,7 +42,7 @@ #define strcasecmp _stricmp #endif -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eq_packet.h" #include "../common/features.h" #include "../common/guilds.h" diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 81d77651f..b42906d20 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -28,7 +28,7 @@ Child of the Mob class. #define strcasecmp _stricmp #endif -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/rulesys.h" #include "../common/string_util.h" diff --git a/zone/doors.cpp b/zone/doors.cpp index 227c8c7af..76ecb53fc 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/string_util.h" diff --git a/zone/effects.cpp b/zone/effects.cpp index 8ec921ae3..ba5b42f1c 100644 --- a/zone/effects.cpp +++ b/zone/effects.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/spdat.h" diff --git a/zone/embparser.cpp b/zone/embparser.cpp index e18dcfd39..72b15e118 100644 --- a/zone/embparser.cpp +++ b/zone/embparser.cpp @@ -18,7 +18,7 @@ #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/seperator.h" #include "../common/misc_functions.h" #include "../common/string_util.h" diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 99698fe72..e5188eae3 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -21,7 +21,7 @@ #ifdef EMBPERL #ifdef EMBPERL_XS -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/misc_functions.h" #include "embparser.h" diff --git a/zone/embperl.cpp b/zone/embperl.cpp index 167e92711..4d27d1269 100644 --- a/zone/embperl.cpp +++ b/zone/embperl.cpp @@ -10,7 +10,7 @@ Eglin #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include #include diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 5e387022e..4c0e8211c 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -17,7 +17,7 @@ */ #ifdef EMBPERL -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "masterentity.h" #include "command.h" diff --git a/zone/entity.cpp b/zone/entity.cpp index ec2be21f5..2ded575c0 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/zone/exp.cpp b/zone/exp.cpp index 53f015b8a..7eb2189df 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/features.h" #include "../common/rulesys.h" #include "../common/string_util.h" diff --git a/zone/forage.cpp b/zone/forage.cpp index 427f28b10..db348cf8c 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/misc_functions.h" #include "../common/rulesys.h" diff --git a/zone/groups.cpp b/zone/groups.cpp index d1a310c92..6fbd08c15 100644 --- a/zone/groups.cpp +++ b/zone/groups.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "masterentity.h" #include "npc_ai.h" diff --git a/zone/horse.cpp b/zone/horse.cpp index cfc0174d2..91e452dc2 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/linked_list.h" #include "../common/string_util.h" diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 56ad5e904..ab753f1e4 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/string_util.h" diff --git a/zone/loottables.cpp b/zone/loottables.cpp index 16f5af7b0..39caafcea 100644 --- a/zone/loottables.cpp +++ b/zone/loottables.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/loottable.h" #include "../common/misc_functions.h" diff --git a/zone/map.cpp b/zone/map.cpp index 5c917b955..941292acd 100644 --- a/zone/map.cpp +++ b/zone/map.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/misc_functions.h" #include "map.h" diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index a77335016..67b8d4480 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/features.h" #include "../common/rulesys.h" #include "../common/string_util.h" diff --git a/zone/net.cpp b/zone/net.cpp index 078f9cdd7..579f9d342 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -19,7 +19,7 @@ #define DONT_SHARED_OPCODES #define PLATFORM_ZONE 1 -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/features.h" #include "../common/queue.h" #include "../common/timer.h" diff --git a/zone/npc.cpp b/zone/npc.cpp index 4700159ec..4b749adba 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -18,7 +18,7 @@ #include "../common/bodytypes.h" #include "../common/classes.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/misc_functions.h" #include "../common/rulesys.h" #include "../common/seperator.h" diff --git a/zone/object.cpp b/zone/object.cpp index baa084699..09988481e 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/string_util.h" #include "client.h" diff --git a/zone/pathing.cpp b/zone/pathing.cpp index 6afa63546..86d1e23a2 100644 --- a/zone/pathing.cpp +++ b/zone/pathing.cpp @@ -1,4 +1,4 @@ -#include "../common/debug.h" +#include "../common/global_define.h" #include "client.h" #include "doors.h" diff --git a/zone/perl_client.cpp b/zone/perl_client.cpp index 685a39091..e47e17cfd 100644 --- a/zone/perl_client.cpp +++ b/zone/perl_client.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_doors.cpp b/zone/perl_doors.cpp index 77ad1902b..c8f6ad221 100644 --- a/zone/perl_doors.cpp +++ b/zone/perl_doors.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_entity.cpp b/zone/perl_entity.cpp index 3d685e011..9b8718086 100644 --- a/zone/perl_entity.cpp +++ b/zone/perl_entity.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include #include "embperl.h" diff --git a/zone/perl_groups.cpp b/zone/perl_groups.cpp index 9db01353b..6960d14df 100644 --- a/zone/perl_groups.cpp +++ b/zone/perl_groups.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_hateentry.cpp b/zone/perl_hateentry.cpp index 6e8b2de9e..7c346a748 100644 --- a/zone/perl_hateentry.cpp +++ b/zone/perl_hateentry.cpp @@ -19,7 +19,7 @@ #include "../common/features.h" #include "client.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_mob.cpp b/zone/perl_mob.cpp index af07cfcdf..ac76beafe 100644 --- a/zone/perl_mob.cpp +++ b/zone/perl_mob.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_npc.cpp b/zone/perl_npc.cpp index 279b64330..c334ddb1b 100644 --- a/zone/perl_npc.cpp +++ b/zone/perl_npc.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_object.cpp b/zone/perl_object.cpp index 036d555a1..be52fef1d 100644 --- a/zone/perl_object.cpp +++ b/zone/perl_object.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_perlpacket.cpp b/zone/perl_perlpacket.cpp index 4a9c70464..f23cf36d7 100644 --- a/zone/perl_perlpacket.cpp +++ b/zone/perl_perlpacket.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/types.h" #include "embperl.h" diff --git a/zone/perl_player_corpse.cpp b/zone/perl_player_corpse.cpp index 675ee9697..a417284c8 100644 --- a/zone/perl_player_corpse.cpp +++ b/zone/perl_player_corpse.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_questitem.cpp b/zone/perl_questitem.cpp index 4c93d8839..158ee64a4 100644 --- a/zone/perl_questitem.cpp +++ b/zone/perl_questitem.cpp @@ -19,7 +19,7 @@ #include "../common/features.h" #include "client.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perl_raids.cpp b/zone/perl_raids.cpp index be3aea356..60d94600a 100644 --- a/zone/perl_raids.cpp +++ b/zone/perl_raids.cpp @@ -27,7 +27,7 @@ #include "../common/features.h" #ifdef EMBPERL_XS_CLASSES -#include "../common/debug.h" +#include "../common/global_define.h" #include "embperl.h" #ifdef seed diff --git a/zone/perlpacket.cpp b/zone/perlpacket.cpp index 1475ff448..ed0dd9cd3 100644 --- a/zone/perlpacket.cpp +++ b/zone/perlpacket.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include "perlpacket.h" #include "client.h" diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 2d2173e26..4af99a946 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -15,7 +15,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include #ifdef _WINDOWS diff --git a/zone/pets.cpp b/zone/pets.cpp index 1171194e3..829f8b020 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/spdat.h" #include "../common/string_util.h" #include "../common/types.h" diff --git a/zone/queryserv.cpp b/zone/queryserv.cpp index 1186aa241..d67ca46c7 100644 --- a/zone/queryserv.cpp +++ b/zone/queryserv.cpp @@ -16,7 +16,7 @@ Copyright (C) 2001-2014 EQEMu Development Team (http://eqemulator.net) Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/servertalk.h" #include "../common/string_util.h" #include "queryserv.h" diff --git a/zone/quest_parser_collection.cpp b/zone/quest_parser_collection.cpp index d3bde0d5b..bb3c55f3f 100644 --- a/zone/quest_parser_collection.cpp +++ b/zone/quest_parser_collection.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/misc_functions.h" #include "../common/features.h" diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index d9eb291dc..f99aff8bc 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -17,7 +17,7 @@ */ #include "../common/classes.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/rulesys.h" #include "../common/skills.h" #include "../common/spdat.h" diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 0f8b3330d..dfaa90278 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/string_util.h" #include "client.h" diff --git a/zone/spawngroup.cpp b/zone/spawngroup.cpp index bae4832c0..1661e0fe8 100644 --- a/zone/spawngroup.cpp +++ b/zone/spawngroup.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/string_util.h" #include "../common/types.h" diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index b45f7da70..65f318c46 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -19,7 +19,7 @@ #include "../common/eqemu_logsys.h" #include "../common/bodytypes.h" #include "../common/classes.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/item.h" #include "../common/rulesys.h" #include "../common/skills.h" diff --git a/zone/spells.cpp b/zone/spells.cpp index a9bc59f15..c9d21201e 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -68,7 +68,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org) #include "../common/bodytypes.h" #include "../common/classes.h" -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/item.h" #include "../common/rulesys.h" diff --git a/zone/tasks.cpp b/zone/tasks.cpp index e20e71f4c..37255179b 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -17,7 +17,7 @@ Copyright (C) 2001-2008 EQEMu Development Team (http://eqemulator.net) Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "tasks.h" #include diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index d923af5c6..0e012d087 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include diff --git a/zone/trading.cpp b/zone/trading.cpp index 0fd36ad37..e2824cb62 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/rulesys.h" #include "../common/string_util.h" diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 7fbd52e1d..6b104c5f2 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eq_packet_structs.h" #include "../common/features.h" diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 95f655cbb..95c76d66b 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -15,7 +15,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #ifdef _EQDEBUG #include #endif diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index d08384515..f305133dd 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include #include #include diff --git a/zone/zone.cpp b/zone/zone.cpp index ecfdb4cef..49595914f 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -30,7 +30,7 @@ #include "../common/unix.h" #endif -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/features.h" #include "../common/rulesys.h" #include "../common/seperator.h" diff --git a/zone/zoning.cpp b/zone/zoning.cpp index 53235176b..18eca56cb 100644 --- a/zone/zoning.cpp +++ b/zone/zoning.cpp @@ -16,7 +16,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/rulesys.h" #include "../common/string_util.h" From f9ba4739f5f0062cefaf16736f4da4eab254ca82 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 04:12:30 -0600 Subject: [PATCH 221/707] add global_define.h --- common/global_define.h | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 common/global_define.h diff --git a/common/global_define.h b/common/global_define.h new file mode 100644 index 000000000..0c5d32ee9 --- /dev/null +++ b/common/global_define.h @@ -0,0 +1,41 @@ +/* EQEMu: Everquest Server Emulator + Copyright (C) 2001-2015 EQEMu Development Team (http://eqemu.org) + + 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 +*/ + +#if defined(_DEBUG) && defined(WIN32) + #ifndef _CRTDBG_MAP_ALLOC + #include + #include + #endif +#endif + +#ifndef EQDEBUG_H +#define EQDEBUG_H + +#define _WINSOCKAPI_ //stupid windows, trying to fix the winsock2 vs. winsock issues +#if defined(WIN32) && ( defined(PACKETCOLLECTOR) || defined(COLLECTOR) ) + // Packet Collector on win32 requires winsock.h due to latest pcap.h + // winsock.h must come before windows.h + #include +#endif + +#ifdef _WINDOWS + #include + #include +#endif + +#endif From 56a4459aa8aae6fe4f401e5f3b2d9f31686c843c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 04:27:22 -0600 Subject: [PATCH 222/707] More stuff --- common/eqemu_logsys.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 2ac824624..26a80392f 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -114,8 +114,7 @@ namespace Logs{ "WebInterface Server", "World Server", "Zone Server", - }; - + }; } class EQEmuLogSys { @@ -129,7 +128,6 @@ public: void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...); void SetCurrentTimeStamp(char* time_stamp); void StartFileLogs(const std::string log_name); - uint16 GetConsoleColorFromCategory(uint16 log_category); struct LogSettings{ uint8 log_to_file; @@ -145,9 +143,11 @@ public: private: bool zone_general_init = false; + std::function on_log_gmsay_hook; - std::string FormatOutMessageString(uint16 log_category, std::string in_message); + + uint16 GetConsoleColorFromCategory(uint16 log_category); void ProcessConsoleMessage(uint16 log_category, const std::string message); void ProcessGMSay(uint16 log_category, std::string message); From 53dce15822df32877a8d4b109b8f1836c98020c9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:24:38 -0600 Subject: [PATCH 223/707] Remove Duplicative MySQL Error: Error in ExportSpells query '%s' %s --- client_files/export/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index c60b7266c..b4bf14e75 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -91,7 +91,6 @@ void ExportSpells(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.Out(Logs::General, Logs::Error, "Error in ExportSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); From ed09893a0e1befd1fb63ac328dfedae8f892125e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:24:48 -0600 Subject: [PATCH 224/707] Remove Duplicative MySQL Error: Error in skill_usable query '%s' %s --- client_files/export/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index b4bf14e75..1758db707 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -104,7 +104,6 @@ bool SkillUsable(SharedDatabase *db, int skill_id, int class_id) { class_id, skill_id); auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in skill_usable query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 792cf68a1c25d97a2e2951c63ff5201dea01e46e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:24:54 -0600 Subject: [PATCH 225/707] Remove Duplicative MySQL Error: Error in get_skill query '%s' %s --- client_files/export/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 1758db707..db2163d87 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -123,7 +123,6 @@ int GetSkill(SharedDatabase *db, int skill_id, int class_id, int level) { class_id, skill_id, level); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in get_skill query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 5604230b5559fbeba51d73f218c15212d169a1bc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:24:59 -0600 Subject: [PATCH 226/707] Remove Duplicative MySQL Error: Error in ExportBaseData query '%s' %s --- client_files/export/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index db2163d87..14fe0fc60 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -189,7 +189,6 @@ void ExportBaseData(SharedDatabase *db) { fprintf(f, "%s\n", line.c_str()); } } else { - Log.Out(Logs::General, Logs::Error, "Error in ExportBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); } fclose(f); From 2e8d9ed6a12a54adceb527e710aaf419ad9f7beb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:05 -0600 Subject: [PATCH 227/707] Remove Duplicative MySQL Error: Error in GetSpellColumns query '%s' %s --- client_files/import/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 3d6511d8f..67cc28373 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -65,7 +65,6 @@ int GetSpellColumns(SharedDatabase *db) { const std::string query = "DESCRIBE spells_new"; auto results = db->QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetSpellColumns query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 32901297e108d42ecb1253713392d7450892b563 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:05 -0600 Subject: [PATCH 228/707] Remove Duplicative MySQL Error: StoreCharacter inventory failed. Query '%s' %s --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 91edc8b4a..0ce40425c 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -736,7 +736,6 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven auto results = QueryDatabase(invquery); if (!results.RowsAffected()) - Log.Out(Logs::General, Logs::Error, "StoreCharacter inventory failed. Query '%s' %s", invquery.c_str(), results.ErrorMessage().c_str()); #if EQDEBUG >= 9 else Log.Out(Logs::General, Logs::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); From 3c02cc454df7df5bf86909f1684779b6b07f6bf2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:05 -0600 Subject: [PATCH 229/707] Remove Duplicative MySQL Error: Error loading guilds '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index a9ad6cce0..48d40d369 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -57,7 +57,6 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error loading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 3f8926d3166c623cb50eb8f965e4d222029dd142 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:05 -0600 Subject: [PATCH 230/707] Remove Duplicative MySQL Error: Error in LoadRules query %s: %s --- common/rulesys.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 8f0c908a1..fb6d94dcc 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -282,7 +282,6 @@ bool RuleManager::LoadRules(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 34c60221019bfab49550786daa86b85b84c868a1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:05 -0600 Subject: [PATCH 231/707] Remove Duplicative MySQL Error: Error runing inventory verification query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 785888ff5..5f77094a2 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -124,7 +124,6 @@ bool SharedDatabase::VerifyInventory(uint32 account_id, int16 slot_id, const Ite account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error runing inventory verification query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); //returning true is less harmful in the face of a query error return true; } From 84945431644d81bf18702f00761a3c2bbc1e0d21 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 232/707] Remove Duplicative MySQL Error: Failed to load LFGuild info from database. %s %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index dbfb4e314..68e9235d9 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -40,7 +40,6 @@ bool LFGuildManager::LoadDatabase() "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::QS_Server, "Failed to load LFGuild info from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 408baba7aa166ababe29b040cd96cf16f12979a8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 233/707] Remove Duplicative MySQL Error: FindCharacter failed. %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 8b9d3f687..5a3a7267c 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -206,7 +206,6 @@ int Database::FindCharacter(const char *characterName) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name`='%s' LIMIT 1", safeCharName); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "FindCharacter failed. %s %s", query.c_str(), results.ErrorMessage().c_str()); safe_delete(safeCharName); return -1; } From 5bf3d40570ed8b445b3d39a40849a7128ca41276 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 234/707] Remove Duplicative MySQL Error: Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s) --- world/adventure.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/adventure.cpp b/world/adventure.cpp index 6c08204a7..b2554c1f2 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -386,7 +386,6 @@ void Adventure::MoveCorpsesToGraveyard() std::string query = StringFormat("SELECT id, charid FROM character_corpses WHERE instanceid=%d", GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); for(auto row = results.begin(); row != results.end(); ++row) { dbid_list.push_back(atoi(row[0])); From b6b9e388b38b112d41d627518778989d90cabcc8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 235/707] Remove Duplicative MySQL Error: Error in AdventureManager:::LoadAdventures: %s (%s) --- world/adventure_manager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 47522ccec..cb3930bf6 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -652,7 +652,6 @@ bool AdventureManager::LoadAdventureTemplates() "graveyard_radius FROM adventure_template"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::LoadAdventures: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } From 083236172997bebb3f0e63354084698064780af6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 236/707] Remove Duplicative MySQL Error: Start zone query failed: %s : %s\n --- world/worlddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/worlddb.cpp b/world/worlddb.cpp index 5fa4313da..b1e98b408 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -298,7 +298,6 @@ bool WorldDatabase::GetStartZone(PlayerProfile_Struct* in_pp, CharCreate_Struct* in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } From 209adc28280d72040388d9d31e347711b2676fe9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 237/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index b6a1917b9..3d3fde5c5 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1460,7 +1460,6 @@ bool ZoneDatabase::LoadAAEffects2() { const std::string query = "SELECT aaid, slot, effectid, base1, base2 FROM aa_effects ORDER BY aaid ASC, slot ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadAAEffects2 query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 381749933adca1c9954eed760511e6318c3bf482 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 238/707] Remove Duplicative MySQL Error: Error in Client::SendRewards(): %s (%s) --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index 50ac4655c..dc267469b 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5290,7 +5290,6 @@ void Client::SendRewards() "ORDER BY reward_id", AccountID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Client::SendRewards(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 43da95e784f01711015748b363cd8069cee0e514 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:06 -0600 Subject: [PATCH 239/707] Remove Duplicative MySQL Error: Error in Forage query '%s': %s --- zone/forage.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/forage.cpp b/zone/forage.cpp index db348cf8c..3fe61f9d1 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -59,7 +59,6 @@ uint32 ZoneDatabase::GetZoneForage(uint32 ZoneID, uint8 skill) { "LIMIT %i", ZoneID, skill, FORAGE_ITEM_LIMIT); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Forage query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 0491f22e2bb5cb0b08e6d13cd1d9c612fac12098 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:07 -0600 Subject: [PATCH 240/707] Remove Duplicative MySQL Error: Error in CheckGuildDoor query '%s': %s --- zone/guild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild.cpp b/zone/guild.cpp index 271d835a0..33e783030 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -409,7 +409,6 @@ bool ZoneDatabase::CheckGuildDoor(uint8 doorid, uint16 guild_id, const char* zon doorid-128, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in CheckGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From de0de39e080fbf1c070062a6ca550f21d37df014 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:07 -0600 Subject: [PATCH 241/707] Remove Duplicative MySQL Error: Error Loading guild bank: %s, %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 0df3fe929..a44cd09e1 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -603,7 +603,6 @@ bool GuildBankManager::Load(uint32 guildID) "FROM `guild_bank` WHERE `guildid` = %i", guildID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error Loading guild bank: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From be37525414e77b2f8d1ec377799e5b09af2fec18 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:07 -0600 Subject: [PATCH 242/707] Remove Duplicative MySQL Error: Error in Mount query '%s': %s --- zone/horse.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/horse.cpp b/zone/horse.cpp index 91e452dc2..c41465a16 100644 --- a/zone/horse.cpp +++ b/zone/horse.cpp @@ -73,7 +73,6 @@ const NPCType *Horse::BuildHorseType(uint16 spell_id) { std::string query = StringFormat("SELECT race, gender, texture, mountspeed FROM horses WHERE filename = '%s'", fileName); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Mount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } From 6cd08b8f27f96823341568c40a484d069d4c70b6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:07 -0600 Subject: [PATCH 243/707] Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index 4b749adba..c9ab76d02 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1004,7 +1004,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); From 8df0ec05e1a2e0615b80550c5ff85bd09f87b44f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:07 -0600 Subject: [PATCH 244/707] Remove Duplicative MySQL Error: Error in DeletePetitionFromDB query '%s': %s --- zone/petitions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 4af99a946..a85f65f30 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -213,7 +213,6 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in DeletePetitionFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } From 41fc0f7f02a407903ae9193819dc5fe59fcff42c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:07 -0600 Subject: [PATCH 245/707] Remove Duplicative MySQL Error: Error in GetPoweredPetEntry query '%s': %s --- zone/pets.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/pets.cpp b/zone/pets.cpp index 829f8b020..6d920d64f 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -456,7 +456,6 @@ bool ZoneDatabase::GetPoweredPetEntry(const char *pet_type, int16 petpower, PetR pet_type, petpower); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetPoweredPetEntry query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 9837e172acefb6ffc599be5758214bfd3d60bc3d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 246/707] Remove Duplicative MySQL Error: Error in PopulateZoneLists query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index dfaa90278..1ed1ae4c1 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -364,7 +364,6 @@ bool ZoneDatabase::PopulateZoneSpawnList(uint32 zoneid, LinkedList &spa zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in PopulateZoneLists query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From ac2b53c94b67c3f0ad1de565cb8b5105936ab805 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 247/707] Remove Duplicative MySQL Error: Error while querying Spell ID %i spell_globals table query '%s': %s --- zone/spells.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index c9d21201e..3e89e9e8e 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4962,7 +4962,6 @@ bool Client::SpellGlobalCheck(uint16 spell_ID, uint32 char_ID) { "WHERE spellid = %i", spell_ID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error while querying Spell ID %i spell_globals table query '%s': %s", spell_ID, query.c_str(), results.ErrorMessage().c_str()); return false; // Query failed, so prevent spell from scribing just in case } From 346a1b2bb771f843fd06a31247dc6a3bc7e6530a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 248/707] Remove Duplicative MySQL Error: --- zone/tasks.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 37255179b..3ec11ab84 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -725,7 +725,6 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "[TASKS]Error in ClientTaskState::EnableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } From 82af0550df8f5f571d4635f455ef5869a90f6266 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 249/707] Remove Duplicative MySQL Error: Unable to load titles: %s : %s --- zone/titles.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index 0f2e59368..17c699fc9 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -40,7 +40,6 @@ bool TitleManager::LoadTitles() "`status`, `item_id`, `prefix`, `suffix`, `title_set` FROM titles"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Unable to load titles: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 0c5a90203210116c2addcc2e77d4943c1a313841 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 250/707] Remove Duplicative MySQL Error: Error in HandleAutoCombine query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 0e012d087..7b98354d5 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -467,7 +467,6 @@ void Object::HandleAutoCombine(Client* user, const RecipeAutoCombine_Struct* rac rac->recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in HandleAutoCombine query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); user->QueuePacket(outapp); safe_delete(outapp); return; From 9fdc22f78b3a09ea68be84d0fb5896c6ba6e77d7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 251/707] Remove Duplicative MySQL Error: --- zone/trading.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/trading.cpp b/zone/trading.cpp index e2824cb62..2ecf17115 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1478,7 +1478,6 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * seller, buyer, itemName, quantity, totalCost, tranType); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::None, "[CLIENT] Audit write error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); } From e81b03917ab126de5f63991719c56349f11e52f5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:08 -0600 Subject: [PATCH 252/707] Remove Duplicative MySQL Error: Error in LoadTraps query '%s': %s --- zone/trap.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/trap.cpp b/zone/trap.cpp index d973a800b..34e653973 100644 --- a/zone/trap.cpp +++ b/zone/trap.cpp @@ -270,7 +270,6 @@ bool ZoneDatabase::LoadTraps(const char* zonename, int16 version) { "FROM traps WHERE zone='%s' AND version=%u", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadTraps query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From df9f031536dd196f522aea8c558ed20ae9dea52a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:09 -0600 Subject: [PATCH 253/707] Remove Duplicative MySQL Error: Error in LoadTributes first query '%s': %s --- zone/tribute.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 6b104c5f2..2a4ef78b8 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -390,7 +390,6 @@ bool ZoneDatabase::LoadTributes() { const std::string query = "SELECT id, name, descr, unknown, isguild FROM tributes"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadTributes first query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From fa4fb72263040d3434e11c344c7708cdae392e69 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:09 -0600 Subject: [PATCH 254/707] Remove Duplicative MySQL Error: Error in GetHighestGrid query '%s': %s --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 95c76d66b..06b9712b3 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1011,7 +1011,6 @@ int ZoneDatabase::GetHighestGrid(uint32 zoneid) { std::string query = StringFormat("SELECT COALESCE(MAX(id), 0) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetHighestGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From c81eb674bbdf27be9b91ee4dbf6c2f0df2749659 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:09 -0600 Subject: [PATCH 255/707] Remove Duplicative MySQL Error: Error in LoadTempMerchantData query '%s' %s --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 49595914f..48c1deceb 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -419,7 +419,6 @@ void Zone::LoadTempMerchantData() { "ORDER BY ml.slot ", GetShortName(), GetInstanceVersion()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadTempMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } std::map >::iterator cur; From 3f0fcefdb44dbd5d4bd2bcc86d3c2c9c0e3414e9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:09 -0600 Subject: [PATCH 256/707] Remove Duplicative MySQL Error: Error in SaveZoneCFG query %s: %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 58df1a7fb..c9cb69291 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -86,7 +86,6 @@ bool ZoneDatabase::SaveZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in SaveZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 9749d7c3af662e0f98a847825615f434571a8427 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:14 -0600 Subject: [PATCH 257/707] Remove Duplicative MySQL Error: Error in GetAccountIDByChar query '%s': %s --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 0ce40425c..59f5592d6 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -804,7 +804,6 @@ uint32 Database::GetAccountIDByChar(uint32 char_id) { std::string query = StringFormat("SELECT `account_id` FROM `character_data` WHERE `id` = %i LIMIT 1", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetAccountIDByChar query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 382fdc5d18a284a01450d56485d0cbb3c38cff17 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:14 -0600 Subject: [PATCH 258/707] Remove Duplicative MySQL Error: Error loading guild ranks '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 48d40d369..c3929965a 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -68,7 +68,6 @@ bool BaseGuildManager::LoadGuilds() { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From d8510e787670b34df8bf6786745b259aa91f8aaf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 259/707] Remove Duplicative MySQL Error: Fauled to set rule in the database: %s: %s --- common/rulesys.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index fb6d94dcc..f4b513b9f 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -313,7 +313,6 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::Detail, Logs::Rules, "Fauled to set rule in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); } From 4d15ddfc8acc241f4c9c93b4e5b8042ae5f88fc5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 260/707] Remove Duplicative MySQL Error: UpdateInventorySlot query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 5f77094a2..ac94de59b 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -213,7 +213,6 @@ bool SharedDatabase::UpdateInventorySlot(uint32 char_id, const ItemInst* inst, i } if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "UpdateInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 384d9a47488f89a74763d2c1a9488f8224d5681a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 261/707] Remove Duplicative MySQL Error: Error removing player from LFGuild table, query was %s, %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 68e9235d9..c80c23c4f 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -241,7 +241,6 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::QS_Server, "Error removing player from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); From 61a6edc1d0feb5f158f02d0c34b615c6b93b051b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 262/707] Remove Duplicative MySQL Error: Unable to get message count from database. %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 5a3a7267c..6eb4407d0 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -228,7 +228,6 @@ bool Database::GetVariable(const char* varname, char* varvalue, uint16 varvalue_ std::string query = StringFormat("SELECT `value` FROM `variables` WHERE `varname` = '%s'", varname); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 50d0bb0d039a357a7c58ef1fe69b0ef340c7d003 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 263/707] Remove Duplicative MySQL Error: Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s) --- world/adventure.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/adventure.cpp b/world/adventure.cpp index b2554c1f2..e0a5aae18 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -404,7 +404,6 @@ void Adventure::MoveCorpsesToGraveyard() x, y, z, GetInstanceID()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::MoveCorpsesToGraveyard: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } auto c_iter = charid_list.begin(); From 03b0fac83886f559f14be64becbe19369e76e56d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 264/707] Remove Duplicative MySQL Error: Error in AdventureManager:::LoadAdventureEntries: %s (%s) --- world/adventure_manager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index cb3930bf6..1314a344b 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -701,7 +701,6 @@ bool AdventureManager::LoadAdventureEntries() auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::LoadAdventureEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } From 2b3d14f0baf4793163e45003d33134dba1a2c0e3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 265/707] Remove Duplicative MySQL Error: SoF Start zone query failed: %s : %s\n --- world/worlddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/worlddb.cpp b/world/worlddb.cpp index b1e98b408..8b81233a0 100644 --- a/world/worlddb.cpp +++ b/world/worlddb.cpp @@ -433,7 +433,6 @@ bool WorldDatabase::GetStartZoneSoF(PlayerProfile_Struct* in_pp, CharCreate_Stru in_cc->start_zone, in_cc->class_, in_cc->deity, in_cc->race); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Status, "SoF Start zone query failed: %s : %s\n", query.c_str(), results.ErrorMessage().c_str()); return false; } From ee0a68fed2f59e80e8efb33ab6f110c7ceb84b57 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:15 -0600 Subject: [PATCH 266/707] Remove Duplicative MySQL Error: Error in LoadAAEffects query '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 3d3fde5c5..4273e18ab 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1801,7 +1801,6 @@ bool ZoneDatabase::LoadAAEffects() { "redux_aa, redux_rate, redux_aa2, redux_rate2 FROM aa_actions"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadAAEffects query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 19dfc9e92dfe699b486d7381ad51d755f98d4b3f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:16 -0600 Subject: [PATCH 267/707] Remove Duplicative MySQL Error: Error in Client::TryReward(): %s (%s) --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index dc267469b..8cd9a3ebb 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5357,7 +5357,6 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return false; } From 0b330b731267f1059797d9f4c8ca4dfd57a397fe Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:16 -0600 Subject: [PATCH 268/707] Remove Duplicative MySQL Error: Error in SetGuildDoor query '%s': %s --- zone/guild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild.cpp b/zone/guild.cpp index 33e783030..54d406039 100644 --- a/zone/guild.cpp +++ b/zone/guild.cpp @@ -428,7 +428,6 @@ bool ZoneDatabase::SetGuildDoor(uint8 doorid,uint16 guild_id, const char* zone) guild_id, doorid, zone); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in SetGuildDoor query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 1f8d483badaf5a7da3f9a7c3f7270a614b4e02e8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:16 -0600 Subject: [PATCH 269/707] Remove Duplicative MySQL Error: Insert Error: %s : %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index a44cd09e1..6435951cc 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -856,7 +856,6 @@ bool GuildBankManager::AddItem(uint32 GuildID, uint8 Area, uint32 ItemID, int32 GuildID, Area, Slot, ItemID, QtyOrCharges, Donator, Permissions, WhoFor); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Insert Error: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 525a51387148ac3509730800f4592917e36f2452 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:16 -0600 Subject: [PATCH 270/707] Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index c9ab76d02..a3052b741 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1020,7 +1020,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->MerchantType, 0, spawn->GetRunspeed(), 28, 28); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } npc_type_id = results.LastInsertedID(); From 8cb8aed9b4fd839a77d9e7dcd975983393fef165 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:16 -0600 Subject: [PATCH 271/707] Remove Duplicative MySQL Error: Error in UpdatePetitionToDB query '%s': %s --- zone/petitions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index a85f65f30..a713dfdf7 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -226,7 +226,6 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in UpdatePetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } From 52553e507f2dc665bd2c3db112802055ba2ae7e0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:16 -0600 Subject: [PATCH 272/707] Remove Duplicative MySQL Error: Error in GetBasePetItems query '%s': %s --- zone/pets.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/pets.cpp b/zone/pets.cpp index 6d920d64f..4b2287a98 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -655,7 +655,6 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { std::string query = StringFormat("SELECT nested_set FROM pets_equipmentset WHERE set_id = '%s'", curset); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 0917eb00b17cbdede9f678c80f11df73be8b56ab Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 273/707] Remove Duplicative MySQL Error: Error in LoadSpawn2 query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 1ed1ae4c1..cb9197ec5 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -391,7 +391,6 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 "WHERE id = %i", spawn2id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } From 380510ff44a08e5a1746b1c1a4acf8774718daa0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 274/707] Remove Duplicative MySQL Error: --- zone/tasks.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 3ec11ab84..ad48c7cb6 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -773,7 +773,6 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) { Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Executing query %s", query.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "[TASKS]Error in ClientTaskState::DisableTask %s %s", query.c_str(), results.ErrorMessage().c_str()); } bool ClientTaskState::IsTaskEnabled(int TaskID) { From d3b00c142dfa62da76f59f01a0803428ce5012c0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 275/707] Remove Duplicative MySQL Error: Error adding title: %s %s --- zone/titles.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index 17c699fc9..6234ac674 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -262,7 +262,6 @@ void TitleManager::CreateNewPlayerTitle(Client *client, const char *title) safe_delete_array(escTitle); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error adding title: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 0133dd56889982d444fa44e99e13c98a85f342dc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 276/707] Remove Duplicative MySQL Error: Error in TradeskillSearchResults query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 7b98354d5..c7345a7d6 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -675,7 +675,6 @@ void Client::TradeskillSearchResults(const std::string query, unsigned long objt auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in TradeskillSearchResults query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 8ccb1ca3e732486831d35ef613cd8c80921566bb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 277/707] Remove Duplicative MySQL Error: --- zone/trading.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/trading.cpp b/zone/trading.cpp index 2ecf17115..e1731e065 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1825,7 +1825,6 @@ void Client::SendBazaarResults(uint32 TraderID, uint32 Class_, uint32 Race, uint searchValues.c_str(), searchCriteria.c_str(), RuleI(Bazaar, MaxSearchResults)); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to retrieve Bazaar Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } From f57509113b67a813820f8a30852adcb62ffc6838 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 278/707] Remove Duplicative MySQL Error: Error in LoadTributes level query '%s': %s --- zone/tribute.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tribute.cpp b/zone/tribute.cpp index 2a4ef78b8..df01f843e 100644 --- a/zone/tribute.cpp +++ b/zone/tribute.cpp @@ -406,7 +406,6 @@ bool ZoneDatabase::LoadTributes() { const std::string query2 = "SELECT tribute_id, level, cost, item_id FROM tribute_levels ORDER BY tribute_id, level"; results = QueryDatabase(query2); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadTributes level query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 8ac846e32e4cbf2d0e0e77e30bf0fdc21c189b9c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:17 -0600 Subject: [PATCH 279/707] Remove Duplicative MySQL Error: Error in GetGridType2 query '%s': %s --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 06b9712b3..357d2c598 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1027,7 +1027,6 @@ uint8 ZoneDatabase::GetGridType2(uint32 grid, uint16 zoneid) { std::string query = StringFormat("SELECT type2 FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetGridType2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From ca27159223ba24a03df159f512083b863be7a781 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:18 -0600 Subject: [PATCH 280/707] Remove Duplicative MySQL Error: Error in LoadNewMerchantData query '%s' %s --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 48c1deceb..efbb92774 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -451,7 +451,6 @@ void Zone::LoadNewMerchantData(uint32 merchantid) { "classes_required, probability FROM merchantlist WHERE merchantid=%d ORDER BY slot", merchantid); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadNewMerchantData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } From cf655a29075c39c0525c90c55d0d3e3fa7bffc2d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:18 -0600 Subject: [PATCH 281/707] Remove Duplicative MySQL Error: Error in GetZoneCFG query %s: %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index c9cb69291..4426b8993 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -111,7 +111,6 @@ bool ZoneDatabase::GetZoneCFG(uint32 zoneid, uint16 instance_id, NewZone_Struct "FROM zone WHERE zoneidnumber = %i AND version = %i", zoneid, instance_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetZoneCFG query %s: %s", query.c_str(), results.ErrorMessage().c_str()); strcpy(*map_filename, "default"); return false; } From 34269c5b69b985816e4bbb8999bab26a7b57b3ed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 282/707] Remove Duplicative MySQL Error: Error in GetCharactersInInstace query '%s': %s --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 59f5592d6..c0f578f2a 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4047,7 +4047,6 @@ void Database::GetCharactersInInstance(uint16 instance_id, std::list &ch if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetCharactersInInstace query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 5443e879a57a4e1a4e26d565c6de65ecf2b74fa6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 283/707] Remove Duplicative MySQL Error: Error reloading guilds '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index c3929965a..2102d77d9 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -118,7 +118,6 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error reloading guilds '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 220daed2c82d8f24fa47a1a3a03c9239cd8f1bba Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 284/707] Remove Duplicative MySQL Error: Error in LoadRules query %s: %s --- common/rulesys.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index f4b513b9f..1b0461a9c 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -327,7 +327,6 @@ int RuleManager::GetRulesetID(Database *db, const char *rulesetname) { safe_delete_array(rst); auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } From 807dd5198ce30ede17390eb34ac349a7e64e7689 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 285/707] Remove Duplicative MySQL Error: UpdateSharedBankSlot query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index ac94de59b..549b1ad72 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -256,7 +256,6 @@ bool SharedDatabase::UpdateSharedBankSlot(uint32 char_id, const ItemInst* inst, } if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "UpdateSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 72359b54f0b6163c0716fff04db9b70708a522d7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 286/707] Remove Duplicative MySQL Error: Error inserting player into LFGuild table, query was %s, %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index c80c23c4f..abb8c3f64 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -255,7 +255,6 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::QS_Server, "Error inserting player into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); From 8b5a623c75b0f53f8d415e637bd948bb7204be62 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 287/707] Remove Duplicative MySQL Error: Failed to load channels. %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 6eb4407d0..12ea39bc2 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -248,7 +248,6 @@ bool Database::LoadChatChannels() { const std::string query = "SELECT `name`, `owner`, `password`, `minstatus` FROM `chatchannels`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Failed to load channels. %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 7878755831c35fef0646ada2b8d480cdd909bcbf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:20 -0600 Subject: [PATCH 288/707] Remove Duplicative MySQL Error: Error in AdventureManager:::GetLeaderboardInfo: %s (%s) --- world/adventure_manager.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/adventure_manager.cpp b/world/adventure_manager.cpp index 1314a344b..c49cf17c4 100644 --- a/world/adventure_manager.cpp +++ b/world/adventure_manager.cpp @@ -1077,7 +1077,6 @@ void AdventureManager::LoadLeaderboardInfo() "AS adv_stats LEFT JOIN `character_data` AS ch ON adv_stats.player_id = ch.id;"; auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in AdventureManager:::GetLeaderboardInfo: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From d6ba9d7108fa212cc8e69777c0ea3558b1ab02c1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 289/707] Remove Duplicative MySQL Error: Error in GetTotalAALevels '%s: %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 4273e18ab..6ce2dd544 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1839,7 +1839,6 @@ uint8 ZoneDatabase::GetTotalAALevels(uint32 skill_id) { std::string query = StringFormat("SELECT count(slot) FROM aa_effects WHERE aaid = %i", skill_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetTotalAALevels '%s: %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 71842c62de7e617701b2ad48fa9aa50160d54f74 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 290/707] Remove Duplicative MySQL Error: Error in Client::TryReward(): %s (%s) --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index 8cd9a3ebb..ea991881f 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5383,7 +5383,6 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " From e8824e5d140c25904546bcac8c040205756a693c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 291/707] Remove Duplicative MySQL Error: error promoting item: %s : %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 6435951cc..f98ba5c44 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -920,7 +920,6 @@ int GuildBankManager::Promote(uint32 guildID, int slotID) "LIMIT 1", mainSlot, guildID, slotID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "error promoting item: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } From 47752634c0d4d2819224508baf6909b1c301d295 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 292/707] Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index a3052b741..2c8733266 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1031,7 +1031,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C query = StringFormat("INSERT INTO spawngroup (id, name) VALUES(%i, '%s-%s')", 0, zone, spawn->GetName()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } uint32 spawngroupid = results.LastInsertedID(); From cdc449eb7ce3a8fe2ce61f87030ffbe4035885d7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 293/707] Remove Duplicative MySQL Error: Error in InsertPetitionToDB query '%s': %s --- zone/petitions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index a713dfdf7..964b8beae 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -252,7 +252,6 @@ void ZoneDatabase::InsertPetitionToDB(Petition* wpet) safe_delete_array(petitiontext); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in InsertPetitionToDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 2ae6050a77c79ab0ab44bc411fe3de5285c33509 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 294/707] Remove Duplicative MySQL Error: Error in GetBasePetItems query '%s': %s --- zone/pets.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/pets.cpp b/zone/pets.cpp index 4b2287a98..8415dbe9d 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -670,7 +670,6 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in GetBasePetItems query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); else { for (row = results.begin(); row != results.end(); ++row) { From d4b35740be1f4b49efb3bb5024642c4495860f2e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:21 -0600 Subject: [PATCH 295/707] Remove Duplicative MySQL Error: Error in LoadSpawn2 query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index cb9197ec5..d78558752 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -395,7 +395,6 @@ Spawn2* ZoneDatabase::LoadSpawn2(LinkedList &spawn2_list, uint32 spawn2 } if (results.RowCount() != 1) { - Log.Out(Logs::General, Logs::Error, "Error in LoadSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } From 8756b976bb6f5de7c99f5cbad2e034705fcafa73 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:22 -0600 Subject: [PATCH 296/707] Remove Duplicative MySQL Error: --- zone/tasks.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index ad48c7cb6..37f54570b 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -1276,7 +1276,6 @@ static void DeleteCompletedTaskFromDatabase(int charID, int taskID) { const std::string query = StringFormat("DELETE FROM completed_tasks WHERE charid=%i AND taskid = %i", charID, taskID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "[TASKS]Error in CientTaskState::CancelTask %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 4bcfe5444bc84a758ba221b83eb67de0749f2f2a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:22 -0600 Subject: [PATCH 297/707] Remove Duplicative MySQL Error: Error adding title suffix: %s %s --- zone/titles.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index 6234ac674..639a7e2ba 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -294,7 +294,6 @@ void TitleManager::CreateNewPlayerSuffix(Client *client, const char *suffix) safe_delete_array(escSuffix); results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error adding title suffix: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 71497f06744900f21797ec5052d5dde52ab9c6c9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:22 -0600 Subject: [PATCH 298/707] Remove Duplicative MySQL Error: Error in SendTradeskillDetails query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index c7345a7d6..44ee3826a 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -728,7 +728,6 @@ void Client::SendTradeskillDetails(uint32 recipe_id) { recipe_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in SendTradeskillDetails query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 6d3b9ae40b1a58af6fc782680292e31b376c4829 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:22 -0600 Subject: [PATCH 299/707] Remove Duplicative MySQL Error: --- zone/trading.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/trading.cpp b/zone/trading.cpp index e1731e065..d06cf2f9d 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -2264,7 +2264,6 @@ void Client::SendBuyerResults(char* searchString, uint32 searchID) { safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::None, "[CLIENT] Failed to retrieve Barter Search!! %s %s\n", query.c_str(), results.ErrorMessage().c_str()); return; } From cec0b5760d858333729f801e04500d8872d27cee Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:22 -0600 Subject: [PATCH 300/707] Remove Duplicative MySQL Error: Error in GetWaypoints query '%s': %s --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 357d2c598..30fc7bbf3 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1047,7 +1047,6 @@ bool ZoneDatabase::GetWaypoints(uint32 grid, uint16 zoneid, uint32 num, wplist* "WHERE gridid = %i AND number = %i AND zoneid = %i", grid, num, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetWaypoints query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 5645d210824bb81bd03acbfe1f978181ab5271c1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:23 -0600 Subject: [PATCH 301/707] Remove Duplicative MySQL Error: Error in Zone::LoadLDoNTraps: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index efbb92774..61f08c7fa 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1990,7 +1990,6 @@ void Zone::LoadLDoNTraps() const std::string query = "SELECT id, type, spell_id, skill, locked FROM ldon_trap_templates"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadLDoNTraps: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 09d32d92af4776ae7c522b45c2093382116c865b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:23 -0600 Subject: [PATCH 302/707] Remove Duplicative MySQL Error: Error in UpdateTimeLeft query %s: %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 4426b8993..af4664b5b 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -199,7 +199,6 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti "AND instance_id = %lu",(unsigned long)id, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } From adf3a7ea0e2d05f9e407afa25d04d60ded70ace1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:24 -0600 Subject: [PATCH 303/707] Remove Duplicative MySQL Error: Error reloading guild ranks '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 2102d77d9..70b87a869 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -137,7 +137,6 @@ bool BaseGuildManager::RefreshGuild(uint32 guild_id) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error reloading guild ranks '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 65e9f571afd0c2ce5e4eb29b89ed9706f18b5a2c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:24 -0600 Subject: [PATCH 304/707] Remove Duplicative MySQL Error: Fauled to create rule set in the database: %s: %s --- common/rulesys.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 1b0461a9c..ba4527d86 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -353,7 +353,6 @@ int RuleManager::_FindOrCreateRuleset(Database *db, const char *ruleset) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Rules, "Fauled to create rule set in the database: %s: %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } From 3040a8b1a12efb107d0d4c1e61ef6777786a3470 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 305/707] Remove Duplicative MySQL Error: DeleteInventorySlot query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 549b1ad72..4ec224b0a 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -268,7 +268,6 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM inventory WHERE charid = %i AND slotid = %i", char_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "DeleteInventorySlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 48202886339cd8d4d69f8a17ea744e7a9d85f9ce Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 306/707] Remove Duplicative MySQL Error: Error removing guild from LFGuild table, query was %s, %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index abb8c3f64..dbcc1e555 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -285,7 +285,6 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::QS_Server, "Error removing guild from LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); uint32 Now = time(nullptr); From 7d27d1ccb1a00c0718597d45d02323e01770f294 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 307/707] Remove Duplicative MySQL Error: Error updating password in database: %s, %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 12ea39bc2..d7ebffbdb 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -270,7 +270,6 @@ void Database::SetChannelPassword(std::string channelName, std::string password) password.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::UCS_Server, "Error updating password in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } From b312663fd12804244190b25c2469a3780742c19e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 308/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::CountAAs query '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 6ce2dd544..eda4f3b03 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1892,7 +1892,6 @@ uint32 ZoneDatabase::CountAAs(){ const std::string query = "SELECT count(title_sid) FROM altadv_vars"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::CountAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From bd6f6579efbec764b0a0817c7141b1a9dd2570ac Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 309/707] Remove Duplicative MySQL Error: Error in Client::TryReward(): %s (%s) --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index ea991881f..3aaa23621 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5390,7 +5390,6 @@ bool Client::TryReward(uint32 claim_id) { AccountID(), claim_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in Client::TryReward(): %s (%s)", query.c_str(), results.ErrorMessage().c_str()); } InternalVeteranReward ivr = (*iter); From 6e5b8170c5ae9a0712cc05807f81db9d4ca566cb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 310/707] Remove Duplicative MySQL Error: error changing permissions: %s : %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index f98ba5c44..66fe8828a 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -971,7 +971,6 @@ void GuildBankManager::SetPermissions(uint32 guildID, uint16 slotID, uint32 perm auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "error changing permissions: %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 7bf57fca876e45bce62ba63b1c02db2ab25484e3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:25 -0600 Subject: [PATCH 311/707] Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index 2c8733266..9e4340e80 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1044,7 +1044,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawn->GetHeading(), spawngroupid); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 2ef9e342f7f8980fa6c1ea5f6d31f7c4af2011a1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 312/707] Remove Duplicative MySQL Error: Error in RefreshPetitionsFromDB query '%s': %s --- zone/petitions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 964b8beae..2d810564d 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -270,7 +270,6 @@ void ZoneDatabase::RefreshPetitionsFromDB() "FROM petitions ORDER BY petid"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in RefreshPetitionsFromDB query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 9d23f69a1062de8201307fe8b45c0bce557dfe51 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 313/707] Remove Duplicative MySQL Error: Error in CreateSpawn2 query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index d78558752..abc416124 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -421,7 +421,6 @@ bool ZoneDatabase::CreateSpawn2(Client *client, uint32 spawngroup, const char* z respawn, variance, condition, cond_value); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in CreateSpawn2 query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 9cb3762102aba68e58f85fc87a046b9ee60beb05 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 314/707] Remove Duplicative MySQL Error: --- zone/tasks.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 37f54570b..4bee8454f 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -3074,7 +3074,6 @@ bool TaskGoalListManager::LoadLists() { "ORDER BY `listid`"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); return false; } From d9f492f4e2b98bb5b2cb4bf461abff2ff0488cab Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 315/707] Remove Duplicative MySQL Error: Error in CheckTitle query '%s': %s --- zone/titles.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index 639a7e2ba..7df8f86d1 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -359,7 +359,6 @@ bool Client::CheckTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in CheckTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 636f090ce3f7537adedcc4e151f18bba10d84360 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 316/707] Remove Duplicative MySQL Error: Error in tradeskill verify query: '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 44ee3826a..ed92e6fb6 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1317,7 +1317,6 @@ bool ZoneDatabase::GetTradeRecipe(const ItemInst* container, uint8 c_type, uint3 recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in tradeskill verify query: '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return GetTradeRecipe(recipe_id, c_type, some_id, char_id, spec); } From 1b99e3e4d1ac3ad9accea1378d4517076527adb2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 317/707] Remove Duplicative MySQL Error: Error querying spawn2 '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 30fc7bbf3..0e750b31e 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1075,7 +1075,6 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), (int)x, (int)y); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error querying spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From 8e5541acce52da370cb7c15653bac7a91c43fb5f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:26 -0600 Subject: [PATCH 318/707] Remove Duplicative MySQL Error: Error in Zone::LoadLDoNTrapEntries: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 61f08c7fa..dfb63d5e9 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2010,7 +2010,6 @@ void Zone::LoadLDoNTrapEntries() const std::string query = "SELECT id, trap_id FROM ldon_trap_entries"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadLDoNTrapEntries: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 22fa5b6ce9fe42149ad8fa444fcfdafc56713a1d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:27 -0600 Subject: [PATCH 319/707] Remove Duplicative MySQL Error: Error in UpdateTimeLeft query %s: %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index af4664b5b..da5b817be 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -209,7 +209,6 @@ void ZoneDatabase::UpdateSpawn2Timeleft(uint32 id, uint16 instance_id, uint32 ti (unsigned long)timeleft, (unsigned long)instance_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in UpdateTimeLeft query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 48a43b05559cf0656c6fd005ad897f1e3583083e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:31 -0600 Subject: [PATCH 320/707] Remove Duplicative MySQL Error: Error clearing old guild record when storing %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 70b87a869..f236f2fac 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -232,7 +232,6 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { auto results = m_db->QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::Detail, Logs::Guilds, "Error clearing old guild record when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); From 154bd186b13db708cecb46ac8b7922cdcd0d8d29 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:31 -0600 Subject: [PATCH 321/707] Remove Duplicative MySQL Error: Error in LoadRules query %s: %s --- common/rulesys.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index ba4527d86..7a1b30b60 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -365,7 +365,6 @@ std::string RuleManager::GetRulesetName(Database *db, int id) { auto results = db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadRules query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return ""; } From 4c804e85151b4bafa23d3e8e5aee00fd3f851a4f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:31 -0600 Subject: [PATCH 322/707] Remove Duplicative MySQL Error: DeleteInventorySlot, bags query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 4ec224b0a..04b032925 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -280,7 +280,6 @@ bool SharedDatabase::DeleteInventorySlot(uint32 char_id, int16 slot_id) { char_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "DeleteInventorySlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From aae4691a6e913e93c6cb5f02b4ceae35a569a68d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 323/707] Remove Duplicative MySQL Error: Error inserting guild into LFGuild table, query was %s, %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index dbcc1e555..2d66e7586 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -301,7 +301,6 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::QS_Server, "Error inserting guild into LFGuild table, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); } From 86c82718eca5233d032c4b6c9583dc3747baad1e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 324/707] Remove Duplicative MySQL Error: Error updating Owner in database: %s, %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index d7ebffbdb..ca9f0f0e8 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -281,7 +281,6 @@ void Database::SetChannelOwner(std::string channelName, std::string owner) { owner.c_str(), channelName.c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::UCS_Server, "Error updating Owner in database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } From 9d7b3d0c081736697643b6bf81d207ec60920b94 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 325/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::CountAALevels query '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index eda4f3b03..cfe80f10b 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1908,7 +1908,6 @@ uint32 ZoneDatabase::CountAAEffects() { const std::string query = "SELECT count(id) FROM aa_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::CountAALevels query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 4fadff785cf32a5b2e1d1bb74e3b2c05c8f0649f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 326/707] Remove Duplicative MySQL Error: Delete item failed. %s : %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 66fe8828a..71312b460 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -1120,7 +1120,6 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Delete item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 69bb54fd9cf6c49aab07f74dd5dc843170a5114d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 327/707] Remove Duplicative MySQL Error: NPCSpawnDB Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index 9e4340e80..6132be712 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1054,7 +1054,6 @@ uint32 ZoneDatabase::CreateNewNPCCommand(const char* zone, uint32 zone_version,C spawngroupid, npc_type_id, 100); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "NPCSpawnDB Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 650f7366abf386010428e94d25a78fee220b9fee Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 328/707] Remove Duplicative MySQL Error: Unable to update spawn event '%s': %s\n --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index abc416124..d28b8fc00 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -670,7 +670,6 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.strict? 1: 0, event.id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Unable to update spawn event '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } From 2196053f8a2060d9db499bf14fc2b055f1dee9bf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:32 -0600 Subject: [PATCH 329/707] Remove Duplicative MySQL Error: --- zone/tasks.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 4bee8454f..a1758ae4c 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -3107,7 +3107,6 @@ bool TaskGoalListManager::LoadLists() { listID, size); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, ERR_MYSQLERROR, query.c_str(), results.ErrorMessage().c_str()); TaskGoalLists[listIndex].Size = 0; continue; } From be3acf583ff33225c97568db355cbf2a87c1db78 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:33 -0600 Subject: [PATCH 330/707] Remove Duplicative MySQL Error: Error in RemoveTitle query '%s': %s --- zone/titles.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index 7df8f86d1..3c28e2417 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -378,7 +378,6 @@ void Client::RemoveTitle(int titleSet) { titleSet, CharacterID()); auto results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in RemoveTitle query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } From 21ad8e1e7cfb3335df9f02e03038bae68adc4ec6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:33 -0600 Subject: [PATCH 331/707] Remove Duplicative MySQL Error: Error in GetTradeRecept success query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index ed92e6fb6..f2502ccae 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1403,7 +1403,6 @@ bool ZoneDatabase::GetTradeRecipe(uint32 recipe_id, uint8 c_type, uint32 some_id "WHERE successcount > 0 AND recipe_id = %u", recipe_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetTradeRecept success query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 598848f4fc88af6366fe6a99df7defee071f4089 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:33 -0600 Subject: [PATCH 332/707] Remove Duplicative MySQL Error: Error querying fuzzy spawn2 '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 0e750b31e..9dd115d8e 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1088,7 +1088,6 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) zone->GetShortName(), x, _GASSIGN_TOLERANCE, y, _GASSIGN_TOLERANCE); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error querying fuzzy spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From 6bf5b5a7fb93e6e733cc21c2906537180475a4d2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:33 -0600 Subject: [PATCH 333/707] Remove Duplicative MySQL Error: Error in Zone::LoadVeteranRewards: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index dfb63d5e9..f8f353c3e 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2051,7 +2051,6 @@ void Zone::LoadVeteranRewards() "ORDER by claim_id, reward_slot"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadVeteranRewards: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 63b2f706e465da729153500be4130e43ad2242db Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:33 -0600 Subject: [PATCH 334/707] Remove Duplicative MySQL Error: Error in GetSpawnTimeLeft query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index da5b817be..ab68de708 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -221,7 +221,6 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) (unsigned long)id, (unsigned long)zone->GetInstanceID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetSpawnTimeLeft query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 7e4eedbebc93040314751dc3b69011b024d3acbc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:35 -0600 Subject: [PATCH 335/707] Remove Duplicative MySQL Error: Error clearing old guild_ranks records when storing %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index f236f2fac..50ab3815a 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -238,7 +238,6 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { results = m_db->QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::Detail, Logs::Guilds, "Error clearing old guild_ranks records when storing %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); //escape our strings. char *name_esc = new char[info->name.length()*2+1]; From 30a351a3b828347c2bbac6f6c80eee7db4843cba Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 336/707] Remove Duplicative MySQL Error: Error in ListRulesets query %s: %s --- common/rulesys.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 7a1b30b60..97d5a96ad 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -385,7 +385,6 @@ bool RuleManager::ListRulesets(Database *db, std::map &into) { auto results = db->QueryDatabase(query); if (results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ListRulesets query %s: %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 51fc8d61cc27bcd213a75293e5e672db7648acb4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 337/707] Remove Duplicative MySQL Error: DeleteSharedBankSlot query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 04b032925..b2a0b43ab 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -294,7 +294,6 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { std::string query = StringFormat("DELETE FROM sharedbank WHERE acctid=%i AND slotid=%i", account_id, slot_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "DeleteSharedBankSlot query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 7cceee14a1b8b125ff8fa36400a7299a1199c782 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 338/707] Remove Duplicative MySQL Error: Error expiring player LFGuild entry, query was %s, %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 2d66e7586..c791aceba 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -330,7 +330,6 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::QS_Server, "Error expiring player LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it = Players.erase(it); } From 3a91ae92abc15a79e55432ec54e68ef45327d877 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 339/707] Remove Duplicative MySQL Error: SendMail: Query %s failed with error %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index ca9f0f0e8..56ad0dce8 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -459,7 +459,6 @@ bool Database::SendMail(std::string recipient, std::string from, std::string sub safe_delete_array(escBody); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "SendMail: Query %s failed with error %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From e88d0a8a2de54ba89203993ae2318c1af900c8ca Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 340/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::LoadAAs query '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index cfe80f10b..34c29b336 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1940,7 +1940,6 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ load[index]->seq = index+1; } } else { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } AARequiredLevelAndCost.clear(); From e406d1e20c2cfda259296bff0d3ca1057deff6fa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 341/707] Remove Duplicative MySQL Error: Update item failed. %s : %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index 71312b460..c3ecbe9d7 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -1131,7 +1131,6 @@ bool GuildBankManager::DeleteItem(uint32 guildID, uint16 area, uint16 slotID, ui BankArea[slotID].Quantity - quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Update item failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 9561634ed8bc89dda158ff4738e73dc00f51cb45 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:36 -0600 Subject: [PATCH 342/707] Remove Duplicative MySQL Error: CreateNewNPCSpawnGroupCommand Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index 6132be712..a61a795ea 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1070,7 +1070,6 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve zone, spawn->GetName(), Timer::GetCurrentTime()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } last_insert_id = results.LastInsertedID(); From db65661a10eec355abbdcae2352f02f6bfd25295 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:37 -0600 Subject: [PATCH 343/707] Remove Duplicative MySQL Error: Unable to update spawn condition '%s': %s\n --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index d28b8fc00..1e12f1383 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -681,7 +681,6 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst cond_id, value, zone_name, instance_id); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Unable to update spawn condition '%s': %s\n", query.c_str(), results.ErrorMessage().c_str()); } From 1661691bc9dc991bcccfbd0fcba52fdd7587541e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:37 -0600 Subject: [PATCH 344/707] Remove Duplicative MySQL Error: Error in TaskProximityManager::LoadProximities %s %s --- zone/tasks.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tasks.cpp b/zone/tasks.cpp index a1758ae4c..0673e51c8 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -3243,7 +3243,6 @@ bool TaskProximityManager::LoadProximities(int zoneID) { "ORDER BY `zoneid` ASC", zoneID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in TaskProximityManager::LoadProximities %s %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 590634ebef72a635588e046376b298f45763d04e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:37 -0600 Subject: [PATCH 345/707] Remove Duplicative MySQL Error: Error in UpdateRecipeMadecount query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index f2502ccae..745fe8b8b 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1459,7 +1459,6 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 recipe_id, char_id, madeCount, madeCount); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in UpdateRecipeMadecount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } void Client::LearnRecipe(uint32 recipeID) From 526075a767f5570a74ae6d52f4eb886757319fda Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:37 -0600 Subject: [PATCH 346/707] Remove Duplicative MySQL Error: Error updating spawn2 '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 9dd115d8e..29f39e287 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1117,7 +1117,6 @@ void ZoneDatabase::AssignGrid(Client *client, float x, float y, uint32 grid) results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error updating spawn2 '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From 17d51b3ff4362bd754966b091796794c971eaa3b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:37 -0600 Subject: [PATCH 347/707] Remove Duplicative MySQL Error: Error in Zone::LoadAlternateCurrencies: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index f8f353c3e..55a818a01 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2096,7 +2096,6 @@ void Zone::LoadAlternateCurrencies() const std::string query = "SELECT id, item_id FROM alternate_currency"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadAlternateCurrencies: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From a992ece3234190fbe3a0a9d83c8f8d2b9629269e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:37 -0600 Subject: [PATCH 348/707] Remove Duplicative MySQL Error: Error in UpdateSpawn2Status query %s: %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index ab68de708..6b99d722c 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -250,7 +250,6 @@ void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in UpdateSpawn2Status query %s: %s", query.c_str(), results.ErrorMessage().c_str()); } From 233320330f89a90192ea493a279154933b816835 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:43 -0600 Subject: [PATCH 349/707] Remove Duplicative MySQL Error: Error inserting new guild record when storing %d. Giving up. '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 50ab3815a..0232914da 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -254,7 +254,6 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error inserting new guild record when storing %d. Giving up. '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(name_esc); safe_delete_array(motd_esc); safe_delete_array(motd_set_esc); From 912de7704d030cde96799054c51ad49e8990e644 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:43 -0600 Subject: [PATCH 350/707] Remove Duplicative MySQL Error: DeleteSharedBankSlot, bags query '%s': %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index b2a0b43ab..d49b1983c 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -307,7 +307,6 @@ bool SharedDatabase::DeleteSharedBankSlot(uint32 char_id, int16 slot_id) { account_id, base_slot_id, (base_slot_id+10)); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "DeleteSharedBankSlot, bags query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 633b953fd3bd6c0d213248b445f80cc58bb2a828 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:43 -0600 Subject: [PATCH 351/707] Remove Duplicative MySQL Error: Error removing guild LFGuild entry, query was %s, %s --- queryserv/lfguild.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index c791aceba..2f395c97a 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -342,7 +342,6 @@ void LFGuildManager::ExpireEntries() std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::QS_Server, "Error removing guild LFGuild entry, query was %s, %s", query.c_str(), results.ErrorMessage().c_str()); it2 = Guilds.erase(it2); } From d800bd87c486e3e1df75bad306be7991101c3c73 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:43 -0600 Subject: [PATCH 352/707] Remove Duplicative MySQL Error: Error updating status %s, %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 56ad0dce8..cd4bcd0a7 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -490,7 +490,6 @@ void Database::SetMessageStatus(int messageNumber, int status) { std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::Detail, Logs::UCS_Server, "Error updating status %s, %s", query.c_str(), results.ErrorMessage().c_str()); } From 882e7a98021e920dce1a8456a9ee3f6937f7b376 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:43 -0600 Subject: [PATCH 353/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::LoadAAs query '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 34c29b336..4f76517fc 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1946,7 +1946,6 @@ void ZoneDatabase::LoadAAs(SendAA_Struct **load){ query = "SELECT skill_id, level, cost from aa_required_level_cost order by skill_id"; results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::LoadAAs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 39c7d30e465f77212f0789830bf764478200ed4b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 354/707] Remove Duplicative MySQL Error: Update item quantity failed. %s : %s --- zone/guild_mgr.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/guild_mgr.cpp b/zone/guild_mgr.cpp index c3ecbe9d7..8df4c794e 100644 --- a/zone/guild_mgr.cpp +++ b/zone/guild_mgr.cpp @@ -1293,7 +1293,6 @@ void GuildBankManager::UpdateItemQuantity(uint32 guildID, uint16 area, uint16 sl quantity, guildID, area, slotID); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Update item quantity failed. %s : %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 405d025322eba2d8b19e1417d82a4a952c5df42e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 355/707] Remove Duplicative MySQL Error: CreateNewNPCSpawnGroupCommand Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index a61a795ea..fafd9fc96 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1092,7 +1092,6 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve spawn->GetHeading(), last_insert_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } spawnid = results.LastInsertedID(); From 04ae8b1707ee22ab6a09858cf95be32411dbe220 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 356/707] Remove Duplicative MySQL Error: Error in LoadDBEvent query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 1e12f1383..290af91f3 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -693,7 +693,6 @@ bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std: "FROM spawn_events WHERE id = %d", event_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadDBEvent query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 50fd74a2d220e354928ab57699281b0ff4d99ed1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 357/707] Remove Duplicative MySQL Error: Error in Client::LearnRecipe query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 745fe8b8b..a7230d457 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1471,7 +1471,6 @@ void Client::LearnRecipe(uint32 recipeID) "WHERE tr.id = %u ;", CharacterID(), recipeID); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Client::LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From e549ae11f207d3049ab8fd6d28fab6ea24f10723 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 358/707] Remove Duplicative MySQL Error: Error creating grid entry '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 29f39e287..53910190c 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1154,7 +1154,6 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type "VALUES (%i, %i, %i, %i)", id, zoneid, type, type2); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error creating grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From e74666fa3b1f5e87387957f8673bc402a353cbf7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 359/707] Remove Duplicative MySQL Error: Error in Zone::LoadAdventureFlavor: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 55a818a01..e4cc18eb5 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2143,7 +2143,6 @@ void Zone::LoadAdventureFlavor() const std::string query = "SELECT id, text FROM adventure_template_entry_flavor"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadAdventureFlavor: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 2ad99b8c239916dadacdbaf0ba5f8c3c1386c5a4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:44 -0600 Subject: [PATCH 360/707] Remove Duplicative MySQL Error: ERROR Bind Home Save: %s. %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 6b99d722c..732b766bf 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1228,7 +1228,6 @@ bool ZoneDatabase::SaveCharacterBindPoint(uint32 character_id, uint32 zone_id, u Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBindPoint for character ID: %i zone_id: %u instance_id: %u x: %f y: %f z: %f heading: %f ishome: %u", character_id, zone_id, instance_id, x, y, z, heading, is_home); auto results = QueryDatabase(query); if (!results.RowsAffected()) { - Log.Out(Logs::General, Logs::None, "ERROR Bind Home Save: %s. %s", results.ErrorMessage().c_str(), query.c_str()); } return true; } From ddae2f3d165736df9cc309506b34d483781c5774 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:52 -0600 Subject: [PATCH 361/707] Remove Duplicative MySQL Error: Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 0232914da..fcf227d05 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -287,7 +287,6 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error inserting new guild rank record when storing %d for %d. Giving up. '%s': %s", rank, guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(title_esc); return false; } From 756e90b6832a03be2e6a34e39b50a7b4e332cfc7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:52 -0600 Subject: [PATCH 362/707] Remove Duplicative MySQL Error: GetInventory query '%s' %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index d49b1983c..cb2ca2d2b 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -485,7 +485,6 @@ bool SharedDatabase::GetInventory(uint32 char_id, Inventory* inv) { "FROM inventory WHERE charid = %i ORDER BY slotid", char_id); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); Log.Out(Logs::General, Logs::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } From 5faeecd82bbd8d4dc7a733a7fad2bf04ebb3cdb1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 363/707] Remove Duplicative MySQL Error: Unable to get message count from database. %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index cd4bcd0a7..e17606558 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -500,7 +500,6 @@ void Database::ExpireMail() { std::string query = "SELECT COUNT(*) FROM `mail`"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Unable to get message count from database. %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 4ecbc5d2dbe895da95236f8796e572b115c66c25 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 364/707] Remove Duplicative MySQL Error: Error in GetAASkillVars '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index 4f76517fc..bad09e266 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1963,7 +1963,6 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) std::string query = "SET @row = 0"; //initialize "row" variable in database for next query auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } From 5bce113bd75b574db6d616409cc3f5f35686626c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 365/707] Remove Duplicative MySQL Error: CreateNewNPCSpawnGroupCommand Error: %s %s --- zone/npc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/npc.cpp b/zone/npc.cpp index fafd9fc96..56bbdae69 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -1103,7 +1103,6 @@ uint32 ZoneDatabase::AddNewNPCSpawnGroupCommand(const char* zone, uint32 zone_ve last_insert_id, spawn->GetNPCTypeID(), 100); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "CreateNewNPCSpawnGroupCommand Error: %s %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 82951fb82d2afebe729828f4b77539a3a7a524a1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 366/707] Remove Duplicative MySQL Error: Error in LoadSpawnConditions query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 290af91f3..395bcafc6 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -735,7 +735,6 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "WHERE zone = '%s'", zone_name); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From c4ebfa889083e46a476975c723fe5ee69b1934b6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 367/707] Remove Duplicative MySQL Error: Error in LearnRecipe query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index a7230d457..445065e70 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1496,7 +1496,6 @@ void Client::LearnRecipe(uint32 recipeID) recipeID, CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in LearnRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } From 430263de9c3b2d06deb804768202a1352ffcc832 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 368/707] Remove Duplicative MySQL Error: Error deleting grid '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 53910190c..0330692da 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1166,7 +1166,6 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error deleting grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); From 800378d9445069056dd0885afc25039994dbc4cf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:53 -0600 Subject: [PATCH 369/707] Remove Duplicative MySQL Error: Error in Zone::LoadNPCEmotes: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index e4cc18eb5..6ef7ec8fd 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2217,7 +2217,6 @@ void Zone::LoadNPCEmotes(LinkedList* NPCEmoteList) const std::string query = "SELECT emoteid, event_, type, text FROM npc_emotes"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadNPCEmotes: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 102c0416f8b1014152d286331a69788d87f1daa3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:54 -0600 Subject: [PATCH 370/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::GroupCount query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 732b766bf..79ae28b3d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2639,7 +2639,6 @@ uint8 ZoneDatabase::GroupCount(uint32 groupid) { std::string query = StringFormat("SELECT count(charid) FROM group_id WHERE groupid = %d", groupid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::GroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From fa1e73fa035ff8c40e1d3889e6f8af693bde2f22 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:55 -0600 Subject: [PATCH 371/707] Remove Duplicative MySQL Error: Error in _GetFreeGuildID query '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index fcf227d05..f70caf1d8 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -329,7 +329,6 @@ uint32 BaseGuildManager::_GetFreeGuildID() { if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in _GetFreeGuildID query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); continue; } From a128c7409052299b44d12c0257b2f6506194b917 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:55 -0600 Subject: [PATCH 372/707] Remove Duplicative MySQL Error: GetInventory query '%s' %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index cb2ca2d2b..da95cabef 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -609,7 +609,6 @@ bool SharedDatabase::GetInventory(uint32 account_id, char* name, Inventory* inv) name, account_id); auto results = QueryDatabase(query); if (!results.Success()){ - Log.Out(Logs::General, Logs::Error, "GetInventory query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); Log.Out(Logs::General, Logs::Error, "If you got an error related to the 'instnodrop' field, run the following SQL Queries:\nalter table inventory add instnodrop tinyint(1) unsigned default 0 not null;\n"); return false; } From b866b989898da6122efb86c6bc0147988e76585c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:55 -0600 Subject: [PATCH 373/707] Remove Duplicative MySQL Error: Error expiring trash messages, %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index e17606558..8dc44e2d4 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -515,7 +515,6 @@ void Database::ExpireMail() { if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); else - Log.Out(Logs::Detail, Logs::UCS_Server, "Error expiring trash messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } From 8c629529d7c1c02ae1261a80c4646b832158df63 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:56 -0600 Subject: [PATCH 374/707] Remove Duplicative MySQL Error: Error in GetAASkillVars '%s': %s --- zone/aa.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/aa.cpp b/zone/aa.cpp index bad09e266..96f08e328 100644 --- a/zone/aa.cpp +++ b/zone/aa.cpp @@ -1982,7 +1982,6 @@ SendAA_Struct* ZoneDatabase::GetAASkillVars(uint32 skill_id) "FROM altadv_vars a WHERE skill_id=%i", skill_id); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetAASkillVars '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return nullptr; } From 2a3b9b65fc7f0857debc321bc6bd29bd885ef53b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:56 -0600 Subject: [PATCH 375/707] Remove Duplicative MySQL Error: Error in LoadSpawnConditions query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 395bcafc6..4d4ac8538 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -756,7 +756,6 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in zone_name, instance_id); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadSpawnConditions query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); spawn_conditions.clear(); return false; } From dfec624b8d109d394183b98555431c67669b85ba Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:56 -0600 Subject: [PATCH 376/707] Remove Duplicative MySQL Error: Error in EnableRecipe query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 445065e70..04ec6dac5 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1545,7 +1545,6 @@ bool ZoneDatabase::EnableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in EnableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } From 99dd77cff0fd32784bf3ca648575324a32acadfc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:56 -0600 Subject: [PATCH 377/707] Remove Duplicative MySQL Error: Error deleting grid entries '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 0330692da..0f40765ae 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1172,7 +1172,6 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error deleting grid entries '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); From a04aecae0e2e744117e46207829e38685d156e80 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:56 -0600 Subject: [PATCH 378/707] Remove Duplicative MySQL Error: Error in Zone::LoadTickItems: %s (%s) --- zone/zone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 6ef7ec8fd..a89c0b96c 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2250,7 +2250,6 @@ void Zone::LoadTickItems() const std::string query = "SELECT it_itemid, it_chance, it_level, it_qglobal, it_bagslot FROM item_tick"; auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in Zone::LoadTickItems: %s (%s)", query.c_str(), results.ErrorMessage().c_str()); return; } From 06bef2fc6d7bfa96ccc18095201ec04d22959363 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:56 -0600 Subject: [PATCH 379/707] Remove Duplicative MySQL Error: Error in ZoneDatabase::RaidGroupCount query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 79ae28b3d..ca7cdd7be 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2657,7 +2657,6 @@ uint8 ZoneDatabase::RaidGroupCount(uint32 raidid, uint32 groupid) { auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ZoneDatabase::RaidGroupCount query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From ad70e4f051ee0731fd9bd959279a48f04f552704 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:58 -0600 Subject: [PATCH 380/707] Remove Duplicative MySQL Error: Error changing leader on guild %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index f70caf1d8..14235999b 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -608,7 +608,6 @@ bool BaseGuildManager::DBSetGuildLeader(uint32 guild_id, uint32 leader) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error changing leader on guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } From 9d1da53d979cead9343ca2c7bcf351b16d2cd422 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:58 -0600 Subject: [PATCH 381/707] Remove Duplicative MySQL Error: Error in GetItemsCount '%s': '%s' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index da95cabef..287dd88a9 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -711,7 +711,6 @@ void SharedDatabase::GetItemsCount(int32 &item_count, uint32 &max_id) { const std::string query = "SELECT MAX(id), count(*) FROM items"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetItemsCount '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From af0e80fbf3d47fa655b98e1a88ac04907c83fea0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:58 -0600 Subject: [PATCH 382/707] Remove Duplicative MySQL Error: Error expiring read messages, %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 8dc44e2d4..b216c19ab 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -526,7 +526,6 @@ void Database::ExpireMail() { if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i read messages.", results.RowsAffected()); else - Log.Out(Logs::Detail, Logs::UCS_Server, "Error expiring read messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } // Expire Unread From 363a4b95c1ca4f074d8531a35648a04056a2accf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:58 -0600 Subject: [PATCH 383/707] Remove Duplicative MySQL Error: Error in LoadSpawnConditions events query '%s': %s --- zone/spawn2.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 4d4ac8538..77adcddb2 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -773,7 +773,6 @@ bool SpawnConditionManager::LoadSpawnConditions(const char* zone_name, uint32 in "FROM spawn_events WHERE zone = '%s'", zone_name); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadSpawnConditions events query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 75ea162c2bdcf959d8120fb0cd1014fc2b693243 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:59 -0600 Subject: [PATCH 384/707] Remove Duplicative MySQL Error: Error in DisableRecipe query '%s': %s --- zone/tradeskills.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index 04ec6dac5..ec3dd46d3 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1555,7 +1555,6 @@ bool ZoneDatabase::DisableRecipe(uint32 recipe_id) "WHERE id = %u;", recipe_id); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in DisableRecipe query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return results.RowsAffected() > 0; } From 3f75eba5e0dae0dec35d2d0e169b1a8f0e89ca4c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:59 -0600 Subject: [PATCH 385/707] Remove Duplicative MySQL Error: Error adding waypoint '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 0f40765ae..d5052c221 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1187,7 +1187,6 @@ void ZoneDatabase::AddWP(Client *client, uint32 gridid, uint32 wpnum, float xpos gridid, zoneid, wpnum, xpos, ypos, zpos, pause, heading); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error adding waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From e15b551164c9fb8a1b06d12e2aa36bae27659938 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:25:59 -0600 Subject: [PATCH 386/707] Remove Duplicative MySQL Error: Error in LoadAltCurrencyValues query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index ca7cdd7be..873aacbb4 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2816,7 +2816,6 @@ void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::map Date: Mon, 19 Jan 2015 05:26:00 -0600 Subject: [PATCH 387/707] Remove Duplicative MySQL Error: Error setting MOTD for guild %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 14235999b..63ffb0b48 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -651,7 +651,6 @@ bool BaseGuildManager::DBSetGuildMOTD(uint32 guild_id, const char* motd, const c if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error setting MOTD for guild %d '%s': %s", guild_id, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); safe_delete_array(esc_set); return false; From d4c09472804477ded7597582f5d7522f493ec21f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:00 -0600 Subject: [PATCH 388/707] Remove Duplicative MySQL Error: LoadItems '%s', %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 287dd88a9..a500278f4 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -795,7 +795,6 @@ void SharedDatabase::LoadItems(void *data, uint32 size, int32 items, uint32 max_ "updated FROM items ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "LoadItems '%s', %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 729283ad01a7ba06dec9756ce337198344c2632b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:00 -0600 Subject: [PATCH 389/707] Remove Duplicative MySQL Error: Error expiring unread messages, %s %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index b216c19ab..1e23c41da 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -536,7 +536,6 @@ void Database::ExpireMail() { if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); else - Log.Out(Logs::Detail, Logs::UCS_Server, "Error expiring unread messages, %s %s", query.c_str(), results.ErrorMessage().c_str()); } } From 1595395f69a44148c718553f25ab317b80a8d757 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:01 -0600 Subject: [PATCH 390/707] Remove Duplicative MySQL Error: Error deleting waypoint '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index d5052c221..896841ba5 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1212,7 +1212,6 @@ void ZoneDatabase::DeleteWaypoint(Client *client, uint32 grid_num, uint32 wp_num grid_num, zoneid, wp_num); auto results = QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error deleting waypoint '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return; } From fac715012bf6e82bde3ab96386602ac25258ae1d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:01 -0600 Subject: [PATCH 391/707] Remove Duplicative MySQL Error: Error in SaveBuffs query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 873aacbb4..13b49b442 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2856,7 +2856,6 @@ void ZoneDatabase::SaveBuffs(Client *client) { buffs[index].ExtraDIChance); auto results = QueryDatabase(query); if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error in SaveBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); } } From e726c7356aae2096a96689d2bfefeb3bca56f1dd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:02 -0600 Subject: [PATCH 392/707] Remove Duplicative MySQL Error: Error setting URL for guild %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 63ffb0b48..ccb84c342 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -687,7 +687,6 @@ bool BaseGuildManager::DBSetGuildURL(uint32 GuildID, const char* URL) if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error setting URL for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } From beeba6c8be14f9a81880f7ca7fe16979eb1a077f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:02 -0600 Subject: [PATCH 393/707] Remove Duplicative MySQL Error: Error getting npc faction info from database: %s, %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index a500278f4..c8a0281cd 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1086,7 +1086,6 @@ void SharedDatabase::GetFactionListInfo(uint32 &list_count, uint32 &max_lists) { const std::string query = "SELECT COUNT(*), MAX(id) FROM npc_faction"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 6f48d84b82762c6e2c01e86b82f0b0a99f17e522 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:02 -0600 Subject: [PATCH 394/707] Remove Duplicative MySQL Error: Error adding friend/ignore, query was %s : %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 1e23c41da..3afad470c 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -546,7 +546,6 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::Detail, Logs::UCS_Server, "Error adding friend/ignore, query was %s : %s", query.c_str(), results.ErrorMessage().c_str()); else Log.Out(Logs::Detail, Logs::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); From e5dd2634f9032397b30cdfa2596d12c6c50d9bd5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:02 -0600 Subject: [PATCH 395/707] Remove Duplicative MySQL Error: Error setting pathgrid '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 896841ba5..8a8f1bb9d 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1238,7 +1238,6 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, auto results = QueryDatabase(query); if (!results.Success()) { // Query error - Log.Out(Logs::General, Logs::Error, "Error setting pathgrid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 4de2c0e99bbccd44a9dd29b111910ae5d8c87b2e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:02 -0600 Subject: [PATCH 396/707] Remove Duplicative MySQL Error: Error in LoadBuffs query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 13b49b442..620a6eab9 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2874,7 +2874,6 @@ void ZoneDatabase::LoadBuffs(Client *client) { "FROM `character_buffs` WHERE `character_id` = '%u'", client->CharacterID()); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadBuffs query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 6753517bb133bb817563fb866b3594bdb81c7433 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:03 -0600 Subject: [PATCH 397/707] Remove Duplicative MySQL Error: Error setting Channel for guild %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index ccb84c342..2888dec37 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -721,7 +721,6 @@ bool BaseGuildManager::DBSetGuildChannel(uint32 GuildID, const char* Channel) if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error setting Channel for guild %d '%s': %s", GuildID, query.c_str(), results.ErrorMessage().c_str()); safe_delete_array(esc); return(false); } From f43211afad9fb6b63e466f2c131cc00e7f4285ad Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:03 -0600 Subject: [PATCH 398/707] Remove Duplicative MySQL Error: Error getting npc faction info from database: %s, %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index c8a0281cd..9a3395e89 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1120,7 +1120,6 @@ void SharedDatabase::LoadNPCFactionLists(void *data, uint32 size, uint32 list_co "ON npc_faction.id = npc_faction_entries.npc_faction_id ORDER BY npc_faction.id;"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error getting npc faction info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 056b172d7dc8311f97adf00a257d98b4e93cd3db Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:03 -0600 Subject: [PATCH 399/707] Remove Duplicative MySQL Error: GetFriendsAndIgnore query error %s, %s --- ucs/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 3afad470c..507e8ad30 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -569,7 +569,6 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends std::string query = StringFormat("select `type`, `name` FROM `friends` WHERE `charid`=%i", charID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "GetFriendsAndIgnore query error %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 9003276f23edee6218aaa0d5d39ed41a7d8b306c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:04 -0600 Subject: [PATCH 400/707] Remove Duplicative MySQL Error: Error adding grid '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 8a8f1bb9d..ede727c68 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1258,7 +1258,6 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, type1, type2); results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error adding grid '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); From 02d034b046b247fdfedc5a7e821f254e995be2cf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:04 -0600 Subject: [PATCH 401/707] Remove Duplicative MySQL Error: Error in LoadPetInfo query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 620a6eab9..a496ea636 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3047,7 +3047,6 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); auto results = database.QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 5df58973a83b8c28ba609d7fd14a284990bb12f1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:05 -0600 Subject: [PATCH 402/707] Remove Duplicative MySQL Error: Error Changing char %d to guild %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 2888dec37..c69966a38 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -746,7 +746,6 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error Changing char %d to guild %d '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } From b8f7d88219bd2bdf3f90a93891a75b7c3c352a33 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:05 -0600 Subject: [PATCH 403/707] Remove Duplicative MySQL Error: Error in LoadDamageShieldTypes: %s %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 9a3395e89..a8e83f2f2 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1449,7 +1449,6 @@ void SharedDatabase::LoadDamageShieldTypes(SPDat_Spell_Struct* sp, int32 iMaxSpe "AND `spellid` <= %i", iMaxSpellID); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadDamageShieldTypes: %s %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 05aba517c2f4bfce1cfc118b266dd6a095c90885 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:05 -0600 Subject: [PATCH 404/707] Remove Duplicative MySQL Error: Error updating spawn2 pathing '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index ede727c68..99c46e959 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1264,7 +1264,6 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error updating spawn2 pathing '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); } From f7f34d8d30957ac500386edfa22033c5d0f6b4f2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:05 -0600 Subject: [PATCH 405/707] Remove Duplicative MySQL Error: Error in LoadPetInfo query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index a496ea636..be8406061 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3074,7 +3074,6 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id` = %u", client->CharacterID()); results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 6ae05eef383e6c3145bb79be8eb07417ec14874c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:06 -0600 Subject: [PATCH 406/707] Remove Duplicative MySQL Error: Error removing char %d from guild '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index c69966a38..48f061188 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -754,7 +754,6 @@ bool BaseGuildManager::DBSetGuild(uint32 charid, uint32 guild_id, uint8 rank) { auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error removing char %d from guild '%s': %s", charid, guild_id, query.c_str(), results.ErrorMessage().c_str()); return false; } } From 626aa140da0dec0ca8e4e7f3a10fc616bc6e01e8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:06 -0600 Subject: [PATCH 407/707] Remove Duplicative MySQL Error: Error in GetMaxSpellID query '%s' %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index a8e83f2f2..afbeca18f 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1468,7 +1468,6 @@ int SharedDatabase::GetMaxSpellID() { std::string query = "SELECT MAX(id) FROM spells_new"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Spells, "Error in GetMaxSpellID query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } From ca53c408991b90e86db9533ff4bc6ea878fd22c6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:06 -0600 Subject: [PATCH 408/707] Remove Duplicative MySQL Error: Error getting next waypoint id '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 99c46e959..6fe4aa82a 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1275,7 +1275,6 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, results = QueryDatabase(query); if(!results.Success()) { // Query error - Log.Out(Logs::General, Logs::Error, "Error getting next waypoint id '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 6cde9697800136ba0530461d5292c2b48d261b18 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:06 -0600 Subject: [PATCH 409/707] Remove Duplicative MySQL Error: Error in LoadPetInfo query '%s': %s --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index be8406061..248f6a55b 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3114,7 +3114,6 @@ void ZoneDatabase::LoadPetInfo(Client *client) { "WHERE `char_id`=%u",client->CharacterID()); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadPetInfo query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return; } From bf7c40d7a58821735f9fd13ae26b9026a7eedf24 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:07 -0600 Subject: [PATCH 410/707] Remove Duplicative MySQL Error: Error retrieving banker flag '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 48f061188..253d60f0f 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -781,7 +781,6 @@ bool BaseGuildManager::GetBankerFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error retrieving banker flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 27d16a0a3e07bcf837cee6f71091aca3f16fffa8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:07 -0600 Subject: [PATCH 411/707] Remove Duplicative MySQL Error: Error in LoadSpells query '%s' %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index afbeca18f..adc6da7c4 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1482,7 +1482,6 @@ void SharedDatabase::LoadSpells(void *data, int max_spells) { const std::string query = "SELECT * FROM spells_new ORDER BY id ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Spells, "Error in LoadSpells query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 2ef8f793388aa6a488d33a2d99b51c15f8904366 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:08 -0600 Subject: [PATCH 412/707] Remove Duplicative MySQL Error: Error adding grid entry '%s': '%s' --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 6fe4aa82a..dde7aebb1 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1289,7 +1289,6 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); if(!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error adding grid entry '%s': '%s'", query.c_str(), results.ErrorMessage().c_str()); else if(client) client->LogSQL(query.c_str()); From 3f3368e60c1a6b31fe88d9fb7970b6324b7339b3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:08 -0600 Subject: [PATCH 413/707] Remove Duplicative MySQL Error: Error retrieving alt flag '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 253d60f0f..6d9c92c3d 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -811,7 +811,6 @@ bool BaseGuildManager::GetAltFlag(uint32 CharID) auto results = m_db->QueryDatabase(query); if(!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error retrieving alt flag '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From b603344ecd5f27ec3fe9dbb3c6cfd51f5ca37a50 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:09 -0600 Subject: [PATCH 414/707] Remove Duplicative MySQL Error: Error in GetMaxBaseDataLevel query '%s' %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index adc6da7c4..c54e5edcf 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1642,7 +1642,6 @@ int SharedDatabase::GetMaxBaseDataLevel() { const std::string query = "SELECT MAX(level) FROM base_data"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetMaxBaseDataLevel query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return -1; } From 499364e9fe457d6666f57b2305280492f82538c7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:09 -0600 Subject: [PATCH 415/707] Remove Duplicative MySQL Error: Error in GetFreeGrid query '%s': %s --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index dde7aebb1..b659c8d64 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1300,7 +1300,6 @@ uint32 ZoneDatabase::GetFreeGrid(uint16 zoneid) { std::string query = StringFormat("SELECT max(id) FROM grid WHERE zoneid = %i", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetFreeGrid query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 85659dd200ab4e1a46baa97d413ca2ce2b269cfd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:10 -0600 Subject: [PATCH 416/707] Remove Duplicative MySQL Error: Error setting public note for char %d '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 6d9c92c3d..43b597cad 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -846,7 +846,6 @@ bool BaseGuildManager::DBSetPublicNote(uint32 charid, const char* note) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error setting public note for char %d '%s': %s", charid, query.c_str(), results.ErrorMessage().c_str()); return false; } From 1e30a75cdccf8406dcc585c92ba9583ff2ca2486 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:10 -0600 Subject: [PATCH 417/707] Remove Duplicative MySQL Error: Error in LoadBaseData query '%s' %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index c54e5edcf..a817af146 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1687,7 +1687,6 @@ void SharedDatabase::LoadBaseData(void *data, int max_level) { const std::string query = "SELECT * FROM base_data ORDER BY level, class ASC"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in LoadBaseData query '%s' %s", query.c_str(), results.ErrorMessage().c_str()); return; } From cacf9df26910b4f10371e6c0c2ceff5f671d1696 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:10 -0600 Subject: [PATCH 418/707] Remove Duplicative MySQL Error: Error in GetHighestWaypoint query '%s': %s --- zone/waypoints.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index b659c8d64..e2c72c1bf 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1319,7 +1319,6 @@ int ZoneDatabase::GetHighestWaypoint(uint32 zoneid, uint32 gridid) { "WHERE zoneid = %i AND gridid = %i", zoneid, gridid); auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in GetHighestWaypoint query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From 315f5e0ca492f979f406f3cf6604a48c77ddd15b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:13 -0600 Subject: [PATCH 419/707] Remove Duplicative MySQL Error: Error %s: '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 43b597cad..80c5ca755 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -862,7 +862,6 @@ bool BaseGuildManager::QueryWithLogging(std::string query, const char *errmsg) { if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error %s: '%s': %s", errmsg, query.c_str(), results.ErrorMessage().c_str()); return(false); } From 9ad299fa68d11392e74a63a94f0a60f509184660 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:13 -0600 Subject: [PATCH 420/707] Remove Duplicative MySQL Error: Error getting loot table info from database: %s, %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index a817af146..2695251c0 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1766,7 +1766,6 @@ void SharedDatabase::GetLootTableInfo(uint32 &loot_table_count, uint32 &max_loot const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM loottable_entries) FROM loottable"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 417777a6f1eec6b030eac036508a2db5af456bf9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:15 -0600 Subject: [PATCH 421/707] Remove Duplicative MySQL Error: Error loading guild member list '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 80c5ca755..97241d693 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -919,7 +919,6 @@ bool BaseGuildManager::GetEntireGuild(uint32 guild_id, std::vectorQueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild member list '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From f4e74705cfdf2f9d61bd249f93e42cbeabef9195 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:15 -0600 Subject: [PATCH 422/707] Remove Duplicative MySQL Error: Error getting loot table info from database: %s, %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 2695251c0..701579857 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1787,7 +1787,6 @@ void SharedDatabase::GetLootDropInfo(uint32 &loot_drop_count, uint32 &max_loot_d const std::string query = "SELECT COUNT(*), MAX(id), (SELECT COUNT(*) FROM lootdrop_entries) FROM lootdrop"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 28285d6c595db27ecff41a07f270e34964c982ef Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:16 -0600 Subject: [PATCH 423/707] Remove Duplicative MySQL Error: Error loading guild member '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 97241d693..08b0af1d2 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -949,7 +949,6 @@ bool BaseGuildManager::GetCharInfo(const char *char_name, CharGuildInfo &into) { safe_delete_array(esc); auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From 5930510274fe22560c950b7f89abadf9b4782659 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:17 -0600 Subject: [PATCH 424/707] Remove Duplicative MySQL Error: Error getting loot table info from database: %s, %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 701579857..880b8f42a 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1812,7 +1812,6 @@ void SharedDatabase::LoadLootTables(void *data, uint32 size) { "ON loottable.id = loottable_entries.loottable_id ORDER BY id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error getting loot table info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); return; } From 7c52755eac37b216d03bf55769357c73f86a0b3c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:18 -0600 Subject: [PATCH 425/707] Remove Duplicative MySQL Error: Error loading guild member '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 08b0af1d2..006996e27 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -979,7 +979,6 @@ bool BaseGuildManager::GetCharInfo(uint32 char_id, CharGuildInfo &into) { #endif auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error loading guild member '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return false; } From d608b5afd6dede1a66e4921973e8eccff6f02711 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:18 -0600 Subject: [PATCH 426/707] Remove Duplicative MySQL Error: Error getting loot drop info from database: %s, %s --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 880b8f42a..eec7dc0f5 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1865,7 +1865,6 @@ void SharedDatabase::LoadLootDrops(void *data, uint32 size) { "ON lootdrop.id = lootdrop_entries.lootdrop_id ORDER BY lootdrop_id"; auto results = QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error getting loot drop info from database: %s, %s", query.c_str(), results.ErrorMessage().c_str()); } uint32 current_id = 0; From e4200abc4f43fd5b205dc485eae9af81a1f271b3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:26:19 -0600 Subject: [PATCH 427/707] Remove Duplicative MySQL Error: Error executing query '%s': %s --- common/guild_base.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 006996e27..64020971a 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -1223,7 +1223,6 @@ uint32 BaseGuildManager::DoesAccountContainAGuildLeader(uint32 AccountID) auto results = m_db->QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::Detail, Logs::Guilds, "Error executing query '%s': %s", query.c_str(), results.ErrorMessage().c_str()); return 0; } From f20ff5c6e3f6c8ada4adbc60ea854c1f3eeff014 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:32:34 -0600 Subject: [PATCH 428/707] Cleanup of some QueryDatabase references that no longer need auto results --- common/database.cpp | 6 ------ common/guild_base.cpp | 4 ---- common/rulesys.cpp | 1 - queryserv/lfguild.cpp | 4 ---- ucs/database.cpp | 12 +++--------- 5 files changed, 3 insertions(+), 24 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index c0f578f2a..f3122d458 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -734,12 +734,6 @@ bool Database::StoreCharacter(uint32 account_id, PlayerProfile_Struct* pp, Inven charid, i, newinv->GetItem()->ID, newinv->GetCharges(), newinv->GetColor()); auto results = QueryDatabase(invquery); - - if (!results.RowsAffected()) -#if EQDEBUG >= 9 - else - Log.Out(Logs::General, Logs::None,, "StoreCharacter inventory succeeded. Query '%s'", invquery.c_str()); -#endif } if (i == MainCursor) { diff --git a/common/guild_base.cpp b/common/guild_base.cpp index 64020971a..1416dedf1 100644 --- a/common/guild_base.cpp +++ b/common/guild_base.cpp @@ -231,14 +231,10 @@ bool BaseGuildManager::_StoreGuildDB(uint32 guild_id) { //clear out old `guilds` entry auto results = m_db->QueryDatabase(query); - if (!results.Success()) - //clear out old `guild_ranks` entries query = StringFormat("DELETE FROM guild_ranks WHERE guild_id=%lu", (unsigned long)guild_id); results = m_db->QueryDatabase(query); - if (!results.Success()) - //escape our strings. char *name_esc = new char[info->name.length()*2+1]; char *motd_esc = new char[info->motd.length()*2+1]; diff --git a/common/rulesys.cpp b/common/rulesys.cpp index 97d5a96ad..a53dbcabe 100644 --- a/common/rulesys.cpp +++ b/common/rulesys.cpp @@ -312,7 +312,6 @@ void RuleManager::_SaveRule(Database *db, RuleType type, uint16 index) { " VALUES(%d, '%s', '%s')", m_activeRuleset, _GetRuleName(type, index), vstr); auto results = db->QueryDatabase(query); - if (!results.Success()) } diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 2f395c97a..340321f06 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -240,7 +240,6 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); auto results = database.QueryDatabase(query); - if(!results.Success()) uint32 Now = time(nullptr); @@ -254,7 +253,6 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char "VALUES (0, '%s', '%s', %u, 0, %u, %u, %u, %u)", From, Comments, Level, Class, AAPoints, TimeZone, Now); auto results = database.QueryDatabase(query); - if(!results.Success()) } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -284,7 +282,6 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); auto results = database.QueryDatabase(query); - if(!results.Success()) uint32 Now = time(nullptr); @@ -300,7 +297,6 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char GuildName, Comments, FromLevel, ToLevel, Classes, AACount, TimeZone, Now); auto results = database.QueryDatabase(query); - if(!results.Success()) } diff --git a/ucs/database.cpp b/ucs/database.cpp index 507e8ad30..fbbfdeac6 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -268,9 +268,7 @@ void Database::SetChannelPassword(std::string channelName, std::string password) std::string query = StringFormat("UPDATE `chatchannels` SET `password` = '%s' WHERE `name` = '%s'", password.c_str(), channelName.c_str()); - auto results = QueryDatabase(query); - if(!results.Success()) - + QueryDatabase(query); } void Database::SetChannelOwner(std::string channelName, std::string owner) { @@ -279,9 +277,7 @@ void Database::SetChannelOwner(std::string channelName, std::string owner) { std::string query = StringFormat("UPDATE `chatchannels` SET `owner` = '%s' WHERE `name` = '%s'", owner.c_str(), channelName.c_str()); - auto results = QueryDatabase(query); - if(!results.Success()) - + QueryDatabase(query); } void Database::SendHeaders(Client *client) { @@ -488,9 +484,7 @@ void Database::SetMessageStatus(int messageNumber, int status) { } std::string query = StringFormat("UPDATE `mail` SET `status` = %i WHERE `msgid`=%i", status, messageNumber); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } void Database::ExpireMail() { From 5ab131dcd675c1504caf51b2559f97310e08760c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:35:28 -0600 Subject: [PATCH 429/707] More cleanup of some QueryDatabase references that no longer need auto results --- ucs/database.cpp | 7 +------ world/adventure.cpp | 3 +-- zone/petitions.cpp | 2 -- zone/spawn2.cpp | 8 ++------ zone/tasks.cpp | 4 +--- zone/tradeskills.cpp | 3 +-- 6 files changed, 6 insertions(+), 21 deletions(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index fbbfdeac6..7cd5b7d09 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -508,8 +508,6 @@ void Database::ExpireMail() { results = QueryDatabase(query); if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i trash messages.", results.RowsAffected()); - else - } // Expire Read @@ -519,7 +517,6 @@ void Database::ExpireMail() { results = QueryDatabase(query); if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i read messages.", results.RowsAffected()); - else } // Expire Unread @@ -529,7 +526,6 @@ void Database::ExpireMail() { results = QueryDatabase(query); if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Expired %i unread messages.", results.RowsAffected()); - else } } @@ -539,8 +535,7 @@ void Database::AddFriendOrIgnore(int charID, int type, std::string name) { "VALUES('%i', %i, '%s')", charID, type, CapitaliseName(name).c_str()); auto results = QueryDatabase(query); - if(!results.Success()) - else + if(results.Success()) Log.Out(Logs::Detail, Logs::UCS_Server, "Wrote Friend/Ignore entry for charid %i, type %i, name %s to database.", charID, type, name.c_str()); } diff --git a/world/adventure.cpp b/world/adventure.cpp index e0a5aae18..40becd855 100644 --- a/world/adventure.cpp +++ b/world/adventure.cpp @@ -402,8 +402,7 @@ void Adventure::MoveCorpsesToGraveyard() "x = %f, y = %f, z = %f WHERE instanceid = %d", GetTemplate()->graveyard_zone_id, x, y, z, GetInstanceID()); - auto results = database.QueryDatabase(query); - if(!results.Success()) + database.QueryDatabase(query); } auto c_iter = charid_list.begin(); diff --git a/zone/petitions.cpp b/zone/petitions.cpp index 2d810564d..bcca6aabf 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -212,8 +212,6 @@ void ZoneDatabase::DeletePetitionFromDB(Petition* wpet) { std::string query = StringFormat("DELETE FROM petitions WHERE petid = %i", wpet->GetID()); auto results = QueryDatabase(query); - if (!results.Success()) - } void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { diff --git a/zone/spawn2.cpp b/zone/spawn2.cpp index 77adcddb2..6fc314a11 100644 --- a/zone/spawn2.cpp +++ b/zone/spawn2.cpp @@ -668,9 +668,7 @@ void SpawnConditionManager::UpdateDBEvent(SpawnEvent &event) { event.next.day, event.next.month, event.next.year, event.enabled? 1: 0, event.strict? 1: 0, event.id); - auto results = database.QueryDatabase(query); - if(!results.Success()) - + database.QueryDatabase(query); } void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 instance_id, uint16 cond_id, int16 value) { @@ -679,9 +677,7 @@ void SpawnConditionManager::UpdateDBCondition(const char* zone_name, uint32 inst "(id, value, zone, instance_id) " "VALUES( %u, %u, '%s', %u)", cond_id, value, zone_name, instance_id); - auto results = database.QueryDatabase(query); - if(!results.Success()) - + database.QueryDatabase(query); } bool SpawnConditionManager::LoadDBEvent(uint32 event_id, SpawnEvent &event, std::string &zone_name) { diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 0673e51c8..fbc5ae3b5 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -723,9 +723,7 @@ void ClientTaskState::EnableTask(int characterID, int taskCount, int *tasks) { std::string query = queryStream.str(); Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Executing query %s", query.c_str()); - auto results = database.QueryDatabase(query); - if(!results.Success()) - + database.QueryDatabase(query); } void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) { diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index ec3dd46d3..a973f9a97 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1457,8 +1457,7 @@ void ZoneDatabase::UpdateRecipeMadecount(uint32 recipe_id, uint32 char_id, uint3 "SET recipe_id = %u, char_id = %u, madecount = %u " "ON DUPLICATE KEY UPDATE madecount = %u;", recipe_id, char_id, madeCount, madeCount); - auto results = QueryDatabase(query); - if (!results.Success()) + QueryDatabase(query); } void Client::LearnRecipe(uint32 recipeID) From 99baba47620ceddd3f6f3b26c01cee87f34030c0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:38:23 -0600 Subject: [PATCH 430/707] More cleanup of some QueryDatabase references that no longer need auto results --- zone/petitions.cpp | 2 -- zone/pets.cpp | 3 +-- zone/tasks.cpp | 3 +-- zone/tradeskills.cpp | 2 -- zone/trading.cpp | 4 +--- zone/waypoints.cpp | 6 ------ 6 files changed, 3 insertions(+), 17 deletions(-) diff --git a/zone/petitions.cpp b/zone/petitions.cpp index bcca6aabf..3e8a836e2 100644 --- a/zone/petitions.cpp +++ b/zone/petitions.cpp @@ -223,8 +223,6 @@ void ZoneDatabase::UpdatePetitionToDB(Petition* wpet) { wpet->GetCheckouts(), wpet->GetUnavails(), wpet->CheckedOut() ? 1: 0, wpet->GetID()); auto results = QueryDatabase(query); - if (!results.Success()) - } void ZoneDatabase::InsertPetitionToDB(Petition* wpet) diff --git a/zone/pets.cpp b/zone/pets.cpp index 8415dbe9d..22fa379ce 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -669,8 +669,7 @@ bool ZoneDatabase::GetBasePetItems(int32 equipmentset, uint32 *items) { query = StringFormat("SELECT slot, item_id FROM pets_equipmentset_entries WHERE set_id='%s'", curset); results = QueryDatabase(query); - if (!results.Success()) - else { + if (results.Success()){ for (row = results.begin(); row != results.end(); ++row) { slot = atoi(row[0]); diff --git a/zone/tasks.cpp b/zone/tasks.cpp index fbc5ae3b5..203950104 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -769,8 +769,7 @@ void ClientTaskState::DisableTask(int charID, int taskCount, int *taskList) { queryStream << ")"; std::string query = queryStream.str(); Log.Out(Logs::General, Logs::Tasks, "[UPDATE] Executing query %s", query.c_str()); - auto results = database.QueryDatabase(query); - if(!results.Success()) + database.QueryDatabase(query); } bool ClientTaskState::IsTaskEnabled(int TaskID) { diff --git a/zone/tradeskills.cpp b/zone/tradeskills.cpp index a973f9a97..07ae6d2a5 100644 --- a/zone/tradeskills.cpp +++ b/zone/tradeskills.cpp @@ -1494,8 +1494,6 @@ void Client::LearnRecipe(uint32 recipeID) "ON DUPLICATE KEY UPDATE madecount = madecount;", recipeID, CharacterID()); results = database.QueryDatabase(query); - if (!results.Success()) - } bool Client::CanIncreaseTradeskill(SkillUseTypes tradeskill) { diff --git a/zone/trading.cpp b/zone/trading.cpp index d06cf2f9d..24215248e 100644 --- a/zone/trading.cpp +++ b/zone/trading.cpp @@ -1476,9 +1476,7 @@ static void BazaarAuditTrail(const char *seller, const char *buyer, const char * "(`time`, `seller`, `buyer`, `itemname`, `quantity`, `totalcost`, `trantype`) " "VALUES (NOW(), '%s', '%s', '%s', %i, %i, %i)", seller, buyer, itemName, quantity, totalCost, tranType); - auto results = database.QueryDatabase(query); - if(!results.Success()) - + database.QueryDatabase(query); } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index e2c72c1bf..1214fa243 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1165,15 +1165,9 @@ void ZoneDatabase::ModifyGrid(Client *client, bool remove, uint32 id, uint8 type std::string query = StringFormat("DELETE FROM grid where id=%i", id); auto results = QueryDatabase(query); - if (!results.Success()) - else if(client) - client->LogSQL(query.c_str()); query = StringFormat("DELETE FROM grid_entries WHERE zoneid = %i AND gridid = %i", zoneid, id); results = QueryDatabase(query); - if(!results.Success()) - else if(client) - client->LogSQL(query.c_str()); } From 98a49ad0867f8f39ce9198c43611e072aadb2c1f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:39:51 -0600 Subject: [PATCH 431/707] More cleanup of some QueryDatabase references that no longer need auto results --- zone/titles.cpp | 4 +--- zone/waypoints.cpp | 14 +++----------- zone/zonedb.cpp | 4 +--- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/zone/titles.cpp b/zone/titles.cpp index 3c28e2417..3a4162060 100644 --- a/zone/titles.cpp +++ b/zone/titles.cpp @@ -376,8 +376,6 @@ void Client::RemoveTitle(int titleSet) { std::string query = StringFormat("DELETE FROM player_titlesets " "WHERE `title_set` = %i AND `char_id` = %i", titleSet, CharacterID()); - auto results = database.QueryDatabase(query); - if (!results.Success()) - + database.QueryDatabase(query); } diff --git a/zone/waypoints.cpp b/zone/waypoints.cpp index 1214fa243..20662c394 100644 --- a/zone/waypoints.cpp +++ b/zone/waypoints.cpp @@ -1250,16 +1250,11 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, query = StringFormat("INSERT INTO grid SET id = '%i', zoneid = %i, type ='%i', type2 = '%i'", grid_num, zoneid, type1, type2); - results = QueryDatabase(query); - if(!results.Success()) - else if(client) - client->LogSQL(query.c_str()); + QueryDatabase(query); query = StringFormat("UPDATE spawn2 SET pathgrid = '%i' WHERE id = '%i'", grid_num, spawn2id); - results = QueryDatabase(query); - if(!results.Success()) - else if(client) - client->LogSQL(query.c_str()); + QueryDatabase(query); + } else // NPC had a grid assigned to it createdNewGrid = false; @@ -1282,9 +1277,6 @@ uint32 ZoneDatabase::AddWPForSpawn(Client *client, uint32 spawn2id, float xpos, "VALUES (%i, %i, %i, %f, %f, %f, %i, %f)", grid_num, zoneid, next_wp_num, xpos, ypos, zpos, pause, heading); results = QueryDatabase(query); - if(!results.Success()) - else if(client) - client->LogSQL(query.c_str()); return createdNewGrid? grid_num: 0; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 248f6a55b..613732275 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -248,9 +248,7 @@ uint32 ZoneDatabase::GetSpawnTimeLeft(uint32 id, uint16 instance_id) void ZoneDatabase::UpdateSpawn2Status(uint32 id, uint8 new_status) { std::string query = StringFormat("UPDATE spawn2 SET enabled = %i WHERE id = %lu", new_status, (unsigned long)id); - auto results = QueryDatabase(query); - if(!results.Success()) - + QueryDatabase(query); } bool ZoneDatabase::logevents(const char* accountname,uint32 accountid,uint8 status,const char* charname, const char* target,const char* descriptiontype, const char* description,int event_nid){ From acb677a4ba4005715e86855496d6a03087c8b344 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:40:27 -0600 Subject: [PATCH 432/707] More cleanup of some QueryDatabase references that no longer need auto results --- zone/client.cpp | 2 -- zone/zonedb.cpp | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 3aaa23621..3190f7657 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -5382,14 +5382,12 @@ bool Client::TryReward(uint32 claim_id) { "WHERE account_id = %i AND reward_id = %i", AccountID(), claim_id); auto results = database.QueryDatabase(query); - if(!results.Success()) } else { query = StringFormat("UPDATE account_rewards SET amount = (amount-1) " "WHERE account_id = %i AND reward_id = %i", AccountID(), claim_id); auto results = database.QueryDatabase(query); - if(!results.Success()) } InternalVeteranReward ivr = (*iter); diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 613732275..e2e6689b0 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2852,9 +2852,7 @@ void ZoneDatabase::SaveBuffs(Client *client) { buffs[index].magic_rune, buffs[index].persistant_buff, buffs[index].dot_rune, buffs[index].caston_x, buffs[index].caston_y, buffs[index].caston_z, buffs[index].ExtraDIChance); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } } From 99dc83a9fd22affaab378dde2194585a75049ee4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:58:03 -0600 Subject: [PATCH 433/707] Convert MySQL Error logging to EQEmuLogSys and create MySQL Error category --- common/dbcore.cpp | 7 ++----- common/eqemu_logsys.h | 2 ++ 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 7570fd01e..d1ae89d32 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -3,6 +3,7 @@ #endif #include "../common/misc_functions.h" +#include "../common/eqemu_logsys.h" #include "dbcore.h" @@ -115,11 +116,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo /* Implement Logging at the Root */ if (mysql_errno(&mysql) > 0 && strlen(query) > 0){ - std::cout << "\n[MYSQL ERR] " << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << " [Query]: \n" << query << "\n" << std::endl; - /* Write to log file */ - std::ofstream log("eqemu_query_error_log.txt", std::ios_base::app | std::ios_base::out); - log << "[MYSQL ERR] " << mysql_error(&mysql) << "\n" << query << "\n"; - log.close(); + Log.Out(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query); } return MySQLRequestResult(nullptr, 0, 0, 0, 0, mysql_errno(&mysql),errorBuffer); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 26a80392f..737c42f38 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -74,6 +74,7 @@ namespace Logs{ WebInterface_Server, World_Server, Zone_Server, + MySQLError, MaxCategoryID /* Don't Remove this*/ }; @@ -114,6 +115,7 @@ namespace Logs{ "WebInterface Server", "World Server", "Zone Server", + "MySQL Error", }; } From 954602310158df2e6f4316db65c45870a4ebff19 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 05:58:59 -0600 Subject: [PATCH 434/707] Add console color for MySQL Error logging --- common/eqemu_logsys.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 468529cda..99daae831 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -126,6 +126,7 @@ uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ return Console::Color::Yellow; case Logs::Normal: return Console::Color::Yellow; + case Logs::MySQLError: case Logs::Error: return Console::Color::LightRed; case Logs::Debug: From 45560f6654b147703ba4e90e293e6ce292c0b709 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 23:48:30 -0600 Subject: [PATCH 435/707] Remove some old MySQL logging for errors --- common/dbcore.cpp | 4 ---- world/net.cpp | 14 ++++---------- zone/net.cpp | 2 +- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index d1ae89d32..948490c7c 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -110,10 +110,6 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo char *errorBuffer = new char[MYSQL_ERRMSG_SIZE]; snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql)); -#ifdef _EQDEBUG - std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl; -#endif - /* Implement Logging at the Root */ if (mysql_errno(&mysql) > 0 && strlen(query) > 0){ Log.Out(Logs::General, Logs::MySQLError, "%i: %s \n %s", mysql_errno(&mysql), mysql_error(&mysql), query); diff --git a/world/net.cpp b/world/net.cpp index a4e560477..d78aeecf7 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -113,7 +113,6 @@ void CatchSignal(int sig_num); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformWorld); - Log.LoadLogSettingsDefaults(); set_exception_handler(); /* Database Version Check */ @@ -183,6 +182,9 @@ int main(int argc, char** argv) { } guild_mgr.SetDatabase(&database); + Log.LoadLogSettingsDefaults(); + database.LoadLogSysSettings(Log.log_settings); + if (argc >= 2) { char tmp[2]; if (strcasecmp(argv[1], "help") == 0 || strcasecmp(argv[1], "?") == 0 || strcasecmp(argv[1], "/?") == 0 || strcasecmp(argv[1], "-?") == 0 || strcasecmp(argv[1], "-h") == 0 || strcasecmp(argv[1], "-help") == 0) { @@ -446,21 +448,13 @@ int main(int argc, char** argv) { //check for timeouts in other threads timeout_manager.CheckTimeouts(); - loginserverlist.Process(); - console_list.Process(); - zoneserver_list.Process(); - launcher_list.Process(); - UCSLink.Process(); - QSLink.Process(); - - LFPGroupList.Process(); - + LFPGroupList.Process(); adventure_manager.Process(); if (InterserverTimer.Check()) { diff --git a/zone/net.cpp b/zone/net.cpp index 579f9d342..8fe7f2a74 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -168,7 +168,7 @@ int main(int argc, char** argv) { /* Register Log System and Settings */ Log.LoadLogSettingsDefaults(); Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSysSettings(Log.log_settings); /* Guilds */ guild_mgr.SetDatabase(&database); From f239b113b932a99d141deb0110c1781f83efe07b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 23:52:11 -0600 Subject: [PATCH 436/707] Add MySQL query category --- common/eqemu_logsys.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 737c42f38..0a8cd324b 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -75,6 +75,7 @@ namespace Logs{ World_Server, Zone_Server, MySQLError, + MySQLQuery, MaxCategoryID /* Don't Remove this*/ }; @@ -116,6 +117,7 @@ namespace Logs{ "World Server", "Zone Server", "MySQL Error", + "MySQL Query", }; } From 1928be9dd3067410632206181c4d154976a6bce8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 19 Jan 2015 23:59:59 -0600 Subject: [PATCH 437/707] Remove some old MySQL logging for errors --- common/dbcore.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 948490c7c..506a9efb7 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -102,8 +102,6 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo snprintf(errorBuffer, MYSQL_ERRMSG_SIZE, "#%i: %s", mysql_errno(&mysql), mysql_error(&mysql)); - std::cout << "DB Query Error #" << mysql_errno(&mysql) << ": " << mysql_error(&mysql) << std::endl; - return MySQLRequestResult(nullptr, 0, 0, 0, 0, (uint32)mysql_errno(&mysql), errorBuffer); } From 1ad210ff29faa36b6f6e650b4a43516cab673cce Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 00:14:18 -0600 Subject: [PATCH 438/707] Add MySQL Query logging at root --- common/dbcore.cpp | 2 ++ common/eqemu_logsys.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 506a9efb7..85cb768ce 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -126,6 +126,8 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql)); + Log.Out(Logs::General, Logs::MySQLQuery, "%s", query); + #if DEBUG_MYSQL_QUERIES >= 1 if (requestResult.Success()) { diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 99daae831..91a0d7304 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -123,12 +123,12 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ switch (log_category) { case Logs::Status: - return Console::Color::Yellow; case Logs::Normal: return Console::Color::Yellow; case Logs::MySQLError: case Logs::Error: return Console::Color::LightRed; + case Logs::MySQLQuery: case Logs::Debug: return Console::Color::LightGreen; case Logs::Quests: From 4a6305f8cb48f89afd55b67f3ff30f149faa8784 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 00:21:00 -0600 Subject: [PATCH 439/707] MySQL Query Logging add rows returned --- common/dbcore.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index 85cb768ce..ab26e5b8b 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -126,7 +126,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql)); - Log.Out(Logs::General, Logs::MySQLQuery, "%s", query); + Log.Out(Logs::General, Logs::MySQLQuery, "(%u rows returned) %s", rowCount, query); #if DEBUG_MYSQL_QUERIES >= 1 if (requestResult.Success()) From 4c18b96aa5258049201641199a1f8de8f0da607b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 00:25:14 -0600 Subject: [PATCH 440/707] Remove some old MySQL debugging --- common/dbcore.cpp | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/common/dbcore.cpp b/common/dbcore.cpp index ab26e5b8b..4f95fba3f 100644 --- a/common/dbcore.cpp +++ b/common/dbcore.cpp @@ -126,22 +126,7 @@ MySQLRequestResult DBcore::QueryDatabase(const char* query, uint32 querylen, boo MySQLRequestResult requestResult(res, (uint32)mysql_affected_rows(&mysql), rowCount, (uint32)mysql_field_count(&mysql), (uint32)mysql_insert_id(&mysql)); - Log.Out(Logs::General, Logs::MySQLQuery, "(%u rows returned) %s", rowCount, query); - -#if DEBUG_MYSQL_QUERIES >= 1 - if (requestResult.Success()) - { - std::cout << "query successful"; - if (requestResult.Result()) - std::cout << ", " << (int) mysql_num_rows(requestResult.Result()) << " rows returned"; - - std::cout << ", " << requestResult.RowCount() << " rows affected"; - std::cout<< std::endl; - } - else { - std::cout << "QUERY: query FAILED" << std::endl; - } -#endif + Log.Out(Logs::General, Logs::MySQLQuery, "%s (%u rows returned)", query, rowCount, requestResult.RowCount()); return requestResult; } From 951f98a63eb7ba1eced169ea4b82a35ae84b1ca8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 00:53:52 -0600 Subject: [PATCH 441/707] Re-Implement GMSay colors: http://i.imgur.com/tQbuKUM.jpg --- common/eqemu_logsys.cpp | 22 ++++++++++++++++++++++ common/eqemu_logsys.h | 2 ++ zone/zone.cpp | 1 + zone/zone.h | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 91a0d7304..739507350 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -142,6 +142,28 @@ uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ } } +uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category){ + switch (log_category) { + case Logs::Status: + case Logs::Normal: + return 15; /* Yellow */ + case Logs::MySQLError: + case Logs::Error: + return 13; /* Red */ + case Logs::MySQLQuery: + case Logs::Debug: + return 14; /* Light Green */ + case Logs::Quests: + return 258; /* Light Cyan */ + case Logs::Commands: + return 5; /* Light Purple */ + case Logs::Crash: + return 13; /* Red */ + default: + return 15; /* Yellow */ + } +} + void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string message) { /* Check if category enabled for process */ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 0a8cd324b..7b83ab996 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -143,6 +143,8 @@ public: bool log_settings_loaded = false; int log_platform = 0; + uint16 GetGMSayColorFromCategory(uint16 log_category); + void OnLogHookCallBackZone(std::function f) { on_log_gmsay_hook = f; } private: diff --git a/zone/zone.cpp b/zone/zone.cpp index a89c0b96c..8d42c2ad6 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -2299,3 +2299,4 @@ void Zone::UpdateHotzone() is_hotzone = atoi(row[0]) == 0 ? false: true; } + diff --git a/zone/zone.h b/zone/zone.h index e022a870c..11c3e6235 100644 --- a/zone/zone.h +++ b/zone/zone.h @@ -271,7 +271,7 @@ public: // random object that provides random values for the zone EQEmu::Random random; - static void GMSayHookCallBackProcess(uint16 log_category, std::string& message){ entity_list.MessageStatus(0, 80, 15, "%s", message.c_str()); } + static void GMSayHookCallBackProcess(uint16 log_category, std::string& message){ entity_list.MessageStatus(0, 80, Log.GetGMSayColorFromCategory(log_category), "%s", message.c_str()); } //MODDING HOOKS void mod_init(); From 35fcc69639e14ead14e60021f7363388d261fdbd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:53 -0600 Subject: [PATCH 442/707] Remove commented std::cout : Got OP_SessionRequest --- common/eq_stream.cpp | 1 - common/eqtime.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 0c5c6cacf..195c688bb 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -331,7 +331,6 @@ void EQStream::ProcessPacket(EQProtocolPacket *p) } } #endif - //std::cout << "Got OP_SessionRequest" << std::endl; sessionAttempts++; // we set established below, so statistics will not be reset for session attempts/stream active. init(GetState()!=ESTABLISHED); diff --git a/common/eqtime.cpp b/common/eqtime.cpp index adfd86923..6f2ef5233 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -145,7 +145,6 @@ bool EQTime::saveFile(const char *filename) return false; } //Enable for debugging - //std::cout << "SAVE: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl; of << EQT_VERSION << std::endl; of << (long)eqTime.start_eqtime.day << std::endl; of << (long)eqTime.start_eqtime.hour << std::endl; From 716b377378819aa757bbd78e7b349dac3061d2cd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:53 -0600 Subject: [PATCH 443/707] Remove commented std::cout : Starting factory Reader --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index a6a1d800a..14181e997 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -106,7 +106,6 @@ struct sockaddr_in address; fcntl(sock, F_SETFL, O_NONBLOCK); #endif //moved these because on windows the output was delayed and causing the console window to look bad - //std::cout << "Starting factory Reader" << std::endl; //std::cout << "Starting factory Writer" << std::endl; #ifdef _WINDOWS _beginthread(EQStreamFactoryReaderLoop,0, this); From b2e4c98848e4729b69a3bfe9889939444eb18092 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:53 -0600 Subject: [PATCH 444/707] Remove commented std::cout : Sending mana update: --- common/tcp_connection.cpp | 1 - zone/client.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index f558d0596..6a8493f2e 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -541,7 +541,6 @@ bool TCPConnection::Process() { if (!RecvData(errbuf)) { struct in_addr in; in.s_addr = GetrIP(); - //std::cout << inet_ntoa(in) << ":" << GetrPort() << ": " << errbuf << std::endl; return false; } /* we break to do the send */ diff --git a/zone/client.cpp b/zone/client.cpp index 3190f7657..59e7f25ee 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1702,7 +1702,6 @@ void Client::SendManaUpdatePacket() { SendEnduranceUpdate(); } - //std::cout << "Sending mana update: " << (cur_mana - last_reported_mana) << std::endl; if (last_reported_mana != cur_mana || last_reported_endur != cur_end) { From 849ec2850f5e98ae7ab695a98d1ddde41c30aa51 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:53 -0600 Subject: [PATCH 445/707] Remove commented std::cout : CastToTrap error --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 2ded575c0..544e0485d 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -129,7 +129,6 @@ Trap *Entity::CastToTrap() { #ifdef DEBUG if (!IsTrap()) { - //std::cout << "CastToTrap error" << std::endl; return 0; } #endif From 47b0f6ca9ef5bb1c742c67e495eb0acc4f266551 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:53 -0600 Subject: [PATCH 446/707] Remove commented std::cout : Gender in: --- zone/mob.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index ab2d83152..7f2a0f5a2 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1795,7 +1795,6 @@ bool Mob::IsPlayerRace(uint16 in_race) { uint8 Mob::GetDefaultGender(uint16 in_race, uint8 in_gender) { -//std::cout << "Gender in: " << (int)in_gender << std::endl; // undefined cout [CODEBUG] if (Mob::IsPlayerRace(in_race) || in_race == 15 || in_race == 50 || in_race == 57 || in_race == 70 || in_race == 98 || in_race == 118) { if (in_gender >= 2) { // Male default for PC Races From 4ffc09b3065c35319190caf531348cf0b4a32f1f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:56 -0600 Subject: [PATCH 447/707] Remove commented std::cout : Starting factory Writer --- common/eq_stream.cpp | 1 - common/eq_stream_factory.cpp | 1 - common/eqtime.cpp | 1 - zone/npc.cpp | 1 - 4 files changed, 4 deletions(-) diff --git a/common/eq_stream.cpp b/common/eq_stream.cpp index 195c688bb..15a494471 100644 --- a/common/eq_stream.cpp +++ b/common/eq_stream.cpp @@ -663,7 +663,6 @@ void EQStream::Write(int eq_fd) int32 threshold=RateThreshold; MRate.unlock(); if (BytesWritten > threshold) { - //std::cout << "Over threshold: " << BytesWritten << " > " << threshold << std::endl; return; } diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 14181e997..33b290736 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -106,7 +106,6 @@ struct sockaddr_in address; fcntl(sock, F_SETFL, O_NONBLOCK); #endif //moved these because on windows the output was delayed and causing the console window to look bad - //std::cout << "Starting factory Writer" << std::endl; #ifdef _WINDOWS _beginthread(EQStreamFactoryReaderLoop,0, this); _beginthread(EQStreamFactoryWriterLoop,0, this); diff --git a/common/eqtime.cpp b/common/eqtime.cpp index 6f2ef5233..79301a28f 100644 --- a/common/eqtime.cpp +++ b/common/eqtime.cpp @@ -194,7 +194,6 @@ bool EQTime::loadFile(const char *filename) in.ignore(80, '\n'); in >> eqTime.start_realtime; //Enable for debugging... - //std::cout << "LOAD: day=" << (long)eqTime.start_eqtime.day << ";hour=" << (long)eqTime.start_eqtime.hour << ";min=" << (long)eqTime.start_eqtime.minute << ";mon=" << (long)eqTime.start_eqtime.month << ";yr=" << eqTime.start_eqtime.year << ";timet=" << eqTime.start_realtime << std::endl; in.close(); return true; } diff --git a/zone/npc.cpp b/zone/npc.cpp index 56bbdae69..b0a9ce8a4 100644 --- a/zone/npc.cpp +++ b/zone/npc.cpp @@ -451,7 +451,6 @@ void NPC::RemoveItem(uint32 item_id, uint16 quantity, uint16 slot) { return; } else if (item->item_id == item_id && item->equip_slot == slot && quantity >= 1) { - //std::cout<<"NPC::RemoveItem"<<" equipSlot:"<equipSlot<<" quantity:"<< quantity<charges <= quantity) itemlist.erase(cur); else From b5fe23a4c3542b43a70439ef0cea2f9998f8daa1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:56 -0600 Subject: [PATCH 448/707] Remove commented std::cout : CastToTrap error --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 544e0485d..266850411 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -237,7 +237,6 @@ const Trap *Entity::CastToTrap() const { #ifdef DEBUG if (!IsTrap()) { - //std::cout << "CastToTrap error" << std::endl; return 0; } #endif From fb5e988ed81abf3646b940825958fe8824459ce3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:30:56 -0600 Subject: [PATCH 449/707] Remove commented std::cout : Tlevel: --- zone/mob.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/mob.cpp b/zone/mob.cpp index 7f2a0f5a2..5c798500a 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -2977,7 +2977,6 @@ int16 Mob::GetResist(uint8 type) const uint32 Mob::GetLevelHP(uint8 tlevel) { - //std::cout<<"Tlevel: "<<(int)tlevel< Date: Tue, 20 Jan 2015 01:30:58 -0600 Subject: [PATCH 450/707] Remove commented std::cout : Pop():Locking MNewStreams --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 33b290736..630b733fe 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -119,7 +119,6 @@ struct sockaddr_in address; EQStream *EQStreamFactory::Pop() { EQStream *s=nullptr; - //std::cout << "Pop():Locking MNewStreams" << std::endl; MNewStreams.lock(); if (NewStreams.size()) { s=NewStreams.front(); From f6e28298928de2a4a871593199cf43ea97c734d8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:31:00 -0600 Subject: [PATCH 451/707] Remove commented std::cout : Pop(): Unlocking MNewStreams --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 630b733fe..1f3a90958 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -126,7 +126,6 @@ EQStream *s=nullptr; s->PutInUse(); } MNewStreams.unlock(); - //std::cout << "Pop(): Unlocking MNewStreams" << std::endl; return s; } From 2c191fce7cd71ca7ff6a6c360c2373a67a377494 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:31:02 -0600 Subject: [PATCH 452/707] Remove commented std::cout : Push():Locking MNewStreams --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 1f3a90958..8db87e452 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -132,7 +132,6 @@ EQStream *s=nullptr; void EQStreamFactory::Push(EQStream *s) { - //std::cout << "Push():Locking MNewStreams" << std::endl; MNewStreams.lock(); NewStreams.push(s); MNewStreams.unlock(); From 91e9163602d39b09f2d7b5392223878976436013 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:31:03 -0600 Subject: [PATCH 453/707] Remove commented std::cout : Push(): Unlocking MNewStreams --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 8db87e452..7d8a08e04 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -135,7 +135,6 @@ void EQStreamFactory::Push(EQStream *s) MNewStreams.lock(); NewStreams.push(s); MNewStreams.unlock(); - //std::cout << "Push(): Unlocking MNewStreams" << std::endl; } void EQStreamFactory::ReaderLoop() From 421ecf6fce1a52da5397571b083a14a1d523a8e7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:31:04 -0600 Subject: [PATCH 454/707] Remove commented std::cout : Removing connection --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 7d8a08e04..97a4b8617 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -235,7 +235,6 @@ void EQStreamFactory::CheckTimeout() //give it a little time for everybody to finish with it } else { //everybody is done, we can delete it now - //std::cout << "Removing connection" << std::endl; std::map,EQStream *>::iterator temp=stream_itr; ++stream_itr; //let whoever has the stream outside delete it From 1a2b3b50ce69cc621f94f1b2983cf4eed4790933 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:31:05 -0600 Subject: [PATCH 455/707] Remove commented std::cout : No streams, waiting on condition --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 97a4b8617..70a6c76ad 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -312,7 +312,6 @@ Timer DecayTimer(20); stream_count=Streams.size(); MStreams.unlock(); if (!stream_count) { - //std::cout << "No streams, waiting on condition" << std::endl; WriterWork.Wait(); //std::cout << "Awake from condition, must have a stream now" << std::endl; } From 96a06f1cee9d34f0dc19f224eaf7668cfd9fa1a2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:31:06 -0600 Subject: [PATCH 456/707] Remove commented std::cout : Awake from condition, must have a stream now --- common/eq_stream_factory.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/eq_stream_factory.cpp b/common/eq_stream_factory.cpp index 70a6c76ad..7563c9b57 100644 --- a/common/eq_stream_factory.cpp +++ b/common/eq_stream_factory.cpp @@ -313,7 +313,6 @@ Timer DecayTimer(20); MStreams.unlock(); if (!stream_count) { WriterWork.Wait(); - //std::cout << "Awake from condition, must have a stream now" << std::endl; } } } From c33ac2981b14aedc22db9d460d668902e5666a94 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:32:27 -0600 Subject: [PATCH 457/707] Remove commented std::cout : \n --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index f3122d458..5ae19e3ca 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1809,7 +1809,6 @@ bool Database::CheckDatabaseConvertPPDeblob(){ rquery = rquery + StringFormat(", (%u, %u, %u)", character_id, i, pp->spell_book[i]); } } - // std::cout << rquery << "\n"; if (rquery != ""){ results = QueryDatabase(rquery); } /* Run Max Memmed Spell Convert */ first_entry = 0; rquery = ""; From f29ca568df291c56c68d9a2f67744f6ca50bbcf2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:17 -0600 Subject: [PATCH 458/707] Remove commented printf : %s ID: %i profile mismatch, not converting. PP %u - Profile Length %u \n --- common/database.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 5ae19e3ca..e300bf586 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1380,7 +1380,6 @@ bool Database::CheckDatabaseConvertPPDeblob(){ } /* Continue of PP Size does not match (Usually a created character never logged in) */ else { - // printf("%s ID: %i profile mismatch, not converting. PP %u - Profile Length %u \n", row2[2] ? row2[2] : "Unknown", character_id, sizeof(PlayerProfile_Struct), lengths); std::cout << (row2[2] ? row2[2] : "Unknown") << " ID: " << character_id << " size mismatch. Expected Size: " << sizeof(Convert::PlayerProfile_Struct) << " Seen: " << lengths << std::endl; continue; } @@ -2182,7 +2181,6 @@ bool Database::CheckDatabaseConvertCorpseDeblob(){ c_type = "Legacy"; } if (in_datasize != esize2 && in_datasize != esize1) { - // std::cout << "[Error] in Corpse Size - OLD SIZE: " << esize1 << " SOF SIZE: " << esize2 << " db_blob_datasize: " << in_datasize << std::endl; is_sof = false; c_type = "NULL"; continue; From 3138f0f9bcdbea4ad7c15cc14e1794c28efe5dfc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:17 -0600 Subject: [PATCH 459/707] Remove commented printf : %s %s\n --- utils/deprecated/azone/ter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/ter.cpp b/utils/deprecated/azone/ter.cpp index 11212c570..a599e6be2 100644 --- a/utils/deprecated/azone/ter.cpp +++ b/utils/deprecated/azone/ter.cpp @@ -151,7 +151,6 @@ int line_count = 0; var = (char *) buffer; line_count++; - // printf("%s %s\n", val, var); if(strlen(var) == 0 || strlen(val) == 0) { ++buffer; From 76586b5dbb9de29f9918b5734e7f1e40a5960d73 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:19 -0600 Subject: [PATCH 460/707] Remove commented printf : %i: Basetex: %s\n --- utils/deprecated/azone/ter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/ter.cpp b/utils/deprecated/azone/ter.cpp index a599e6be2..b64a72ff0 100644 --- a/utils/deprecated/azone/ter.cpp +++ b/utils/deprecated/azone/ter.cpp @@ -165,7 +165,6 @@ int line_count = 0; mlist[j].basetex = new char[val_len + 1]; memcpy(mlist[j].basetex, val, val_len + 1); ++mat_count; - // printf("%i: Basetex: %s\n", j + 1, mlist[j].basetex); ++j; } else if(val[0] != 'e' && val[1] != '_' && ((var[0] != 'e' && var[1] != '_') || !strcmp(val, "e_fShininess0"))) { From 84be3458b18790f82c2a0bf776343dbc9da9d6cc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:21 -0600 Subject: [PATCH 461/707] Remove commented printf : Named: %s\n --- utils/deprecated/azone/ter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/ter.cpp b/utils/deprecated/azone/ter.cpp index b64a72ff0..6900471dd 100644 --- a/utils/deprecated/azone/ter.cpp +++ b/utils/deprecated/azone/ter.cpp @@ -177,7 +177,6 @@ int line_count = 0; memcpy(mlist[j].name, val, val_len + 1); continue; } - // printf("Named: %s\n", mlist[j].name); } buffer += var_len + 1; From 82c898f6bf7ee78593a75e3f3ec8dfa983ce06bc Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 462/707] Remove commented printf : Opening packet file: %s\n --- common/packetfile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/packetfile.cpp b/common/packetfile.cpp index 699e26357..e1ee8fa3a 100644 --- a/common/packetfile.cpp +++ b/common/packetfile.cpp @@ -221,7 +221,6 @@ OldPacketFileReader::~OldPacketFileReader() { bool OldPacketFileReader::OpenFile(const char *name) { CloseFile(); - //printf("Opening packet file: %s\n", name); in = fopen(name, "rb"); if(in == NULL) { From 4e19cf0b5de61c32ae64c72ddbe38ef22df1b5f6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 463/707] Remove commented printf : Got %d bytes: %.*s\n --- common/SocketLib/HttpdSocket.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/SocketLib/HttpdSocket.cpp b/common/SocketLib/HttpdSocket.cpp index 8ed3041e4..21c2938d4 100644 --- a/common/SocketLib/HttpdSocket.cpp +++ b/common/SocketLib/HttpdSocket.cpp @@ -194,7 +194,6 @@ void HttpdSocket::OnHeaderComplete() void HttpdSocket::OnData(const char *p,size_t l) { -//printf("Got %d bytes: %.*s\n", l, l, p); if (m_file) { m_file -> fwrite(p,1,l); From b15656b32bd0fc502fca397d45a0813f19ebbe4f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 464/707] Remove commented printf : Read @ %d(%d). %d bytes. (%c)\n --- common/SocketLib/MemFile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/SocketLib/MemFile.cpp b/common/SocketLib/MemFile.cpp index 7c50356f8..5dee6717d 100644 --- a/common/SocketLib/MemFile.cpp +++ b/common/SocketLib/MemFile.cpp @@ -110,7 +110,6 @@ size_t MemFile::fread(char *ptr, size_t size, size_t nmemb) size_t sz = size * nmemb; if (p + sz < BLOCKSIZE) { -//printf("Read @ %d(%d). %d bytes. (%c)\n", m_read_ptr, p, sz, *(m_current_read -> data + p)); memcpy(ptr, m_current_read -> data + p, sz); m_read_ptr += sz; } From cfe4aeb2898c0c2baffafe0c0a504a64113279d5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 465/707] Remove commented printf : ReadMemory: hProcess: %p, baseAddr: %p, buffer: %p, size: %d, read: %d, result: %d\n --- common/StackWalker/StackWalker.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/StackWalker/StackWalker.cpp b/common/StackWalker/StackWalker.cpp index 6931c30f5..d457a2231 100644 --- a/common/StackWalker/StackWalker.cpp +++ b/common/StackWalker/StackWalker.cpp @@ -1128,7 +1128,6 @@ BOOL __stdcall StackWalker::myReadProcMem( SIZE_T st; BOOL bRet = ReadProcessMemory(hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, &st); *lpNumberOfBytesRead = (DWORD) st; - //printf("ReadMemory: hProcess: %p, baseAddr: %p, buffer: %p, size: %d, read: %d, result: %d\n", hProcess, (LPVOID) qwBaseAddress, lpBuffer, nSize, (DWORD) st, (DWORD) bRet); return bRet; } else From db5778916e4d6e320cfeacdfc8b7f2c4e517a3c5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 466/707] Remove commented printf : Missed: (%.3f, %.3f, %.3f)\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index 387f1062e..28d023e2b 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -97,7 +97,6 @@ void repair_a_high_waypoint(Map *map, PathNode *it) { } } else { z_no_map_count++; - //printf("Missed: (%.3f, %.3f, %.3f)\n", it->x, it->y, it->z); } } From afdaba60fee1a350e2616fd3a8e6c47c7cf1c635 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 467/707] Remove commented printf : New Color at: (%.3f,%.3f,%.3f)\n --- utils/deprecated/apathing/boostcrap.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/boostcrap.cpp b/utils/deprecated/apathing/boostcrap.cpp index 230c1bfb3..2df78b934 100644 --- a/utils/deprecated/apathing/boostcrap.cpp +++ b/utils/deprecated/apathing/boostcrap.cpp @@ -297,7 +297,6 @@ void color_disjoint_graphs( if(n->color != 0) continue; //allready visited -//printf("New Color at: (%.3f,%.3f,%.3f)\n", n->x, n->y, n->z); cc = 1; djc = 0; From cc9b0ff089dc37b8461886ba5590502e55e6d1aa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 468/707] Remove commented printf : Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n --- utils/deprecated/apathing/quadtree.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/quadtree.cpp b/utils/deprecated/apathing/quadtree.cpp index fad704505..829c5e638 100644 --- a/utils/deprecated/apathing/quadtree.cpp +++ b/utils/deprecated/apathing/quadtree.cpp @@ -86,7 +86,6 @@ void QTNode::fillBlocks(PathTree_Struct *heads, PathPointRef *flist, unsigned lo head->miny = miny; head->maxy = maxy; head->flags = 0; -//printf("Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n", hindex-1, head->minx, head->maxx, head->miny, head->maxy); //rearranged to give all QT nodes a node list head->nodelist.count = nodes.size(); From 467272c334f7b0584c96bcf921145a9b4724318d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:29 -0600 Subject: [PATCH 469/707] Remove commented printf : Find Region %ld in node %ld\n --- utils/deprecated/azone/awater.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/awater.cpp b/utils/deprecated/azone/awater.cpp index cffdfdb8b..1e25fc155 100644 --- a/utils/deprecated/azone/awater.cpp +++ b/utils/deprecated/azone/awater.cpp @@ -257,7 +257,6 @@ long BSPCountNodes(BSP_Node *tree, long node_number) { long BSPFindRegion(BSP_Node *tree, long node_number, long region) { - //printf("Find Region %ld in node %ld\n", region, node_number); if(node_number<1) { printf("Something went wrong\n"); exit(1); From 36dda4ee0a0b33b0ef62b17763d8d1bc4c352b1c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 470/707] Remove commented printf : Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n --- utils/deprecated/azone/azone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/azone.cpp b/utils/deprecated/azone/azone.cpp index 9fc9f2466..2c384482d 100644 --- a/utils/deprecated/azone/azone.cpp +++ b/utils/deprecated/azone/azone.cpp @@ -584,7 +584,6 @@ void QTNode::fillBlocks(nodeHeader *heads, unsigned long *flist, unsigned long & head->miny = miny; head->maxy = maxy; head->flags = 0; -//printf("Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n", hindex-1, head->minx, head->maxx, head->miny, head->maxy); if(final) { head->flags |= nodeFinal; head->faces.count = faces.size(); From 63ab54bf1f48a5fad591384bb8c77fded4a14943 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 471/707] Remove commented printf : Look for %s: got %s\n --- utils/deprecated/azone/pfs.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/pfs.cpp b/utils/deprecated/azone/pfs.cpp index 9002ae977..5ce56ae3b 100644 --- a/utils/deprecated/azone/pfs.cpp +++ b/utils/deprecated/azone/pfs.cpp @@ -178,7 +178,6 @@ const char *PFSLoader::FindExtension(const char *ext) { int elen = strlen(ext); for(i = 0; i < this->count; ++i) { -//printf("Look for %s: got %s\n", ext, this->filenames[i]); int flen = strlen(this->filenames[i]); if(flen <= elen) continue; From c1dca8f6a9e13bcea13f2d121d3ee1717b927076 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 472/707] Remove commented printf : v1=%d, v2=%d, v3=%d, g=%d, unk=%d\n --- utils/deprecated/azone/ter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/ter.cpp b/utils/deprecated/azone/ter.cpp index 6900471dd..e9453ec8d 100644 --- a/utils/deprecated/azone/ter.cpp +++ b/utils/deprecated/azone/ter.cpp @@ -318,7 +318,6 @@ printf("%d tris start at %d (0x%x)\n", zm->poly_count, (buffer-ter_orig), (buffe } zm->polys[j] = new Polygon; - //printf(" v1=%d, v2=%d, v3=%d, g=%d, unk=%d\n", ttri->v1, ttri->v2, ttri->v3, ttri->group, ttri->unk); if(ttri->v1 >= zm->vert_count && errored < 10) { printf("Tri %d/%d (s %d) @0x%x: invalid v1: %d >= %d\n", i, zm->poly_count, skipped, (buffer-ter_orig), ttri->v1, zm->vert_count); From 9c6ba3164d01c0da9f72c22ef695eb3a10fa6ee7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 473/707] Remove commented printf : Find Region %ld in node %ld\n --- utils/deprecated/azone2/awater.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/awater.cpp b/utils/deprecated/azone2/awater.cpp index 940c27596..f064c3782 100644 --- a/utils/deprecated/azone2/awater.cpp +++ b/utils/deprecated/azone2/awater.cpp @@ -271,7 +271,6 @@ long BSPCountNodes(BSP_Node *tree, long node_number) { long BSPFindRegion(BSP_Node *tree, long node_number, long region) { - //printf("Find Region %ld in node %ld\n", region, node_number); if(node_number<1) { printf("Something went wrong\n"); exit(1); From 55cb66762c77f8f45934779e46e5d9806cfa5a01 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 474/707] Remove commented printf : Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n --- utils/deprecated/azone2/azone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/azone.cpp b/utils/deprecated/azone2/azone.cpp index c49b89e26..6167a7352 100644 --- a/utils/deprecated/azone2/azone.cpp +++ b/utils/deprecated/azone2/azone.cpp @@ -447,7 +447,6 @@ void QTNode::fillBlocks(nodeHeader *heads, unsigned long *flist, unsigned long & head->miny = miny; head->maxy = maxy; head->flags = 0; -//printf("Node %u: (%.2f -> %.2f, %.2f -> %.2f)\n", hindex-1, head->minx, head->maxx, head->miny, head->maxy); if(final) { head->flags |= nodeFinal; head->faces.count = faces.size(); From 2e4fd5f983ee2d2bdff6ad2b1b70b1bc6f4705fd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 475/707] Remove commented printf : Returning %s\n --- utils/deprecated/azone2/dat.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/dat.cpp b/utils/deprecated/azone2/dat.cpp index c89bd4d11..7fec482be 100644 --- a/utils/deprecated/azone2/dat.cpp +++ b/utils/deprecated/azone2/dat.cpp @@ -98,7 +98,6 @@ string GetToken(uchar *&Buffer, int &Position) ++Position; } ++Position; - //printf("Returning %s\n", Token.c_str()); return Token; } From 0fc5247279a1c125eda6429850745b2d45376b56 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:30 -0600 Subject: [PATCH 476/707] Remove commented printf : fnlen is %d, %s\n --- utils/deprecated/azone2/wld.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/wld.cpp b/utils/deprecated/azone2/wld.cpp index 45471738c..0c011ec17 100644 --- a/utils/deprecated/azone2/wld.cpp +++ b/utils/deprecated/azone2/wld.cpp @@ -34,7 +34,6 @@ FRAG_CONSTRUCTOR(Data03) { memcpy(tex->filenames[i], buf, fnlen); decode((uchar *) tex->filenames[i], fnlen); - //printf("fnlen is %d, %s\n", fnlen, tex->filenames[i]); // Derision: Not sure why this check is here, but need to check fnlen is >=18 if(fnlen>=18) { if(tex->filenames[i][fnlen - 8] == '.') From 072339d24c1e4354b2a95c7a4d7918c3ceea93a6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 477/707] Remove commented printf : Opening %s.mod\n --- utils/deprecated/azone2/zonv4.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/zonv4.cpp b/utils/deprecated/azone2/zonv4.cpp index c2e0b32af..08964dd65 100644 --- a/utils/deprecated/azone2/zonv4.cpp +++ b/utils/deprecated/azone2/zonv4.cpp @@ -107,7 +107,6 @@ int Zonv4Loader::Open(char *base_path, char *zone_name, Archive *archive) for(unsigned int i = 0; i < this->datloader.model_data.ModelNames.size(); ++i) { char tmp[200]; - //printf("Opening %s.mod\n", this->datloader.model_data.ModelNames[i].c_str()); sprintf(tmp, "%s.mod", this->datloader.model_data.ModelNames[i].c_str()); char *str = tmp; From 6bf8c217ad2245001a5b12f702b5c51dab5ec1b3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 478/707] Remove commented printf : --- utils/deprecated/ppconvert/ppconvert.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/ppconvert/ppconvert.cpp b/utils/deprecated/ppconvert/ppconvert.cpp index e8d2a85b9..f6250ab75 100644 --- a/utils/deprecated/ppconvert/ppconvert.cpp +++ b/utils/deprecated/ppconvert/ppconvert.cpp @@ -119,7 +119,6 @@ int main() { snprintf(bptr, 128, "' WHERE id=%lu", id); // printf("Query: '%s'\n", outbuffer); -//printf(outbuffer); //printf(";\n"); /* if(mysql_query(&out, outbuffer) != 0) { failed_count++; From 7c3502d5f202db1bc0f496b5526d4aa32df0c4ff Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 479/707] Remove commented printf : --- utils/deprecated/ppskillfix/ppskillfix.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/ppskillfix/ppskillfix.cpp b/utils/deprecated/ppskillfix/ppskillfix.cpp index 758073c61..659877910 100644 --- a/utils/deprecated/ppskillfix/ppskillfix.cpp +++ b/utils/deprecated/ppskillfix/ppskillfix.cpp @@ -113,7 +113,6 @@ fprintf(stderr, "Char '%s' skill %d = %d\n", row[1], r, in_pp->skills[r]); snprintf(bptr, 128, "' WHERE id=%lu", id); // printf("Query: '%s'\n", outbuffer); -//printf(outbuffer); //printf(";\n"); /* if(mysql_query(&out, outbuffer) != 0) { failed_count++; From 2e763a77f7b3854a51beb826ed4e622293ccc5a2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 480/707] Remove commented printf : ProcP %d: %p\n --- world/launcher_list.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 62657175a..6bd396f2c 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -57,7 +57,6 @@ void LauncherList::Process() { cur = m_pendingLaunchers.begin(); while(cur != m_pendingLaunchers.end()) { LauncherLink *l = *cur; -//printf("ProcP %d: %p\n", l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. Log.Out(Logs::Detail, Logs::World_Server, "Removing pending launcher %d", l->GetID()); From ce517f3bdcbb9d7f8b8602c441ab3cc545c5eb4e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 481/707] Remove commented printf : Spawned Merc with ID %i\n --- zone/merc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/merc.cpp b/zone/merc.cpp index 73990f139..5f85cde35 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -4926,7 +4926,6 @@ bool Merc::Spawn(Client *owner) { //UpdateMercAppearance(); - //printf("Spawned Merc with ID %i\n", npc->GetID()); fflush(stdout); return true; } From afbc8b07652443c34d0c09a47bc0fceb605e2c34 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 482/707] Remove commented printf : Spawning object %s at %f,%f,%f\n --- zone/object.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/object.cpp b/zone/object.cpp index 09988481e..07ff5858b 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -86,7 +86,6 @@ Object::Object(const ItemInst* inst, char* name,float max_x,float min_x,float ma // Set as much struct data as we can memset(&m_data, 0, sizeof(Object_Struct)); m_data.heading = heading; - //printf("Spawning object %s at %f,%f,%f\n",name,m_data.x,m_data.y,m_data.z); m_data.z = z; m_data.zone_id = zone->GetZoneID(); respawn_timer.Disable(); From ff9bc4e953109d9754d3d758a3c3a4ea2aac5127 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:33:31 -0600 Subject: [PATCH 483/707] Remove commented printf : NPC Spell casted on %s\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 30adb7f2f..14b959621 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1589,7 +1589,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] #endif // Npc if (caster->IsAttackAllowed(mob) && spells[spell_id].targettype != ST_AEBard) { - //printf("NPC Spell casted on %s\n", mob->GetName()); caster->SpellOnTarget(spell_id, mob); } else if (mob->IsAIControlled() && spells[spell_id].targettype == ST_AEBard) { From f73f764f2a0ad07bdf6aa748fd6aba7656bec997 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:36 -0600 Subject: [PATCH 484/707] Remove commented printf : Closed packet file.\n --- common/packetfile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/packetfile.cpp b/common/packetfile.cpp index e1ee8fa3a..5909afb57 100644 --- a/common/packetfile.cpp +++ b/common/packetfile.cpp @@ -262,7 +262,6 @@ void OldPacketFileReader::CloseFile() { if(in != NULL) { fclose(in); in = NULL; - //printf("Closed packet file.\n"); } } From 4c1227165c02ba6f26c068ae7f3069b18fd72863 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:36 -0600 Subject: [PATCH 485/707] Remove commented printf : Write @ %d(%d). %d bytes.\n --- common/SocketLib/MemFile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/SocketLib/MemFile.cpp b/common/SocketLib/MemFile.cpp index 5dee6717d..c621666e5 100644 --- a/common/SocketLib/MemFile.cpp +++ b/common/SocketLib/MemFile.cpp @@ -141,7 +141,6 @@ size_t MemFile::fwrite(const char *ptr, size_t size, size_t nmemb) size_t sz = size * nmemb; if (p + sz < BLOCKSIZE) { -//printf("Write @ %d(%d). %d bytes.\n", m_write_ptr, p, sz); memcpy(m_current_write -> data + p, ptr, sz); m_write_ptr += sz; } From b1497cac56acf5bfa1dd94083b1b7944831b8e8b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:36 -0600 Subject: [PATCH 486/707] Remove commented printf : pos=%d/%d\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index 28d023e2b..d0db74062 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -198,7 +198,6 @@ RESTART_WP_REDUCE: //we are removing the second one wp_reduce_count++; - //printf("pos=%d/%d\n", pos, g->nodes.size()); //printf("trail = 0x%x(0x%x) (%.3f, %.3f, %.3f)\n", // *trail, second, (*trail)->x, (*trail)->y, (*trail)->z); //trail = cur2; From 880b1e7a0d97be3f14ee4d782cb44773f266e8fe Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:36 -0600 Subject: [PATCH 487/707] Remove commented printf : Node %d's longest path is %d\n --- utils/deprecated/apathing/boostcrap.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/boostcrap.cpp b/utils/deprecated/apathing/boostcrap.cpp index 2df78b934..4e15dcdd6 100644 --- a/utils/deprecated/apathing/boostcrap.cpp +++ b/utils/deprecated/apathing/boostcrap.cpp @@ -456,7 +456,6 @@ void calc_path_lengths(Map *map, MyGraph &vg, PathGraph *big, mapnode_id]; //n->longest_path = longest; -//printf("Node %d's longest path is %d\n", n->node_id, longest); if(longest < shortest) { shortest = longest; From 34f1df11635c5c7f2dd23b9f141f5055f015489c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 488/707] Remove commented printf : Final node with %u nodes, list offset %lu.\n --- utils/deprecated/apathing/quadtree.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/quadtree.cpp b/utils/deprecated/apathing/quadtree.cpp index 829c5e638..d3ac5968c 100644 --- a/utils/deprecated/apathing/quadtree.cpp +++ b/utils/deprecated/apathing/quadtree.cpp @@ -90,7 +90,6 @@ void QTNode::fillBlocks(PathTree_Struct *heads, PathPointRef *flist, unsigned lo //rearranged to give all QT nodes a node list head->nodelist.count = nodes.size(); head->nodelist.offset = findex; -//printf(" Final node with %u nodes, list offset %lu.\n", head->nodes.count, head->nodes.offset); list::iterator curs,end; curs = nodes.begin(); end = nodes.end(); From 8594d3d550da3342d55584af059fa448f4f25c01 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 489/707] Remove commented printf : Find Region %ld in node %ld\n --- utils/deprecated/azone/awater.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/awater.cpp b/utils/deprecated/azone/awater.cpp index 1e25fc155..55f05a352 100644 --- a/utils/deprecated/azone/awater.cpp +++ b/utils/deprecated/azone/awater.cpp @@ -328,7 +328,6 @@ long BSPFindNode(BSP_Node *tree, long node_number, float x, float y, float z) { long BSPMarkRegion(BSP_Node *tree, long node_number, long region, int region_type) { - //printf("Find Region %ld in node %ld\n", region, node_number); if(node_number<1) { printf("Something went wrong\n"); exit(1); From 562f7c136058593e6d64fa97d016384a227a500b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 490/707] Remove commented printf : Final node with %u faces, list offset %lu.\n --- utils/deprecated/azone/azone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/azone.cpp b/utils/deprecated/azone/azone.cpp index 2c384482d..14176b4dc 100644 --- a/utils/deprecated/azone/azone.cpp +++ b/utils/deprecated/azone/azone.cpp @@ -588,7 +588,6 @@ void QTNode::fillBlocks(nodeHeader *heads, unsigned long *flist, unsigned long & head->flags |= nodeFinal; head->faces.count = faces.size(); head->faces.offset = findex; -//printf(" Final node with %u faces, list offset %lu.\n", head->faces.count, head->faces.offset); unsigned long r; for(r = 0; r < head->faces.count; r++) { flist[findex] = faces[r].index; From 6ba30c3fb2c2dc1341b246e90dfe8d5eb3851d68 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 491/707] Remove commented printf : Look for %s: got %s\n --- utils/deprecated/azone/pfs.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone/pfs.cpp b/utils/deprecated/azone/pfs.cpp index 5ce56ae3b..a04cb90a5 100644 --- a/utils/deprecated/azone/pfs.cpp +++ b/utils/deprecated/azone/pfs.cpp @@ -196,7 +196,6 @@ int PFSLoader::GetFile(char *name, uchar **buf, int *len) { Lower(name); for(i = 0; i < this->count; ++i) { -//printf("Look for %s: got %s\n", name, this->filenames[i]); if(!strcmp(this->filenames[i], name)) { fseek(this->fp, this->files[i], SEEK_SET); fread(&s3d_dir, sizeof(struct_directory), 1, this->fp); From db4426c435a99c5cdf888e54a721132b0c4aea6d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 492/707] Remove commented printf : Find Region %ld in node %ld\n --- utils/deprecated/azone2/awater.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/awater.cpp b/utils/deprecated/azone2/awater.cpp index f064c3782..8573e5b72 100644 --- a/utils/deprecated/azone2/awater.cpp +++ b/utils/deprecated/azone2/awater.cpp @@ -342,7 +342,6 @@ long BSPFindNode(BSP_Node *tree, long node_number, float x, float y, float z) { long BSPMarkRegion(BSP_Node *tree, long node_number, long region, int region_type) { - //printf("Find Region %ld in node %ld\n", region, node_number); if(node_number<1) { printf("Something went wrong\n"); exit(1); From 965f8bbbbaa2c7d40b1b90d7d469007e07dffd27 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 493/707] Remove commented printf : Final node with %u faces, list offset %lu.\n --- utils/deprecated/azone2/azone.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/azone.cpp b/utils/deprecated/azone2/azone.cpp index 6167a7352..81a143ba2 100644 --- a/utils/deprecated/azone2/azone.cpp +++ b/utils/deprecated/azone2/azone.cpp @@ -451,7 +451,6 @@ void QTNode::fillBlocks(nodeHeader *heads, unsigned long *flist, unsigned long & head->flags |= nodeFinal; head->faces.count = faces.size(); head->faces.offset = findex; -//printf(" Final node with %u faces, list offset %lu.\n", head->faces.count, head->faces.offset); unsigned long r; for(r = 0; r < head->faces.count; r++) { flist[findex] = faces[r].index; From 53b866d35c9d8eb50e03bd2e565cc2ebe607edc5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 494/707] Remove commented printf : Frag 36 reference?: %ld\n --- utils/deprecated/azone2/wld.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/azone2/wld.cpp b/utils/deprecated/azone2/wld.cpp index 0c011ec17..d4dbcf25b 100644 --- a/utils/deprecated/azone2/wld.cpp +++ b/utils/deprecated/azone2/wld.cpp @@ -187,7 +187,6 @@ FRAG_CONSTRUCTOR(Data22) { long Frag36Ref; if(data->flags==0x181) { Frag36Ref = *((long *) (data6area+20)); - //printf("Frag 36 reference?: %ld\n", *((long *) (data6area+20))); } From 5553c874ecbb503fdc4a9da113898d86e5a99e34 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:37 -0600 Subject: [PATCH 495/707] Remove commented printf : ;\n --- utils/deprecated/ppconvert/ppconvert.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/ppconvert/ppconvert.cpp b/utils/deprecated/ppconvert/ppconvert.cpp index f6250ab75..716ddd753 100644 --- a/utils/deprecated/ppconvert/ppconvert.cpp +++ b/utils/deprecated/ppconvert/ppconvert.cpp @@ -119,7 +119,6 @@ int main() { snprintf(bptr, 128, "' WHERE id=%lu", id); // printf("Query: '%s'\n", outbuffer); -//printf(";\n"); /* if(mysql_query(&out, outbuffer) != 0) { failed_count++; printf(" Error updating char id %lu: %s\n", id, mysql_error(&m)); From 63496fd33c3cfb9da8a3c39b37086e82a5243ace Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:38 -0600 Subject: [PATCH 496/707] Remove commented printf : ;\n --- utils/deprecated/ppskillfix/ppskillfix.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/ppskillfix/ppskillfix.cpp b/utils/deprecated/ppskillfix/ppskillfix.cpp index 659877910..f2c7c1474 100644 --- a/utils/deprecated/ppskillfix/ppskillfix.cpp +++ b/utils/deprecated/ppskillfix/ppskillfix.cpp @@ -113,7 +113,6 @@ fprintf(stderr, "Char '%s' skill %d = %d\n", row[1], r, in_pp->skills[r]); snprintf(bptr, 128, "' WHERE id=%lu", id); // printf("Query: '%s'\n", outbuffer); -//printf(";\n"); /* if(mysql_query(&out, outbuffer) != 0) { failed_count++; printf(" Error updating char id %lu: %s\n", id, mysql_error(&m)); From b31c8c7a8fe5e39b51e12789051871b2df53424a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:38 -0600 Subject: [PATCH 497/707] Remove commented printf : Proc %s(%d): %p\n --- world/launcher_list.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/launcher_list.cpp b/world/launcher_list.cpp index 6bd396f2c..b66f7a600 100644 --- a/world/launcher_list.cpp +++ b/world/launcher_list.cpp @@ -87,7 +87,6 @@ void LauncherList::Process() { curl = m_launchers.begin(); while(curl != m_launchers.end()) { LauncherLink *l = curl->second; -//printf("Proc %s(%d): %p\n", l->GetName(), l->GetID(), l); if(!l->Process()) { //launcher has died before it identified itself. Log.Out(Logs::Detail, Logs::World_Server, "Removing launcher %s (%d)", l->GetName(), l->GetID()); From 245351e3515d715057a062678882c7655060ec81 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:38 -0600 Subject: [PATCH 498/707] Remove commented printf : NPC mgb/aebard spell casted on %s\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 14b959621..7385c3bc1 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1592,7 +1592,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] caster->SpellOnTarget(spell_id, mob); } else if (mob->IsAIControlled() && spells[spell_id].targettype == ST_AEBard) { - //printf("NPC mgb/aebard spell casted on %s\n", mob->GetName()); caster->SpellOnTarget(spell_id, mob); } else { From b746385e4575e9a5a80dae5fbea818a7efa391f9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:40 -0600 Subject: [PATCH 499/707] Remove commented printf : Opening packet file: %s\n --- common/packetfile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/packetfile.cpp b/common/packetfile.cpp index 5909afb57..d8900c26e 100644 --- a/common/packetfile.cpp +++ b/common/packetfile.cpp @@ -332,7 +332,6 @@ NewPacketFileReader::~NewPacketFileReader() { bool NewPacketFileReader::OpenFile(const char *name) { CloseFile(); - //printf("Opening packet file: %s\n", name); in = fopen(name, "rb"); if(in == NULL) { From 767781bd0a45ba47d514f1098e45c7acefedd81a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:40 -0600 Subject: [PATCH 500/707] Remove commented printf : trail = 0x%x(0x%x) (%.3f, %.3f, %.3f)\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index d0db74062..da17a84bf 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -198,7 +198,6 @@ RESTART_WP_REDUCE: //we are removing the second one wp_reduce_count++; - //printf("trail = 0x%x(0x%x) (%.3f, %.3f, %.3f)\n", // *trail, second, (*trail)->x, (*trail)->y, (*trail)->z); //trail = cur2; From 236e3e0d7297536e90db957c3d1bbe21aa35ef96 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:40 -0600 Subject: [PATCH 501/707] Remove commented printf : Node %d's distance from root is %d\n --- utils/deprecated/apathing/boostcrap.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/boostcrap.cpp b/utils/deprecated/apathing/boostcrap.cpp index 4e15dcdd6..24b18e5d4 100644 --- a/utils/deprecated/apathing/boostcrap.cpp +++ b/utils/deprecated/apathing/boostcrap.cpp @@ -474,7 +474,6 @@ printf("The tree's root is %d\n", shortest_node); n->longest_path = 0; else n->longest_path = root_dists[n->node_id]; -//printf("Node %d's distance from root is %d\n", n->node_id, root_dists[n->node_id]); } From 04bd05162cc35fb5c433f8e913e61481111790b9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:40 -0600 Subject: [PATCH 502/707] Remove commented printf : Got to node index %d (0x%x)\n --- utils/deprecated/apathing/quadtree.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/quadtree.cpp b/utils/deprecated/apathing/quadtree.cpp index d3ac5968c..9dff015eb 100644 --- a/utils/deprecated/apathing/quadtree.cpp +++ b/utils/deprecated/apathing/quadtree.cpp @@ -94,7 +94,6 @@ void QTNode::fillBlocks(PathTree_Struct *heads, PathPointRef *flist, unsigned lo curs = nodes.begin(); end = nodes.end(); for(; curs != end; curs++) { -//printf("Got to node index %d (0x%x)\n", findex, *curs); PathNode *cur = *curs; flist[findex] = cur->node_id; findex++; From 138436f46d72f704da5576ff1982e56fc0b03aef Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:40 -0600 Subject: [PATCH 503/707] Remove commented printf : NPC AE, fall thru. spell_id:%i, Target type:%x\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 7385c3bc1..7f9d6634d 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1595,7 +1595,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] caster->SpellOnTarget(spell_id, mob); } else { - //printf("NPC AE, fall thru. spell_id:%i, Target type:%x\n", spell_id, spells[spell_id].targettype); } } #ifdef IPC From 29a19b8f9e99a4980065380355feb27426c4967b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:42 -0600 Subject: [PATCH 504/707] Remove commented printf : Closed packet file.\n --- common/packetfile.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/packetfile.cpp b/common/packetfile.cpp index d8900c26e..5885382ff 100644 --- a/common/packetfile.cpp +++ b/common/packetfile.cpp @@ -373,7 +373,6 @@ void NewPacketFileReader::CloseFile() { if(in != NULL) { fclose(in); in = NULL; - //printf("Closed packet file.\n"); } } From d5401b41deb57a9a105c22413c2ebc9645c348dd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:42 -0600 Subject: [PATCH 505/707] Remove commented printf : Cut (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) d2=%.3f\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index da17a84bf..c7ab07404 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -274,7 +274,6 @@ void break_long_lines(list &db_paths) { if(len2 < cutlen2) continue; -//printf("Cut (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) d2=%.3f\n", e->from->x, e->from->y, e->from->z, e->to->x, e->to->y, e->to->z, len2); float len = sqrt(len2); v1.x = (e->to->x - e->from->x)/len; From e7cfaf8baec8fc589ce1a18e319c0043dc6f59e3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:42 -0600 Subject: [PATCH 506/707] Remove commented printf : IIN: (%.3f,%.3f) in (%.3f -> %.3f, %.3f -> %.3f)\n --- utils/deprecated/apathing/quadtree.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/quadtree.cpp b/utils/deprecated/apathing/quadtree.cpp index 9dff015eb..0729e1713 100644 --- a/utils/deprecated/apathing/quadtree.cpp +++ b/utils/deprecated/apathing/quadtree.cpp @@ -280,7 +280,6 @@ void QTNode::buildVertexes() { } bool QTNode::IsInNode(const QTNode *n, const PathNode *o) { -//printf("IIN: (%.3f,%.3f) in (%.3f -> %.3f, %.3f -> %.3f)\n", o->x, o->y, n->minx, n->maxx, n->miny, n->maxy); if( o->x >= n->minx && o->x < n->maxx && o->y >= n->miny && o->y < n->maxy ) return(true); From bbbb63ecf5eff40e50bbf8928ff731719c053354 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:43 -0600 Subject: [PATCH 507/707] Remove commented printf : IPC Spell casted on %s\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 7f9d6634d..676321442 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1601,7 +1601,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] else if(caster->IsNPC() && caster->CastToNPC()->IsInteractive()) { // Interactive npc if (caster->IsAttackAllowed(mob) && spells[spell_id].targettype != ST_AEBard && spells[spell_id].targettype != ST_GroupTeleport) { - //printf("IPC Spell casted on %s\n", mob->GetName()); caster->SpellOnTarget(spell_id, mob); } else if (!mob->IsAIControlled() && (spells[spell_id].targettype == ST_AEBard||group) && mob->CastToClient()->GetPVP() == caster->CastToClient()->GetPVP()) { From 40453f605dcffb274a26fefc74353382fd6d8abb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:44 -0600 Subject: [PATCH 508/707] Remove commented printf : (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) d2=%.3f\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index c7ab07404..a65026332 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -293,7 +293,6 @@ void break_long_lines(list &db_paths) { ee = new PathEdge(last_node, n); last_node = n; -//printf(" (%.3f,%.3f,%.3f) -> (%.3f,%.3f,%.3f) d2=%.3f\n", ee->from->x, ee->from->y, ee->from->z, ee->to->x, ee->to->y, ee->to->z, e->from->Dist2(e->to)); g->edges.push_back(ee); g->nodes.push_back(n); From d5cdfdc33c8553d66897821f74daadd4c5609e8d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:44 -0600 Subject: [PATCH 509/707] Remove commented printf : IPC mgb/aebard spell casted on %s\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 676321442..a0366e95c 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1608,7 +1608,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] iterator.Advance(); continue; } - //printf("IPC mgb/aebard spell casted on %s\n", mob->GetName()); caster->SpellOnTarget(spell_id, mob); } else { From 725a2d29a27c697bd6ebe4efeff2126cb7dcc6c6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:46 -0600 Subject: [PATCH 510/707] Remove commented printf : Starting clean at pos %d with %d nodes\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index a65026332..f9f0ed589 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -962,7 +962,6 @@ run an algorithm to remove redundancy: RESTART_GRID_CLEAN: cur = big->nodes.begin(); end = big->nodes.end(); -//printf("Starting clean at pos %d with %d nodes\n", cur_pos, big->nodes.size()); for(r = 0; r < cur_pos; r++) cur++; for(; cur != end; cur++, cur_pos++, stat++) { From 146d7d46a9a9ef5062a79d8a1ecde79293d4c3cf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:46 -0600 Subject: [PATCH 511/707] Remove commented printf : NPC AE, fall thru. spell_id:%i, Target type:%x\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index a0366e95c..1c351c145 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1611,7 +1611,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] caster->SpellOnTarget(spell_id, mob); } else { - //printf("NPC AE, fall thru. spell_id:%i, Target type:%x\n", spell_id, spells[spell_id].targettype); } } #endif From bc84e4e80e10ea1b665f5c25435fffa0be1559f5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:48 -0600 Subject: [PATCH 512/707] Remove commented printf : Dist %f, ce2 %f\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index f9f0ed589..de344870b 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -983,7 +983,6 @@ RESTART_GRID_CLEAN: if(n == f) continue; if(n->Dist2(f) > ce2) { -//printf("Dist %f, ce2 %f\n", n->Dist2(f), ce2); continue; } //printf("Distbbb %f, ce2 %f, (%f,%f), (%f,%f)\n", n->Dist2(f), ce2, n->x, n->y, f->x, f->y); From 69c4bc0dbd70235f9330c03178afaf4401a0a579 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:48 -0600 Subject: [PATCH 513/707] Remove commented printf : Client Spell casted on %s\n --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index 1c351c145..f6b434cc9 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1617,7 +1617,6 @@ Message(0, "Disc packet id=%d, %x,%x,%x", disc_in->disc_id, disc_in->unknown3[0] else if (caster->IsClient() && !(caster->CastToClient()->IsBecomeNPC())) { // Client if (caster->IsAttackAllowed(mob) && spells[spell_id].targettype != ST_AEBard){ - //printf("Client Spell casted on %s\n", mob->GetName()); caster->SpellOnTarget(spell_id, mob); } else if(spells[spell_id].targettype == ST_GroupTeleport && mob->IsClient() && mob->isgrouped && caster->isgrouped && entity_list.GetGroupByMob(caster)) From ed4f2c7e147f013b2427d2578c3817703ecf61e1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:49 -0600 Subject: [PATCH 514/707] Remove commented printf : Distbbb %f, ce2 %f, (%f,%f), (%f,%f)\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index de344870b..f363c4a4b 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -985,7 +985,6 @@ RESTART_GRID_CLEAN: if(n->Dist2(f) > ce2) { continue; } -//printf("Distbbb %f, ce2 %f, (%f,%f), (%f,%f)\n", n->Dist2(f), ce2, n->x, n->y, f->x, f->y); #ifdef COMBINE_CHECK_ALL_LOS //we should merge these. Now we wanna check to make sure combining From f8300693b446efa1d190d27114a18fd0f9a620f4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:50 -0600 Subject: [PATCH 515/707] Remove commented printf : Adding item2: %i --- zone/oldcode.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/oldcode.cpp b/zone/oldcode.cpp index f6b434cc9..075923360 100644 --- a/zone/oldcode.cpp +++ b/zone/oldcode.cpp @@ -1798,7 +1798,6 @@ void ZoneDatabase::AddLootDropToNPC(uint32 lootdrop_id, ItemList* itemlist) { } else { - //printf("Adding item2: %i",item->item_id); //cout << "Adding item to Mob" << endl; ServerLootItem_Struct* item = new ServerLootItem_Struct; item->item_id = dbitem->ItemNumber; From e4025545fe1fe01104a48b87c70a7fac95202e20 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:51 -0600 Subject: [PATCH 516/707] Remove commented printf : Checking combine LOS on %d, with %d edges.\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index f363c4a4b..1bfeab406 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -990,7 +990,6 @@ RESTART_GRID_CLEAN: //we should merge these. Now we wanna check to make sure combining //them will not cause the old node's edges to become invalid. -//printf("Checking combine LOS on %d, with %d edges.\n", r, big->edges.size()); badlos = false; if(node_edges.count(f) == 1) { From 6243a53e5c1111dc1172367f0b268a45886e54e5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:53 -0600 Subject: [PATCH 517/707] Remove commented printf : Edge crosses %d edges.\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index 1bfeab406..f865ff147 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1609,7 +1609,6 @@ void count_crossing_lines(list &edges, PathGraph *out, PathGraph *ex if(count >= CROSS_REDUCE_COUNT) { -//printf("Edge crosses %d edges.\n", count); out->edges.push_back(e); cross_edge_count++; cross_list[e] = hits; From 33a840a0e71a46b1ac588dc5cf5f1c4c1b15bb72 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:58 -0600 Subject: [PATCH 518/707] Remove commented printf : Started With node index %d (0x%x)\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index f865ff147..fdf56048e 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1837,7 +1837,6 @@ QTNode *build_quadtree(Map *map, PathGraph *big) { end = _root->nodes.end(); //int findex = 0; for(; curs != end; curs++) { -//printf("Started With node index %d (0x%x)\n", findex++, *curs); } _root->divideYourself(0); From 2ccfc5b52df221c998059db83e33ca1d9c096348 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:34:59 -0600 Subject: [PATCH 519/707] Remove commented printf : Filling node %d/%d n=0x%x, lb=0x%x, curl=0x%x/0x%x\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index fdf56048e..d3d904a95 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1904,7 +1904,6 @@ bool write_path_file(QTNode *_root, PathGraph *big, const char *file, vector< ve end = big->nodes.end(); int nn = 0; for(; cur != end; cur++, curn++, nn++) { -//printf("Filling node %d/%d n=0x%x, lb=0x%x, curl=0x%x/0x%x\n", nn, index, *cur, linkBlock, curl, &linkBlock[eoffset]); n = *cur; if(n == NULL) { printf("Got NULL node building quadtree, WTF."); From dc44c1c361411774fb7ef655d9174a33d68e2d5a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:35:01 -0600 Subject: [PATCH 520/707] Remove commented printf : Node %d: (%.2f,%.2f,%.2f) LO %d, D %d\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index d3d904a95..c25185318 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1914,7 +1914,6 @@ int nn = 0; curn->z = n->z; curn->link_offset = eoffset; curn->distance = n->longest_path; -//printf("Node %d: (%.2f,%.2f,%.2f) LO %d, D %d\n", nn, curn->x, curn->y, curn->z, curn->link_offset, curn->distance); int ecount = 0; cur4 = big->edges.begin(); From 5dfb66bd6337836a407d0a40d84e1b3243503f48 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:35:02 -0600 Subject: [PATCH 521/707] Remove commented printf : \tLinkFrom %d: dest %d, reach %d\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index c25185318..b7963274e 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1926,7 +1926,6 @@ int nn = 0; curl = &linkBlock[eoffset]; curl->dest_node = e->to->node_id; curl->reach = e->normal_reach; -//printf("\tLinkFrom %d: dest %d, reach %d\n", eoffset, curl->dest_node, curl->reach); from_edges[e] = ecount; ecount++; eoffset++; From 9ed412e0569a0f12b5301768032ebf6c80779ba1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:35:03 -0600 Subject: [PATCH 522/707] Remove commented printf : \tLinkTo %d: dest %d, reach %d\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index b7963274e..fc4dc0175 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1934,7 +1934,6 @@ int nn = 0; curl = &linkBlock[eoffset]; curl->dest_node = e->from->node_id; curl->reach = e->reverse_reach; -//printf("\tLinkTo %d: dest %d, reach %d\n", eoffset, curl->dest_node, curl->reach); to_edges[e] = ecount; ecount++; eoffset++; From d566bb472842c5ae1ea1e8594aec308c728623ae Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:35:04 -0600 Subject: [PATCH 523/707] Remove commented printf : Used up to slot %d of %d in links\n --- utils/deprecated/apathing/actions.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/utils/deprecated/apathing/actions.cpp b/utils/deprecated/apathing/actions.cpp index fc4dc0175..d48fc6e88 100644 --- a/utils/deprecated/apathing/actions.cpp +++ b/utils/deprecated/apathing/actions.cpp @@ -1944,7 +1944,6 @@ int nn = 0; printf("ERROR: a node has more than %d links, number will be truncated!", PATH_LINK_OFFSET_NONE-1); } curn->link_count = ecount; -//printf("Used up to slot %d of %d in links\n", eoffset, head.link_count); } //write vertexBlock From e271049fada5b05a52911871ddf823133d718a90 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:37:57 -0600 Subject: [PATCH 524/707] Remove Duplicative MySQL Error: Error in CreateLauncher query: %s --- common/database.cpp | 1 - common/shareddb.cpp | 1 - world/eql_config.cpp | 1 - 3 files changed, 3 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index e300bf586..52850658e 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -137,7 +137,6 @@ uint32 Database::CheckLogin(const char* name, const char* password, int16* oStat if (!results.Success()) { - std::cerr << "Error in CheckLogin query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index eec7dc0f5..14e43c6de 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -46,7 +46,6 @@ bool SharedDatabase::SetHideMe(uint32 account_id, uint8 hideme) std::string query = StringFormat("UPDATE account SET hideme = %i WHERE id = %i", hideme, account_id); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetGMSpeed query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } diff --git a/world/eql_config.cpp b/world/eql_config.cpp index d8b60d209..b8ce0dddb 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -73,7 +73,6 @@ EQLConfig *EQLConfig::CreateLauncher(const char *name, uint8 dynamic_count) { std::string query = StringFormat("INSERT INTO launcher (name, dynamics) VALUES('%s', %d)", namebuf, dynamic_count); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in CreateLauncher query: %s", results.ErrorMessage().c_str()); return nullptr; } From 8ecbf7c4dc1f0b52d822883f3bcc8a5b39bf88f5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:37:58 -0600 Subject: [PATCH 525/707] Remove Duplicative MySQL Error: Query failed: %s. --- zone/client.cpp | 1 - zone/client_packet.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index 59e7f25ee..a0860e1c7 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3833,7 +3833,6 @@ void Client::KeyRingLoad() "WHERE char_id = '%i' ORDER BY item_id", character_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in Client::KeyRingLoad query '" << query << "' " << results.ErrorMessage() << std::endl; return; } diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 6ecfae636..5a7d78fc1 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -6193,7 +6193,6 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) safe_delete_array(escSearchString); auto results = database.QueryDatabase(query); if (!results.Success()) { - Message(0, "Query failed: %s.", results.ErrorMessage().c_str()); return; } From 60d7b59ac8b6affe657ae1879b29709d2fbae330 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:37:58 -0600 Subject: [PATCH 526/707] Remove Duplicative MySQL Error: Unable to query zone flags: %s --- zone/command.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/command.cpp b/zone/command.cpp index 47f5517ab..df07b69f0 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -7384,7 +7384,6 @@ void command_flagedit(Client *c, const Seperator *sep) { "FROM zone WHERE flag_needed != ''"; auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(13, "Unable to query zone flags: %s", results.ErrorMessage().c_str()); return; } From fb03e8c67d5166dc30d157affa5c8674991fb54d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:37:58 -0600 Subject: [PATCH 527/707] Remove Duplicative MySQL Error: Error querying database for monster summoning pet in zone %s (%s) --- zone/doors.cpp | 1 - zone/forage.cpp | 1 - zone/mob_ai.cpp | 1 - zone/object.cpp | 1 - zone/pets.cpp | 1 - 5 files changed, 5 deletions(-) diff --git a/zone/doors.cpp b/zone/doors.cpp index 76ecb53fc..66ac4bf16 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -578,7 +578,6 @@ int32 ZoneDatabase::GetDoorsCount(uint32* oMaxID, const char *zone_name, int16 v zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetDoorsCount query '" << query << "' " << results.ErrorMessage() << std::endl; return -1; } diff --git a/zone/forage.cpp b/zone/forage.cpp index 3fe61f9d1..5b407c0f5 100644 --- a/zone/forage.cpp +++ b/zone/forage.cpp @@ -114,7 +114,6 @@ uint32 ZoneDatabase::GetZoneFishing(uint32 ZoneID, uint8 skill, uint32 &npc_id, ZoneID, skill); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in Fishing query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 67b8d4480..e46f10ff6 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2680,7 +2680,6 @@ DBnpcspells_Struct* ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) { "idle_b_chance FROM npc_spells WHERE id=%d", iDBSpellsID); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in AddNPCSpells query1 '" << query << "' " << results.ErrorMessage() << std::endl; return nullptr; } diff --git a/zone/object.cpp b/zone/object.cpp index 07ff5858b..f1fd818aa 100644 --- a/zone/object.cpp +++ b/zone/object.cpp @@ -653,7 +653,6 @@ Ground_Spawns* ZoneDatabase::LoadGroundSpawns(uint32 zone_id, int16 version, Gro "LIMIT 50", zone_id, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in LoadGroundSpawns query '" << query << "' " << results.ErrorMessage() << std::endl; return gs; } diff --git a/zone/pets.cpp b/zone/pets.cpp index 22fa379ce..04878bfd6 100644 --- a/zone/pets.cpp +++ b/zone/pets.cpp @@ -372,7 +372,6 @@ void Mob::MakePoweredPet(uint16 spell_id, const char* pettype, int16 petpower, auto results = database.QueryDatabase(query); if (!results.Success()) { // if the database query failed - Log.Out(Logs::General, Logs::Error, "Error querying database for monster summoning pet in zone %s (%s)", zone->GetShortName(), results.ErrorMessage().c_str()); } if (results.RowCount() != 0) { From ef312b7b48cd4383a369a6721943fb72b257b4bb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:38:43 -0600 Subject: [PATCH 528/707] Remove Duplicative MySQL Error: --- common/database.cpp | 1 - common/shareddb.cpp | 1 - world/eql_config.cpp | 1 - zone/zone.cpp | 1 - zone/zonedb.cpp | 1 - 5 files changed, 5 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 52850658e..d933e3ee4 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -162,7 +162,6 @@ bool Database::CheckBannedIPs(const char* loginIP) if (!results.Success()) { - std::cerr << "Error in CheckBannedIPs query '" << query << "' " << results.ErrorMessage() << std::endl; return true; } diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 14e43c6de..53e6d2306 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -57,7 +57,6 @@ uint8 SharedDatabase::GetGMSpeed(uint32 account_id) std::string query = StringFormat("SELECT gmspeed FROM account WHERE id = '%i'", account_id); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetGMSpeed query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } diff --git a/world/eql_config.cpp b/world/eql_config.cpp index b8ce0dddb..0d9858908 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -117,7 +117,6 @@ void EQLConfig::DeleteLauncher() { std::string query = StringFormat("DELETE FROM launcher WHERE name = '%s'", namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in DeleteLauncher 1st query: %s", results.ErrorMessage().c_str()); return; } diff --git a/zone/zone.cpp b/zone/zone.cpp index 8d42c2ad6..2f7e00522 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -1643,7 +1643,6 @@ bool ZoneDatabase::LoadStaticZonePoints(LinkedList* zone_point_list, "ORDER BY number", zonename, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error1 in LoadStaticZonePoints query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index e2e6689b0..845e5333c 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -271,7 +271,6 @@ bool ZoneDatabase::logevents(const char* accountname,uint32 accountid,uint8 stat safe_delete_array(targetarr); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in logevents" << query << "' " << results.ErrorMessage() << std::endl; return false; } From c82ada6dc403f32b855360d5e9540c5f4afde442 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:38:43 -0600 Subject: [PATCH 529/707] Remove Duplicative MySQL Error: --- zone/client.cpp | 1 - zone/command.cpp | 1 - 2 files changed, 2 deletions(-) diff --git a/zone/client.cpp b/zone/client.cpp index a0860e1c7..0456bc36c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3853,7 +3853,6 @@ void Client::KeyRingAdd(uint32 item_id) std::string query = StringFormat("INSERT INTO keyring(char_id, item_id) VALUES(%i, %i)", character_id, item_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in Doors::HandleClick query '" << query << "' " << results.ErrorMessage() << std::endl; return; } diff --git a/zone/command.cpp b/zone/command.cpp index df07b69f0..59c738e49 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10130,7 +10130,6 @@ void command_mysql(Client *c, const Seperator *sep) std::replace(query.begin(), query.end(), '#', '%'); auto results = database.QueryDatabase(query); if (!results.Success()) { - c->Message(0, "Invalid query: '%s', '%s'", sep->arg[2], results.ErrorMessage().c_str()); return; } From 611e6e7d4e7c35715139bc9461e83dc821d7ae81 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:34 -0600 Subject: [PATCH 530/707] Remove Duplicative MySQL Error: Error in Database::AddBannedIP query ' --- common/database.cpp | 1 - zone/doors.cpp | 1 - zone/mob_ai.cpp | 1 - zone/zonedb.cpp | 1 - 4 files changed, 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index d933e3ee4..be4812881 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -175,7 +175,6 @@ bool Database::AddBannedIP(char* bannedIP, const char* notes) { std::string query = StringFormat("INSERT into Banned_IPs SET ip_address='%s', notes='%s'", bannedIP, notes); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in Database::AddBannedIP query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } return true; diff --git a/zone/doors.cpp b/zone/doors.cpp index 66ac4bf16..2f195da55 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -604,7 +604,6 @@ int32 ZoneDatabase::GetDoorsCountPlusOne(const char *zone_name, int16 version) { "WHERE zone = '%s' AND version = %u", zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetDoorsCountPlusOne query '" << query << "' " << results.ErrorMessage() << std::endl; return -1; } diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index e46f10ff6..5f83d3ecb 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2715,7 +2715,6 @@ DBnpcspells_Struct* ZoneDatabase::GetNPCSpells(uint32 iDBSpellsID) { if (!results.Success()) { - std::cerr << "Error in AddNPCSpells query1 '" << query << "' " << results.ErrorMessage() << std::endl; return nullptr; } diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 845e5333c..2678b2ec4 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -318,7 +318,6 @@ void ZoneDatabase::UpdateBug(BugStruct* bug) { safe_delete_array(targettext); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in UpdateBug '" << query << "' " << results.ErrorMessage() << std::endl; } From 7a90d52e627feb6c71eebd034d700dd776063582 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:34 -0600 Subject: [PATCH 531/707] Remove Duplicative MySQL Error: Error in SetGMSpeed query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 53e6d2306..fb1f48345 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -73,7 +73,6 @@ bool SharedDatabase::SetGMSpeed(uint32 account_id, uint8 gmspeed) std::string query = StringFormat("UPDATE account SET gmspeed = %i WHERE id = %i", gmspeed, account_id); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetGMSpeed query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From cb78ee6ccd84141ceb83834ef0d842e8bae2a636 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:34 -0600 Subject: [PATCH 532/707] Remove Duplicative MySQL Error: Error in DeleteLauncher 2nd query: %s --- world/eql_config.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 0d9858908..1e499037c 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -123,7 +123,6 @@ void EQLConfig::DeleteLauncher() { query = StringFormat("DELETE FROM launcher_zones WHERE launcher = '%s'", namebuf); results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in DeleteLauncher 2nd query: %s", results.ErrorMessage().c_str()); return; } } From 6decdb67883f54e6a106d4c8f161b9e2cb46b898 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:35 -0600 Subject: [PATCH 533/707] Remove Duplicative MySQL Error: Error in IsDiscovered query ' --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index 0456bc36c..677c45b5a 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -3892,7 +3892,6 @@ bool Client::IsDiscovered(uint32 itemid) { std::string query = StringFormat("SELECT count(*) FROM discovered_items WHERE item_id = '%lu'", itemid); auto results = database.QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in IsDiscovered query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 71fee1ddb65512ff81a8712e34fc00bab7017d8d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:35 -0600 Subject: [PATCH 534/707] Remove Duplicative MySQL Error: Error in GetDoorsCountPlusOne query ' --- zone/doors.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/doors.cpp b/zone/doors.cpp index 2f195da55..88c390e7d 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -627,7 +627,6 @@ int32 ZoneDatabase::GetDoorsDBCountPlusOne(const char *zone_name, int16 version) zone_name, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetDoorsCountPlusOne query '" << query << "' " << results.ErrorMessage() << std::endl; return -1; } From 0e229895ecdfb05ebd021d3dca939f6cb46606d9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:35 -0600 Subject: [PATCH 535/707] Remove Duplicative MySQL Error: Error in GetMaxNPCSpellsID query ' --- zone/mob_ai.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index 5f83d3ecb..d16662e4c 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2771,7 +2771,6 @@ uint32 ZoneDatabase::GetMaxNPCSpellsID() { std::string query = "SELECT max(id) from npc_spells"; auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetMaxNPCSpellsID query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From 38723fc4bfa1689f1abb0dfe6e9b898884970f1a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:35 -0600 Subject: [PATCH 536/707] Remove Duplicative MySQL Error: Error in UpdateBug ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 2678b2ec4..83335109c 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -334,7 +334,6 @@ void ZoneDatabase::UpdateBug(PetitionBug_Struct* bug){ safe_delete_array(bugtext); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in UpdateBug '" << query << "' " << results.ErrorMessage() << std::endl; } From f0197219ab74ad30022cf4ab861a068fe845e00d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:44 -0600 Subject: [PATCH 537/707] Remove Duplicative MySQL Error: Error in Log IP query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index be4812881..1a852f292 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -203,7 +203,6 @@ void Database::LoginIP(uint32 AccountID, const char* LoginIP) { std::string query = StringFormat("INSERT INTO account_ip SET accid=%i, ip='%s' ON DUPLICATE KEY UPDATE count=count+1, lastused=now()", AccountID, LoginIP); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in Log IP query '" << query << "' " << results.ErrorMessage() << std::endl; } int16 Database::CheckStatus(uint32 account_id) { From 487c53794c97f9eaee98af48381206eb80d966f1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:44 -0600 Subject: [PATCH 538/707] Remove Duplicative MySQL Error: Error in GetSharedPlatinum query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index fb1f48345..02a5da943 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -317,7 +317,6 @@ int32 SharedDatabase::GetSharedPlatinum(uint32 account_id) std::string query = StringFormat("SELECT sharedplat FROM account WHERE id = '%i'", account_id); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetSharedPlatinum query '" << query << "' " << results.ErrorMessage().c_str() << std::endl; return false; } From bdc3834f5aeb57da7ec777f0eb3e9ac01df27b71 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:44 -0600 Subject: [PATCH 539/707] Remove Duplicative MySQL Error: Error in BootStaticZone query: %s --- world/eql_config.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 1e499037c..4ef8b25c7 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -170,7 +170,6 @@ bool EQLConfig::BootStaticZone(Const_char *short_name, uint16 port) { "VALUES('%s', '%s', %d)", namebuf, zonebuf, port); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in BootStaticZone query: %s", results.ErrorMessage().c_str()); return false; } From 7f76ee04b0629e1b647547bf3922749d872d1eb7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:44 -0600 Subject: [PATCH 540/707] Remove Duplicative MySQL Error: Error in LoadAccountFlags query ' --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index 677c45b5a..e7dbc1aca 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7759,7 +7759,6 @@ void Client::LoadAccountFlags() account_id); auto results = database.QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in LoadAccountFlags query '" << query << "' " << results.ErrorMessage() << std::endl; return; } From be4f8196c673bfe3a8664991567ac7894b8b0cad Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:45 -0600 Subject: [PATCH 541/707] Remove Duplicative MySQL Error: Error in DBLoadDoors query ' --- zone/doors.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/doors.cpp b/zone/doors.cpp index 88c390e7d..6f218711e 100644 --- a/zone/doors.cpp +++ b/zone/doors.cpp @@ -654,7 +654,6 @@ bool ZoneDatabase::LoadDoors(int32 iDoorCount, Door *into, const char *zone_name "ORDER BY doorid asc", zone_name, version); auto results = QueryDatabase(query); if (!results.Success()){ - std::cerr << "Error in DBLoadDoors query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 0313ab2ac216737289c5ee83d58fb754d884f680 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:45 -0600 Subject: [PATCH 542/707] Remove Duplicative MySQL Error: Error in AddNPCSpells query1 ' --- zone/mob_ai.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index d16662e4c..d750e5d93 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2813,7 +2813,6 @@ DBnpcspellseffects_Struct* ZoneDatabase::GetNPCSpellsEffects(uint32 iDBSpellsEff std::string query = StringFormat("SELECT id, parent_list FROM npc_spells_effects WHERE id=%d", iDBSpellsEffectsID); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in AddNPCSpells query1 '" << query << "' " << results.ErrorMessage() << std::endl; return nullptr; } From 6dcbccc0b6f17645117240901f1812d69ec7346e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:45 -0600 Subject: [PATCH 543/707] Remove Duplicative MySQL Error: ERROR Bandolier Save: --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 83335109c..7d1951595 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1270,7 +1270,6 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i std::string query = StringFormat("REPLACE INTO `character_bandolier` (id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name) VALUES (%u, %u, %u, %u, %u,'%s')", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name_esc); auto results = QueryDatabase(query); Log.Out(Logs::General, Logs::None, "ZoneDatabase::SaveCharacterBandolier for character ID: %i, bandolier_id: %u, bandolier_slot: %u item_id: %u, icon:%u band_name:%s done", character_id, bandolier_id, bandolier_slot, item_id, icon, bandolier_name); - if (!results.RowsAffected()){ std::cout << "ERROR Bandolier Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } From 3a3cc8a8f6d53b78842ede6202544d1cda71bb37 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:46 -0600 Subject: [PATCH 544/707] Remove Duplicative MySQL Error: Error in CheckStatus query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 1a852f292..a40e7c4af 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -211,7 +211,6 @@ int16 Database::CheckStatus(uint32 account_id) { auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in CheckStatus query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From f15221784ca917ebeef9f42e4cdd805f39147343 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:47 -0600 Subject: [PATCH 545/707] Remove Duplicative MySQL Error: Error in SetSharedPlatinum query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 02a5da943..ba22da768 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -332,7 +332,6 @@ bool SharedDatabase::SetSharedPlatinum(uint32 account_id, int32 amount_to_add) { std::string query = StringFormat("UPDATE account SET sharedplat = sharedplat + %i WHERE id = %i", amount_to_add, account_id); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetSharedPlatinum query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 9d89ad53deb4919e11ea45e91c7aa9dd692cc65e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:47 -0600 Subject: [PATCH 546/707] Remove Duplicative MySQL Error: Error in ChangeStaticZone query: %s --- world/eql_config.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 4ef8b25c7..dec569cf4 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -213,7 +213,6 @@ bool EQLConfig::ChangeStaticZone(Const_char *short_name, uint16 port) { "launcher = '%s' AND zone = '%s'",port, namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in ChangeStaticZone query: %s", results.ErrorMessage().c_str()); return false; } From 04ed14f42495b321d5c4bd77fe4e850ef61d59f8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:47 -0600 Subject: [PATCH 547/707] Remove Duplicative MySQL Error: Error in SetAccountFlags query ' --- zone/client.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index e7dbc1aca..cd58cfa7c 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -7773,7 +7773,6 @@ void Client::SetAccountFlag(std::string flag, std::string val) { account_id, flag.c_str(), val.c_str()); auto results = database.QueryDatabase(query); if(!results.Success()) { - std::cerr << "Error in SetAccountFlags query '" << query << "' " << results.ErrorMessage() << std::endl; return; } From 22feb20def60dbf1ea081f7693994f72c8825cbe Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:47 -0600 Subject: [PATCH 548/707] Remove Duplicative MySQL Error: Error in GetMaxNPCSpellsEffectsID query ' --- zone/mob_ai.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/mob_ai.cpp b/zone/mob_ai.cpp index d750e5d93..146b33e41 100644 --- a/zone/mob_ai.cpp +++ b/zone/mob_ai.cpp @@ -2856,7 +2856,6 @@ uint32 ZoneDatabase::GetMaxNPCSpellsEffectsID() { std::string query = "SELECT max(id) FROM npc_spells_effects"; auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetMaxNPCSpellsEffectsID query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From f1fd957e902c6e44fa347c4b6f063c6892cdbb13 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:47 -0600 Subject: [PATCH 549/707] Remove Duplicative MySQL Error: ERROR Potionbelt Save: --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 7d1951595..2a923346e 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1276,7 +1276,6 @@ bool ZoneDatabase::SaveCharacterBandolier(uint32 character_id, uint8 bandolier_i bool ZoneDatabase::SaveCharacterPotionBelt(uint32 character_id, uint8 potion_id, uint32 item_id, uint32 icon) { std::string query = StringFormat("REPLACE INTO `character_potionbelt` (id, potion_id, item_id, icon) VALUES (%u, %u, %u, %u)", character_id, potion_id, item_id, icon); auto results = QueryDatabase(query); - if (!results.RowsAffected()){ std::cout << "ERROR Potionbelt Save: " << results.ErrorMessage() << "\n\n" << query << "\n" << std::endl; } return true; } From 9dd35679e5c3304df0c552667592577ae4bb801a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:54 -0600 Subject: [PATCH 550/707] Remove Duplicative MySQL Error: Error in CreateAccount query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index a40e7c4af..0ddc5b41f 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -246,7 +246,6 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in CreateAccount query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From 5f34f7e1a2318165f4b145a30691e3f35b1e02c8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:54 -0600 Subject: [PATCH 551/707] Remove Duplicative MySQL Error: Error in GetBook query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index ba22da768..8bdb97034 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1057,7 +1057,6 @@ std::string SharedDatabase::GetBook(const char *txtfile) std::string query = StringFormat("SELECT txtfile FROM books WHERE name = '%s'", txtfile2); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetBook query '" << query << "' " << results.ErrorMessage() << std::endl; txtout.assign(" ",1); return txtout; } From 00cfd77c2651f7e5ee8cedf25438e244d1eca3b6 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:54 -0600 Subject: [PATCH 552/707] Remove Duplicative MySQL Error: Error in DeleteStaticZone query: %s --- world/eql_config.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/eql_config.cpp b/world/eql_config.cpp index dec569cf4..6d6e7e674 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -249,7 +249,6 @@ bool EQLConfig::DeleteStaticZone(Const_char *short_name) { "launcher = '%s' AND zone = '%s'", namebuf, zonebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in DeleteStaticZone query: %s", results.ErrorMessage().c_str()); return false; } From c765003ef2266bec9884a1a75d2c3267c14551ca Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:54 -0600 Subject: [PATCH 553/707] Remove Duplicative MySQL Error: Error loading NPCs from database. Bad query: --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 2a923346e..8e69ba266 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -1753,7 +1753,6 @@ const NPCType* ZoneDatabase::GetNPCType (uint32 id) { auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error loading NPCs from database. Bad query: " << results.ErrorMessage() << std::endl; return nullptr; } From e2bc4ec647900957339c1e4f4b5b0bb978d5ed87 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:58 -0600 Subject: [PATCH 554/707] Remove Duplicative MySQL Error: Error in CreateAccount query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 0ddc5b41f..8085d28f7 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -251,7 +251,6 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta if (results.LastInsertedID() == 0) { - std::cerr << "Error in CreateAccount query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From a2514c9d6424dfeb533f9e7320e4ba60ecab0ab9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:58 -0600 Subject: [PATCH 555/707] Remove Duplicative MySQL Error: Error in GetCommands query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 8bdb97034..d30ad0754 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1294,7 +1294,6 @@ bool SharedDatabase::GetCommandSettings(std::map &commands) { const std::string query = "SELECT command, access FROM commands"; auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetCommands query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 8697b9a630f90fc2f599bce82fa796b52fd1e8c0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:58 -0600 Subject: [PATCH 556/707] Remove Duplicative MySQL Error: Error in SetDynamicCount query: %s --- world/eql_config.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/world/eql_config.cpp b/world/eql_config.cpp index 6d6e7e674..255f6d3a0 100644 --- a/world/eql_config.cpp +++ b/world/eql_config.cpp @@ -273,7 +273,6 @@ bool EQLConfig::SetDynamicCount(int count) { std::string query = StringFormat("UPDATE launcher SET dynamics=%d WHERE name='%s'", count, namebuf); auto results = database.QueryDatabase(query); if (!results.Success()) { - Log.Out(Logs::General, Logs::Error, "Error in SetDynamicCount query: %s", results.ErrorMessage().c_str()); return false; } From ca21aa70cfeb1ea5ffda78a6bef88028838a50db Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:41:58 -0600 Subject: [PATCH 557/707] Remove Duplicative MySQL Error: Error loading Mercenaries from database. Bad query: --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 8e69ba266..8f607b438 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2015,7 +2015,6 @@ const NPCType* ZoneDatabase::GetMercType(uint32 id, uint16 raceid, uint32 client auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error loading Mercenaries from database. Bad query: " << results.ErrorMessage() << std::endl; return nullptr; } From 539f216ca62f794b2e16195e1e33bc19861ac765 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:02 -0600 Subject: [PATCH 558/707] Remove Duplicative MySQL Error: Error in DeleteAccount query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 8085d28f7..99b124e4b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -265,7 +265,6 @@ bool Database::DeleteAccount(const char* name) { if (!results.Success()) { - std::cerr << "Error in DeleteAccount query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From abab487d7e7482f80aa0b034f2e1d77b00053e1d Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:02 -0600 Subject: [PATCH 559/707] Remove Duplicative MySQL Error: Error in GetBotInspectMessage query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index d30ad0754..bef8010e4 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1966,7 +1966,6 @@ void SharedDatabase::GetBotInspectMessage(uint32 botid, InspectMessage_Struct* m std::string query = StringFormat("SELECT BotInspectMessage FROM bots WHERE BotID = %i", botid); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetBotInspectMessage query '" << query << "' " << results.ErrorMessage() << std::endl; return; } From 396621e32e5f33637ec8142cbf768e922b6fe3db Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:02 -0600 Subject: [PATCH 560/707] Remove Duplicative MySQL Error: Error in GetGridType query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 8f607b438..366a948ef 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2478,7 +2478,6 @@ uint8 ZoneDatabase::GetGridType(uint32 grid, uint32 zoneid ) { std::string query = StringFormat("SELECT type FROM grid WHERE id = %i AND zoneid = %i", grid, zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetGridType query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From efaff32153144b792704c790f322299ec9ddb189 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:04 -0600 Subject: [PATCH 561/707] Remove Duplicative MySQL Error: Error in SetLocalPassword query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 99b124e4b..be0ab477c 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -277,7 +277,6 @@ bool Database::SetLocalPassword(uint32 accid, const char* password) { auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetLocalPassword query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 590fa78539043b53b068fdd4ad8329ca18da757a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:04 -0600 Subject: [PATCH 562/707] Remove Duplicative MySQL Error: Error in SetBotInspectMessage query ' --- common/shareddb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index bef8010e4..3cdca5a23 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1983,6 +1983,5 @@ void SharedDatabase::SetBotInspectMessage(uint32 botid, const InspectMessage_Str std::string query = StringFormat("UPDATE bots SET BotInspectMessage = '%s' WHERE BotID = %i", msg.c_str(), botid); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in SetBotInspectMessage query '" << query << "' " << results.ErrorMessage() << std::endl; } From 04754c67a79c2cb97f0e7ab0986505cd10c15c3c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:04 -0600 Subject: [PATCH 563/707] Remove Duplicative MySQL Error: Error in SaveMerchantTemp query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 366a948ef..ddaf9155d 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2495,7 +2495,6 @@ void ZoneDatabase::SaveMerchantTemp(uint32 npcid, uint32 slot, uint32 item, uint "VALUES(%d, %d, %d, %d)", npcid, slot, item, charges); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in SaveMerchantTemp query '" << query << "' " << results.ErrorMessage() << std::endl; } void ZoneDatabase::DeleteMerchantTemp(uint32 npcid, uint32 slot){ From 28506839c013a7b130c8e0e6bfdc4820d0dd7d5e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:05 -0600 Subject: [PATCH 564/707] Remove Duplicative MySQL Error: Error in GetAccountIDByChar query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index be0ab477c..6bc3f6445 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -767,7 +767,6 @@ uint32 Database::GetAccountIDByChar(const char* charname, uint32* oCharID) { if (!results.Success()) { - std::cerr << "Error in GetAccountIDByChar query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From ffed0514d201d6c15624d00f8d9afde65e5296b2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:06 -0600 Subject: [PATCH 565/707] Remove Duplicative MySQL Error: Error in DeleteMerchantTemp query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index ddaf9155d..85dcd52ca 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2502,7 +2502,6 @@ void ZoneDatabase::DeleteMerchantTemp(uint32 npcid, uint32 slot){ std::string query = StringFormat("DELETE FROM merchantlist_temp WHERE npcid=%d AND slot=%d", npcid, slot); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in DeleteMerchantTemp query '" << query << "' " << results.ErrorMessage() << std::endl; } From 9f9253220c0d48ea568279919a3636fdd9e4e5a8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:07 -0600 Subject: [PATCH 566/707] Remove Duplicative MySQL Error: Error in GetAccountIDByAcc query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 6bc3f6445..b2a462be2 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -806,7 +806,6 @@ uint32 Database::GetAccountIDByName(const char* accname, int16* status, uint32* auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetAccountIDByAcc query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From d46ede8db11c3aee80818d567998a8f34b01bcd4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:07 -0600 Subject: [PATCH 567/707] Remove Duplicative MySQL Error: Error in GetUseCFGSafeCoords query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 85dcd52ca..66bcf8810 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2521,7 +2521,6 @@ uint8 ZoneDatabase::GetUseCFGSafeCoords() const std::string query = "SELECT value FROM variables WHERE varname='UseCFGSafeCoords'"; auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetUseCFGSafeCoords query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From c3233c02dbe2d3acf2ba6530c338649f2622ba9a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:08 -0600 Subject: [PATCH 568/707] Remove Duplicative MySQL Error: Error in GetAccountName query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index b2a462be2..a84d1b871 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -834,7 +834,6 @@ void Database::GetAccountName(uint32 accountid, char* name, uint32* oLSAccountID auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetAccountName query '" << query << "' " << results.ErrorMessage() << std::endl; return; } From 9574e916698c6637a6a5e758b0cc7e0079c6a16e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:08 -0600 Subject: [PATCH 569/707] Remove Duplicative MySQL Error: Error in GetZoneTZ query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 66bcf8810..272ae54f3 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2540,7 +2540,6 @@ uint32 ZoneDatabase::GetZoneTZ(uint32 zoneid, uint32 version) { zoneid, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetZoneTZ query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From 63682510a80e150105ec34a89e8e0be9ba5251f8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:09 -0600 Subject: [PATCH 570/707] Remove Duplicative MySQL Error: Error in GetCharName query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index a84d1b871..5106ffaef 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -854,7 +854,6 @@ void Database::GetCharName(uint32 char_id, char* name) { auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetCharName query '" << query << "' " << results.ErrorMessage() << std::endl; return; } From 992f99303e3c396502e4c4c9f2bb0372b237cb3f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:09 -0600 Subject: [PATCH 571/707] Remove Duplicative MySQL Error: Error in SetZoneTZ query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 272ae54f3..7b07eef43 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2557,7 +2557,6 @@ bool ZoneDatabase::SetZoneTZ(uint32 zoneid, uint32 version, uint32 tz) { tz, zoneid, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetZoneTZ query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 8160768fccc7451156ce0776a7b9d43cf17eb5f7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:11 -0600 Subject: [PATCH 572/707] Remove Duplicative MySQL Error: Error in LoadVariables query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 5106ffaef..b3ca2e475 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2410,7 +2410,6 @@ bool Database::LoadVariables() { if (!results.Success()) { - std::cerr << "Error in LoadVariables query '" << query << "' " << results.ErrorMessage() << std::endl; safe_delete_array(query); return false; } From 77a2737ad01cd8e989e8c75dfed52aa4e7722fac Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:11 -0600 Subject: [PATCH 573/707] Remove Duplicative MySQL Error: Error in group update query: %s\n --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 7b07eef43..710fcffb9 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2586,7 +2586,6 @@ void ZoneDatabase::RefreshGroupFromDB(Client *client){ auto results = QueryDatabase(query); if (!results.Success()) { - printf("Error in group update query: %s\n", results.ErrorMessage().c_str()); } else { From edbed7184f04fb8d41dfbcdf9d8419c43b06c851 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:12 -0600 Subject: [PATCH 574/707] Remove Duplicative MySQL Error: Error in SetVariable query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index b3ca2e475..a2929c240 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2521,7 +2521,6 @@ bool Database::SetVariable(const char* varname_in, const char* varvalue_in) { if (!results.Success()) { - std::cerr << "Error in SetVariable query '" << query << "' " << results.ErrorMessage() << std::endl; free(varname); free(varvalue); return false; From 94e63885fb4c8779ddcde79883f8d530d9312f39 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:12 -0600 Subject: [PATCH 575/707] Remove Duplicative MySQL Error: Error in GetBlockedSpellsCount query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 710fcffb9..8425e6772 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2657,7 +2657,6 @@ int32 ZoneDatabase::GetBlockedSpellsCount(uint32 zoneid) std::string query = StringFormat("SELECT count(*) FROM blocked_spells WHERE zoneid = %d", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetBlockedSpellsCount query '" << query << "' " << results.ErrorMessage() << std::endl; return -1; } From 4c3058b0d9b2555d4c2447d7c84299e3577a1d0b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:14 -0600 Subject: [PATCH 576/707] Remove Duplicative MySQL Error: Error in GetMiniLoginAccount query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index a2929c240..27b883091 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2553,7 +2553,6 @@ uint32 Database::GetMiniLoginAccount(char* ip){ if (!results.Success()) { - std::cerr << "Error in GetMiniLoginAccount query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From 5aba5c84735b065be54d7ad1ab1c173d24767824 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:14 -0600 Subject: [PATCH 577/707] Remove Duplicative MySQL Error: Error in LoadBlockedSpells query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 8425e6772..5f6ec3465 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2676,7 +2676,6 @@ bool ZoneDatabase::LoadBlockedSpells(int32 blockedSpellsCount, ZoneSpellsBlocked "FROM blocked_spells WHERE zoneid = %d ORDER BY id ASC", zoneid); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in LoadBlockedSpells query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From d3f265116eb8180eeb7279c504b2d588ca8a2f77 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:15 -0600 Subject: [PATCH 578/707] Remove Duplicative MySQL Error: Error in GetSafePoint query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 27b883091..b8818ff5e 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2570,7 +2570,6 @@ bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe if (!results.Success()) { - std::cerr << "Error in GetSafePoint query '" << query << "' " << results.ErrorMessage() << std::endl; std::cerr << "If it errors, run the following querys:\n"; std::cerr << "ALTER TABLE `zone` CHANGE `minium_level` `min_level` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT NULL;\n"; std::cerr << "ALTER TABLE `zone` CHANGE `minium_status` `min_status` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT NULL;\n"; From 56dfc97517f0121a2a540b1eb7ef9ad9fd3e599c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:16 -0600 Subject: [PATCH 579/707] Remove Duplicative MySQL Error: Error in getZoneShutDownDelay query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 5f6ec3465..78e18ebdf 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2711,7 +2711,6 @@ int ZoneDatabase::getZoneShutDownDelay(uint32 zoneID, uint32 version) "ORDER BY version DESC", zoneID, version); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in getZoneShutDownDelay query '" << query << "' " << results.ErrorMessage().c_str() << std::endl; return (RuleI(Zone, AutoShutdownDelay)); } From 245db04c4cad08bb6165ea4b5f092a411e801522 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:18 -0600 Subject: [PATCH 580/707] Remove Duplicative MySQL Error: Error in GetZoneLongName query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index b8818ff5e..d64cc6d8d 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2604,7 +2604,6 @@ bool Database::GetZoneLongName(const char* short_name, char** long_name, char* f auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetZoneLongName query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 8f96f52c047b45f14e152c04feb5cc3e68f68673 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:18 -0600 Subject: [PATCH 581/707] Remove Duplicative MySQL Error: Error in UpdateKarma query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 78e18ebdf..7a39c7b95 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2741,7 +2741,6 @@ void ZoneDatabase::UpdateKarma(uint32 acct_id, uint32 amount) std::string query = StringFormat("UPDATE account SET karma = %i WHERE id = %i", amount, acct_id); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in UpdateKarma query '" << query << "' " << results.ErrorMessage().c_str() << std::endl; } From cb18d3d1b54ed0e0d070bdd57465c6c8610b4e70 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:19 -0600 Subject: [PATCH 582/707] Remove Duplicative MySQL Error: Error in GetZoneGraveyardID query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index d64cc6d8d..16b8f82e1 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2643,7 +2643,6 @@ uint32 Database::GetZoneGraveyardID(uint32 zone_id, uint32 version) { if (!results.Success()) { - std::cerr << "Error in GetZoneGraveyardID query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From dbeef12a4f3374047d11cd211c28503703179fe5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:19 -0600 Subject: [PATCH 583/707] Remove Duplicative MySQL Error: Error in InsertDoor --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 7a39c7b95..485a28c2a 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2786,7 +2786,6 @@ void ZoneDatabase::InsertDoor(uint32 ddoordbid, uint16 ddoorid, const char* ddoo dlockpick, dkeyitem, ddoor_param, dinvert, dincline, dsize); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in InsertDoor" << query << "' " << results.ErrorMessage() << std::endl; } void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::map ¤cy) { From 8e64a8b1c59606747121eccdb5d567744cf1e959 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:20 -0600 Subject: [PATCH 584/707] Remove Duplicative MySQL Error: Error in GetZoneGraveyard query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 16b8f82e1..edd27d0b3 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2659,7 +2659,6 @@ bool Database::GetZoneGraveyard(const uint32 graveyard_id, uint32* graveyard_zon auto results = QueryDatabase(query); if (!results.Success()){ - std::cerr << "Error in GetZoneGraveyard query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 2c36b9070eeacdd0326ce314f085d60fcc843154 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:20 -0600 Subject: [PATCH 585/707] Remove Duplicative MySQL Error: Error in RemoveTempFactions query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 485a28c2a..4a0ccc83c 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3006,7 +3006,6 @@ void ZoneDatabase::RemoveTempFactions(Client *client) { client->CharacterID()); auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in RemoveTempFactions query '" << query << "' " << results.ErrorMessage() << std::endl; } From e127b01640bc6e41ade810136200a1543d44800c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:21 -0600 Subject: [PATCH 586/707] Remove Duplicative MySQL Error: Error in LoadZoneNames query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index edd27d0b3..4d2164e9a 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2688,7 +2688,6 @@ bool Database::LoadZoneNames() { if (!results.Success()) { - std::cerr << "Error in LoadZoneNames query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From f4fad223d084c1872c08bf3e64cef6e7ee07eead Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:22 -0600 Subject: [PATCH 587/707] Remove Duplicative MySQL Error: Error in SetCharacterFactionLevel query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 4a0ccc83c..185329e8b 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3219,7 +3219,6 @@ bool ZoneDatabase::SetCharacterFactionLevel(uint32 char_id, int32 faction_id, in char_id, faction_id); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetCharacterFactionLevel query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 78bbb9b03d2abd3934ccbaab252655aa9ed51bb9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:22 -0600 Subject: [PATCH 588/707] Remove Duplicative MySQL Error: Error in GetPEQZone query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 4d2164e9a..b2c67c14e 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2732,7 +2732,6 @@ uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){ if (!results.Success()) { - std::cerr << "Error in GetPEQZone query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From b4a6184c887a2b198b9c7d88591dc184f4a26f7b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:23 -0600 Subject: [PATCH 589/707] Remove Duplicative MySQL Error: Error in SetCharacterFactionLevel query ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 185329e8b..503ecdfc9 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3235,7 +3235,6 @@ bool ZoneDatabase::SetCharacterFactionLevel(uint32 char_id, int32 faction_id, in "VALUES (%i, %i, %i, %i)", char_id, faction_id, value, temp); results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetCharacterFactionLevel query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From a3dc49c50456045ffd983529cce99d0baaeeb23e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:24 -0600 Subject: [PATCH 590/707] Remove Duplicative MySQL Error: Error in CheckNameFilter query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index b2c67c14e..1760e5f78 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2802,7 +2802,6 @@ bool Database::CheckNameFilter(const char* name, bool surname) if (!results.Success()) { - std::cerr << "Error in CheckNameFilter query '" << query << "' " << results.ErrorMessage() << std::endl; // false through to true? shouldn't it be falls through to false? return true; } From c9ece3480c71aaba9d8e053a6a6a2d54d54b4a6a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:24 -0600 Subject: [PATCH 591/707] Remove Duplicative MySQL Error: Error in LoadFactionData ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 503ecdfc9..cc5ae2abc 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3250,7 +3250,6 @@ bool ZoneDatabase::LoadFactionData() std::string query = "SELECT MAX(id) FROM faction_list"; auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in LoadFactionData '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 8d7de051c54f2881419e144b0fe1a0146bead2b7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:25 -0600 Subject: [PATCH 592/707] Remove Duplicative MySQL Error: Error in AddToNameFilter query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 1760e5f78..fd75bfc48 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2827,7 +2827,6 @@ bool Database::AddToNameFilter(const char* name) { if (!results.Success()) { - std::cerr << "Error in AddToNameFilter query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 8186d43cad7e2c3f1679845399b25e0d5bf63036 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:25 -0600 Subject: [PATCH 593/707] Remove Duplicative MySQL Error: Error in LoadFactionData ' --- zone/zonedb.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index cc5ae2abc..603194696 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -3266,7 +3266,6 @@ bool ZoneDatabase::LoadFactionData() query = "SELECT id, name, base FROM faction_list"; results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in LoadFactionData '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From a269aa44090b26c8376104749d437ca0533e1f4c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:26 -0600 Subject: [PATCH 594/707] Remove Duplicative MySQL Error: Error in GetAccountIDFromLSID query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index fd75bfc48..03cba68fb 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2843,7 +2843,6 @@ uint32 Database::GetAccountIDFromLSID(uint32 iLSID, char* oAccountName, int16* o if (!results.Success()) { - std::cerr << "Error in GetAccountIDFromLSID query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From a1895b9cb32477d56d3e2099b76ee3056e7e9528 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:28 -0600 Subject: [PATCH 595/707] Remove Duplicative MySQL Error: Error in GetAccountFromID query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 03cba68fb..bba2ab12b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2868,7 +2868,6 @@ void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) { if (!results.Success()) { - std::cerr << "Error in GetAccountFromID query '" << query << "' " << results.ErrorMessage() << std::endl; return; } From 7b7ddb25fafd069c6e525a71a0567f1d17575c08 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:30 -0600 Subject: [PATCH 596/707] Remove Duplicative MySQL Error: Error in ClearMerchantTemp query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index bba2ab12b..4fa746ca3 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2888,7 +2888,6 @@ void Database::ClearMerchantTemp(){ auto results = QueryDatabase(query); if (!results.Success()) - std::cerr << "Error in ClearMerchantTemp query '" << query << "' " << results.ErrorMessage() << std::endl; } bool Database::UpdateName(const char* oldname, const char* newname) { From 11357f7e913da9df7178db964edf8bd2b40e6d0e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:31 -0600 Subject: [PATCH 597/707] Remove Duplicative MySQL Error: Error in CheckUsedName query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 4fa746ca3..a3453d224 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2909,7 +2909,6 @@ bool Database::CheckUsedName(const char* name) { std::string query = StringFormat("SELECT `id` FROM `character_data` WHERE `name` = '%s'", name); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in CheckUsedName query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 835c7d0fcea3cb2d7f8163e5f47c9989741067f5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:32 -0600 Subject: [PATCH 598/707] Remove Duplicative MySQL Error: Error in GetServerType query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index a3453d224..43deacfb0 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2922,7 +2922,6 @@ uint8 Database::GetServerType() { std::string query("SELECT `value` FROM `variables` WHERE `varname` = 'ServerType' LIMIT 1"); auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetServerType query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From c892bc4e2b0d079967e385b4cfa5e1f010022b23 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:33 -0600 Subject: [PATCH 599/707] Remove Duplicative MySQL Error: Error in MoveCharacterToZone(name) query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 43deacfb0..afe868ee2 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2940,7 +2940,6 @@ bool Database::MoveCharacterToZone(const char* charname, const char* zonename, u auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in MoveCharacterToZone(name) query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From de531af35417ed6e6071debc51c279bcb81fe9b4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:34 -0600 Subject: [PATCH 600/707] Remove Duplicative MySQL Error: Error in MoveCharacterToZone(id) query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index afe868ee2..fc4d64014 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2958,7 +2958,6 @@ bool Database::MoveCharacterToZone(uint32 iCharID, const char* iZonename) { auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in MoveCharacterToZone(id) query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 032de7f6ce06ec8d2f90e3227bb469d3a7c14979 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:35 -0600 Subject: [PATCH 601/707] Remove Duplicative MySQL Error: Error in SetHackerFlag query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index fc4d64014..572643715 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2969,7 +2969,6 @@ bool Database::SetHackerFlag(const char* accountname, const char* charactername, auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in SetHackerFlag query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 9cbe0d4b34020fb019ec453ececf876beea24678 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:36 -0600 Subject: [PATCH 602/707] Remove Duplicative MySQL Error: Error in SetMQDetectionFlag query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 572643715..a6ef4a1e9 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2982,7 +2982,6 @@ bool Database::SetMQDetectionFlag(const char* accountname, const char* character if (!results.Success()) { - std::cerr << "Error in SetMQDetectionFlag query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 78746a40facc2fa0bfc73ad8f69fbe8d651e22bf Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:39 -0600 Subject: [PATCH 603/707] Remove Duplicative MySQL Error: Error in GetCharacterInfo query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index a6ef4a1e9..26dcc75ea 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3061,7 +3061,6 @@ uint32 Database::GetCharacterInfo(const char* iName, uint32* oAccID, uint32* oZo auto results = QueryDatabase(query); if (!results.Success()) { - std::cerr << "Error in GetCharacterInfo query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From 3473e11376f4ad5b837772a172100cece667af8b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:40 -0600 Subject: [PATCH 604/707] Remove Duplicative MySQL Error: Error in UpdateLiveChar query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 26dcc75ea..e1dc19290 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3086,7 +3086,6 @@ bool Database::UpdateLiveChar(char* charname,uint32 lsaccount_id) { if (!results.Success()) { - std::cerr << "Error in UpdateLiveChar query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 3156efae63c1f1843d48acddf34fdc11fc327d9a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:42 -0600 Subject: [PATCH 605/707] Remove Duplicative MySQL Error: Error in GetLiveChar query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index e1dc19290..461f158e6 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3099,7 +3099,6 @@ bool Database::GetLiveChar(uint32 account_id, char* cname) { if (!results.Success()) { - std::cerr << "Error in GetLiveChar query '" << query << "' " << results.ErrorMessage() << std::endl; return false; } From 48caf1e41398e3d3202e5b7e5a795f0aa6626dab Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:42:43 -0600 Subject: [PATCH 606/707] Remove Duplicative MySQL Error: Error in GetGuildIDByChar query ' --- common/database.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/common/database.cpp b/common/database.cpp index 461f158e6..48a0377b3 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4199,7 +4199,6 @@ uint32 Database::GetGuildIDByCharID(uint32 char_id) if (!results.Success()) { - std::cerr << "Error in GetGuildIDByChar query '" << query << "' " << results.ErrorMessage() << std::endl; return 0; } From 5fa42ce90f1933e4dcf732e24485320fb78de389 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:46:06 -0600 Subject: [PATCH 607/707] Fix LoginIP from erorr message removal --- common/database.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 48a0377b3..f3dacc9f1 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -201,8 +201,7 @@ bool Database::AddGMIP(char* ip_address, char* name) { void Database::LoginIP(uint32 AccountID, const char* LoginIP) { std::string query = StringFormat("INSERT INTO account_ip SET accid=%i, ip='%s' ON DUPLICATE KEY UPDATE count=count+1, lastused=now()", AccountID, LoginIP); - auto results = QueryDatabase(query); - if (!results.Success()) + QueryDatabase(query); } int16 Database::CheckStatus(uint32 account_id) { From c86fc62132590fa22e10f4664ed4f5142d26c432 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:46:50 -0600 Subject: [PATCH 608/707] Fix SetBotInspectMesssage from error message removal --- common/shareddb.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 3cdca5a23..ddd792e6a 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1978,10 +1978,7 @@ void SharedDatabase::GetBotInspectMessage(uint32 botid, InspectMessage_Struct* m } void SharedDatabase::SetBotInspectMessage(uint32 botid, const InspectMessage_Struct* message) { - std::string msg = EscapeString(message->text); std::string query = StringFormat("UPDATE bots SET BotInspectMessage = '%s' WHERE BotID = %i", msg.c_str(), botid); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } From 1c6a0f054a42c811c70000069a478c936c0889d1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:47:24 -0600 Subject: [PATCH 609/707] Fix UpdateBug from error message removal --- zone/zonedb.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 603194696..f613b4173 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -316,9 +316,7 @@ void ZoneDatabase::UpdateBug(BugStruct* bug) { safe_delete_array(bugtext); safe_delete_array(uitext); safe_delete_array(targettext); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } void ZoneDatabase::UpdateBug(PetitionBug_Struct* bug){ From b800dd04c67ce72aa04943c173fd236b7671e935 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:47:41 -0600 Subject: [PATCH 610/707] Fix UpdateBug from error message removal --- zone/zonedb.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index f613b4173..579d80bac 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -330,9 +330,7 @@ void ZoneDatabase::UpdateBug(PetitionBug_Struct* bug){ "VALUES('%s', '%s', '%s', %i)", "Petition", bug->name, bugtext, 25); safe_delete_array(bugtext); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } bool ZoneDatabase::SetSpecialAttkFlag(uint8 id, const char* flag) { From 4efa8a18eb19ec4e7c97858df52b89e402d3ffaa Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:48:06 -0600 Subject: [PATCH 611/707] Fix SaveMerchantTemp from error message removal --- zone/zonedb.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 579d80bac..ccb0b0446 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2489,8 +2489,7 @@ void ZoneDatabase::SaveMerchantTemp(uint32 npcid, uint32 slot, uint32 item, uint std::string query = StringFormat("REPLACE INTO merchantlist_temp (npcid, slot, itemid, charges) " "VALUES(%d, %d, %d, %d)", npcid, slot, item, charges); - auto results = QueryDatabase(query); - if (!results.Success()) + QueryDatabase(query); } void ZoneDatabase::DeleteMerchantTemp(uint32 npcid, uint32 slot){ From 00db3d270c6baf48bdc3d6f11950b547a60ebec2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:48:39 -0600 Subject: [PATCH 612/707] Fix DeleteMerchantTemp from error message removal --- zone/zonedb.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index ccb0b0446..91870f68f 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2493,11 +2493,8 @@ void ZoneDatabase::SaveMerchantTemp(uint32 npcid, uint32 slot, uint32 item, uint } void ZoneDatabase::DeleteMerchantTemp(uint32 npcid, uint32 slot){ - std::string query = StringFormat("DELETE FROM merchantlist_temp WHERE npcid=%d AND slot=%d", npcid, slot); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } bool ZoneDatabase::UpdateZoneSafeCoords(const char* zonename, float x=0, float y=0, float z=0) { From 54868922ef4506a014292430c6c92f58aef09689 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:49:03 -0600 Subject: [PATCH 613/707] Fix UpdateKarma from error message removal --- zone/zonedb.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 91870f68f..812d647a6 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2731,9 +2731,7 @@ uint32 ZoneDatabase::GetKarma(uint32 acct_id) void ZoneDatabase::UpdateKarma(uint32 acct_id, uint32 amount) { std::string query = StringFormat("UPDATE account SET karma = %i WHERE id = %i", amount, acct_id); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } void ZoneDatabase::ListAllInstances(Client* client, uint32 charid) From 1530bd7937c01f52a54c218fbc4a0c2139828765 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:49:20 -0600 Subject: [PATCH 614/707] Fix InsertDoor from error message removal --- zone/zonedb.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index 812d647a6..ed315da07 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2774,8 +2774,7 @@ void ZoneDatabase::InsertDoor(uint32 ddoordbid, uint16 ddoorid, const char* ddoo ddoordbid, ddoorid, zone->GetShortName(), zone->GetInstanceVersion(), ddoor_name, dxpos, dypos, dzpos, dheading, dopentype, dguildid, dlockpick, dkeyitem, ddoor_param, dinvert, dincline, dsize); - auto results = QueryDatabase(query); - if (!results.Success()) + QueryDatabase(query); } void ZoneDatabase::LoadAltCurrencyValues(uint32 char_id, std::map ¤cy) { From b77a586d1416449cf3a998c1f1c3c6a3df37fc5c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:49:38 -0600 Subject: [PATCH 615/707] Fix RemoveTempFactions from error message removal --- zone/zonedb.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/zone/zonedb.cpp b/zone/zonedb.cpp index ed315da07..7e04f58ba 100644 --- a/zone/zonedb.cpp +++ b/zone/zonedb.cpp @@ -2993,9 +2993,7 @@ void ZoneDatabase::RemoveTempFactions(Client *client) { std::string query = StringFormat("DELETE FROM faction_values " "WHERE temp = 1 AND char_id = %u", client->CharacterID()); - auto results = QueryDatabase(query); - if (!results.Success()) - + QueryDatabase(query); } void ZoneDatabase::LoadPetInfo(Client *client) { From 0092d0c8947b9acb361d304d7c90a38df1a3e2e4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 01:50:35 -0600 Subject: [PATCH 616/707] Fix ClearMerchantTemp from error message removal --- common/database.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index f3dacc9f1..09d829922 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2882,11 +2882,8 @@ void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) { } void Database::ClearMerchantTemp(){ - std::string query("delete from merchantlist_temp"); - auto results = QueryDatabase(query); - - if (!results.Success()) + QueryDatabase(query); } bool Database::UpdateName(const char* oldname, const char* newname) { From c9fd7e45e8d473216a65154a08ebaac5f6085f18 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:03:45 -0600 Subject: [PATCH 617/707] Remove excess MySQL error message in GetSafePoints --- common/database.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 09d829922..8642c362f 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2568,13 +2568,7 @@ bool Database::GetSafePoints(const char* short_name, uint32 version, float* safe auto results = QueryDatabase(query); if (!results.Success()) - { - std::cerr << "If it errors, run the following querys:\n"; - std::cerr << "ALTER TABLE `zone` CHANGE `minium_level` `min_level` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT NULL;\n"; - std::cerr << "ALTER TABLE `zone` CHANGE `minium_status` `min_status` TINYINT(3) UNSIGNED DEFAULT \"0\" NOT NULL;\n"; - std::cerr << "ALTER TABLE `zone` ADD flag_needed VARCHAR(128) NOT NULL DEFAULT '';\n"; return false; - } if (results.RowCount() == 0) return false; From 2b091206bdfe8d5a70d9f3157b3afe001a8790fd Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:07:39 -0600 Subject: [PATCH 618/707] Remove Duplicative MySQL Error: Unable to clear groups: --- common/database.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 8642c362f..acb1eafcb 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3185,10 +3185,7 @@ void Database::ClearGroup(uint32 gid) { //clear a specific group std::string query = StringFormat("delete from group_id where groupid = %lu", (unsigned long)gid); - auto results = QueryDatabase(query); - - if (!results.Success()) - std::cout << "Unable to clear groups: " << results.ErrorMessage() << std::endl; + QueryDatabase(query); } uint32 Database::GetGroupID(const char* name){ From b14c3c8674b9584f7326dcdf1c668ad082a6c442 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:08:25 -0600 Subject: [PATCH 619/707] Remove Duplicative MySQL Error: Log.Out(Logs::General, Logs::Error, Error --- common/database.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index acb1eafcb..9a0065b94 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3188,14 +3188,11 @@ void Database::ClearGroup(uint32 gid) { QueryDatabase(query); } -uint32 Database::GetGroupID(const char* name){ - +uint32 Database::GetGroupID(const char* name){ std::string query = StringFormat("SELECT groupid from group_id where name='%s'", name); auto results = QueryDatabase(query); - if (!results.Success()) - { - Log.Out(Logs::General, Logs::Error, "Error getting group id: %s", results.ErrorMessage().c_str()); + if (!results.Success()) { return 0; } From 5a8e45faab73e6caf65ba582f50e94891fb53ae4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:09:23 -0600 Subject: [PATCH 620/707] Remove Duplicative MySQL Error: Unable to clear groups: --- common/database.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 9a0065b94..eb7c408a5 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3164,8 +3164,8 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism void Database::ClearAllGroups(void) { - std::string query("delete from group_id"); - auto results = QueryDatabase(query); + std::string query("DELETE FROM `group_id`"); + QueryDatabase(query); if (!results.Success()) std::cout << "Unable to clear groups: " << results.ErrorMessage() << std::endl; From f4c8eb6d885b54c822ee7ed9f0447d37c416c72b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:09:36 -0600 Subject: [PATCH 621/707] Remove Duplicative MySQL Error: Unable to clear groups: --- common/database.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index eb7c408a5..0aeeca9db 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3166,10 +3166,6 @@ void Database::ClearAllGroups(void) { std::string query("DELETE FROM `group_id`"); QueryDatabase(query); - - if (!results.Success()) - std::cout << "Unable to clear groups: " << results.ErrorMessage() << std::endl; - return; } From 40d23ab35a0c1ba96f27feecd8ed51347fabfd82 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:10:16 -0600 Subject: [PATCH 622/707] Remove Duplicative MySQL Error: Error adding character to group id: %s --- common/database.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 0aeeca9db..663bcb0fe 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3156,10 +3156,7 @@ void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ism /* Add to the Group */ query = StringFormat("REPLACE INTO `group_id` SET `charid` = %i, `groupid` = %i, `name` = '%s', `ismerc` = '%i'", charid, id, name, ismerc); - auto results = QueryDatabase(query); - - if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error adding character to group id: %s", results.ErrorMessage().c_str()); + QueryDatabase(query); } void Database::ClearAllGroups(void) From e626bb527f61c13fb43f59dcd2aa1630a2fcc715 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:10:54 -0600 Subject: [PATCH 623/707] Remove Duplicative MySQL Error: Error adding a report for %s: %s --- common/database.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 663bcb0fe..e95aa4984 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3134,11 +3134,8 @@ void Database::AddReport(std::string who, std::string against, std::string lines DoEscapeString(escape_str, lines.c_str(), lines.size()); std::string query = StringFormat("INSERT INTO reports (name, reported, reported_text) VALUES('%s', '%s', '%s')", who.c_str(), against.c_str(), escape_str); - auto results = QueryDatabase(query); + QueryDatabase(query); safe_delete_array(escape_str); - - if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error adding a report for %s: %s", who.c_str(), results.ErrorMessage().c_str()); } void Database::SetGroupID(const char* name, uint32 id, uint32 charid, uint32 ismerc) { From d3fdacf54810f599bcb497fa7ae11b3b360fa222 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:11:31 -0600 Subject: [PATCH 624/707] Remove Duplicative MySQL Error: Error updating firstlogon for character %i : %s --- common/database.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index e95aa4984..3ea215e00 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3124,9 +3124,7 @@ void Database::SetLFG(uint32 CharID, bool LFG) { void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { std::string query = StringFormat( "UPDATE `character_data` SET `firstlogon` = %i WHERE `id` = %i",firstlogon, CharID); - auto results = QueryDatabase(query); - if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error updating firstlogon for character %i : %s", CharID, results.ErrorMessage().c_str()); + QueryDatabase(query); } void Database::AddReport(std::string who, std::string against, std::string lines) { From 8ede80b69d8b7551503a2d040f0961708c49a3c3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:12:01 -0600 Subject: [PATCH 625/707] Remove Duplicative MySQL Error: Error updating LFP for character %i : %s --- common/database.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 3ea215e00..0e8d91610 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3117,9 +3117,7 @@ void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon void Database::SetLFG(uint32 CharID, bool LFG) { std::string query = StringFormat("update `character_data` SET `lfg` = %i WHERE `id` = %i",LFG, CharID); - auto results = QueryDatabase(query); - if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + QueryDatabase(query); } void Database::SetFirstLogon(uint32 CharID, uint8 firstlogon) { From c5dbbd1f07c5bddaa94f4fa10b076bfb95c910f9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:12:59 -0600 Subject: [PATCH 626/707] Remove Duplicative MySQL Error: Error updating LFP for character %i : %s --- common/database.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 0e8d91610..b954421b9 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3110,9 +3110,7 @@ void Database::SetLFP(uint32 CharID, bool LFP) { void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { std::string query = StringFormat("update `character_data` SET `lfp` = %i, `lfg` = %i, `firstlogon` = %i WHERE `id` = %i",LFP, LFG, firstlogon, CharID); - auto results = QueryDatabase(query); - if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + QueryDatabase(query); } void Database::SetLFG(uint32 CharID, bool LFG) { From 5ec3d58e32f23782253e560e8e9a74f304a95b5a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:13:25 -0600 Subject: [PATCH 627/707] Remove Duplicative MySQL Error: Error updating LFP for character %i : %s --- common/database.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index b954421b9..0432e4e2b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3103,9 +3103,7 @@ bool Database::GetLiveChar(uint32 account_id, char* cname) { void Database::SetLFP(uint32 CharID, bool LFP) { std::string query = StringFormat("UPDATE `character_data` SET `lfp` = %i WHERE `id` = %i",LFP, CharID); - auto results = QueryDatabase(query); - if (!results.Success()) - Log.Out(Logs::General, Logs::Error, "Error updating LFP for character %i : %s", CharID, results.ErrorMessage().c_str()); + QueryDatabase(query); } void Database::SetLoginFlags(uint32 CharID, bool LFP, bool LFG, uint8 firstlogon) { From 3fbac46ee65aeb4b4593463a03cc96b4471654b4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:14:36 -0600 Subject: [PATCH 628/707] Remove Duplicative MySQL Error: --- common/database.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 0432e4e2b..dd1d3850c 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -3074,8 +3074,7 @@ bool Database::UpdateLiveChar(char* charname,uint32 lsaccount_id) { std::string query = StringFormat("UPDATE account SET charname='%s' WHERE id=%i;",charname, lsaccount_id); auto results = QueryDatabase(query); - if (!results.Success()) - { + if (!results.Success()){ return false; } From 29774d97650273ad00fc2aae1df56b06c4511e50 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:16:53 -0600 Subject: [PATCH 629/707] Database:;ClearMerchantTemp cleanup --- common/database.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index dd1d3850c..b35cbea10 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2876,8 +2876,7 @@ void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) { } void Database::ClearMerchantTemp(){ - std::string query("delete from merchantlist_temp"); - QueryDatabase(query); + QueryDatabase("DELETE FROM merchantlist_temp"); } bool Database::UpdateName(const char* oldname, const char* newname) { From ec2a8c4a1b773e21b30f498f33d5db99e9134de8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:33:15 -0600 Subject: [PATCH 630/707] Convert CreateAccount to Log.Out --- common/database.cpp | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index b35cbea10..40c90a89b 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -1,5 +1,5 @@ /* EQEMu: Everquest Server Emulator - Copyright (C) 2001-2003 EQEMu Development Team (http://eqemulator.net) + Copyright (C) 2001-2015 EQEMu Development Team (http://eqemulator.net) 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 @@ -58,15 +58,7 @@ extern Client client; # define _ISNAN_(a) std::isnan(a) #endif -/* -Establish a connection to a mysql database with the supplied parameters - - Added a very simple .ini file parser - Bounce - - Modify to use for win32 & linux - misanthropicfiend -*/ -Database::Database () -{ +Database::Database () { DBInitVars(); } @@ -84,12 +76,11 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open(host, user, passwd, database, port, &errnum, errbuf)) { - Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf); - + Log.Out(Logs::General, Logs::Error, "Failed to connect to database: Error: %s", errbuf); return false; } else { - Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d",database,host,port); + Log.Out(Logs::General, Logs::Status, "Using database '%s' at %s:%d", database, host,port); return true; } } @@ -241,7 +232,7 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta else query = StringFormat("INSERT INTO account SET name='%s', status=%i, lsaccount_id=%i, time_creation=UNIX_TIMESTAMP();",name, status, lsaccount_id); - std::cerr << "Account Attempting to be created:" << name << " " << (int16) status << std::endl; + Log.Out(Logs::General, Logs::World_Server, "Account Attempting to be created: '%s' status: %i", name, status); auto results = QueryDatabase(query); if (!results.Success()) { @@ -2723,8 +2714,7 @@ uint8 Database::GetPEQZone(uint32 zoneID, uint32 version){ std::string query = StringFormat("SELECT peqzone from zone where zoneidnumber='%i' AND (version=%i OR version=0) ORDER BY version DESC", zoneID, version); auto results = QueryDatabase(query); - if (!results.Success()) - { + if (!results.Success()) { return 0; } @@ -2834,8 +2824,7 @@ uint32 Database::GetAccountIDFromLSID(uint32 iLSID, char* oAccountName, int16* o std::string query = StringFormat("SELECT id, name, status FROM account WHERE lsaccount_id=%i", iLSID); auto results = QueryDatabase(query); - if (!results.Success()) - { + if (!results.Success()) { return 0; } @@ -2859,8 +2848,7 @@ void Database::GetAccountFromID(uint32 id, char* oAccountName, int16* oStatus) { std::string query = StringFormat("SELECT name, status FROM account WHERE id=%i", id); auto results = QueryDatabase(query); - if (!results.Success()) - { + if (!results.Success()){ return; } From fc0e760b02da094682499dc68d104ac957048659 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:33:55 -0600 Subject: [PATCH 631/707] Convert DeleteAccount to Log.Out --- common/database.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 40c90a89b..243a99911 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -249,12 +249,10 @@ uint32 Database::CreateAccount(const char* name, const char* password, int16 sta bool Database::DeleteAccount(const char* name) { std::string query = StringFormat("DELETE FROM account WHERE name='%s';",name); - std::cout << "Account Attempting to be deleted:" << name << std::endl; + Log.Out(Logs::General, Logs::World_Server, "Account Attempting to be deleted:'%s'", name); - auto results = QueryDatabase(query); - - if (!results.Success()) - { + auto results = QueryDatabase(query); + if (!results.Success()) { return false; } From 0bb013bafbdcf351195194253bf0e4c34d79fd0f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:36:47 -0600 Subject: [PATCH 632/707] Convert DeleteCharacter to Log.Out --- common/database.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 243a99911..712957f33 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -304,11 +304,11 @@ bool Database::ReserveName(uint32 account_id, char* name) { */ bool Database::DeleteCharacter(char *name) { uint32 charid = 0; - printf("Database::DeleteCharacter name : %s \n", name); if(!name || !strlen(name)) { - std::cerr << "DeleteCharacter: request to delete without a name (empty char slot)" << std::endl; + Log.Out(Logs::General, Logs::World_Server, "DeleteCharacter: request to delete without a name (empty char slot)"); return false; } + Log.Out(Logs::General, Logs::World_Server, "Database::DeleteCharacter name : '%s'", name); /* Get id from character_data before deleting record so we can clean up the rest of the tables */ std::string query = StringFormat("SELECT `id` from `character_data` WHERE `name` = '%s'", name); From 32437a21ebda1dca18e4f98ed46a1138a19838b0 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:45:38 -0600 Subject: [PATCH 633/707] Add ANSI color defines for Linux --- common/eqemu_logsys.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 739507350..5b7fc2a1b 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -18,13 +18,11 @@ #include "eqemu_logsys.h" -// #include "base_packet.h" #include "platform.h" #include "string_util.h" #include "database.h" #include "misc.h" - #include #include #include @@ -34,13 +32,22 @@ std::ofstream process_log; #ifdef _WINDOWS -#include -#include -#include -#include -#include + #include + #include + #include + #include + #include #else -#include + #include + #define RESET "\033[0m" + #define BLACK "\033[30m" /* Black */ + #define RED "\033[31m" /* Red */ + #define GREEN "\033[32m" /* Green */ + #define YELLOW "\033[33m" /* Yellow */ + #define BLUE "\033[34m" /* Blue */ + #define MAGENTA "\033[35m" /* Magenta */ + #define CYAN "\033[36m" /* Cyan */ + #define WHITE "\033[37m" /* White */ #endif namespace Console { From 39626159a5bc674d6c8ca3e3040fc281f61d60d3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:53:10 -0600 Subject: [PATCH 634/707] Implement Linux ANSI colors --- common/eqemu_logsys.cpp | 55 ++++++++++++++++++++++++++++------------- common/eqemu_logsys.h | 3 ++- 2 files changed, 40 insertions(+), 18 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 5b7fc2a1b..ed55c8a3e 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -39,17 +39,19 @@ std::ofstream process_log; #include #else #include - #define RESET "\033[0m" - #define BLACK "\033[30m" /* Black */ - #define RED "\033[31m" /* Red */ - #define GREEN "\033[32m" /* Green */ - #define YELLOW "\033[33m" /* Yellow */ - #define BLUE "\033[34m" /* Blue */ - #define MAGENTA "\033[35m" /* Magenta */ - #define CYAN "\033[36m" /* Cyan */ - #define WHITE "\033[37m" /* White */ #endif +/* Linux ANSI console color defines */ +#define LC_RESET "\033[0m" +#define LC_BLACK "\033[30m" /* Black */ +#define LC_RED "\033[31m" /* Red */ +#define LC_GREEN "\033[32m" /* Green */ +#define LC_YELLOW "\033[33m" /* Yellow */ +#define LC_BLUE "\033[34m" /* Blue */ +#define LC_MAGENTA "\033[35m" /* Magenta */ +#define LC_CYAN "\033[36m" /* Cyan */ +#define LC_WHITE "\033[37m" /* White */ + namespace Console { enum Color { Black = 0, @@ -127,7 +129,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) } } -uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ +uint16 EQEmuLogSys::GetWindowsConsoleColorFromCategory(uint16 log_category){ switch (log_category) { case Logs::Status: case Logs::Normal: @@ -149,6 +151,28 @@ uint16 EQEmuLogSys::GetConsoleColorFromCategory(uint16 log_category){ } } +std::string EQEmuLogSys::GetLinuxConsoleColorFromCategory(uint16 log_category){ + switch (log_category) { + case Logs::Status: + case Logs::Normal: + return LC_YELLOW; + case Logs::MySQLError: + case Logs::Error: + return LC_RED; + case Logs::MySQLQuery: + case Logs::Debug: + return LC_GREEN; + case Logs::Quests: + return LC_CYAN; + case Logs::Commands: + return LC_MAGENTA; + case Logs::Crash: + return LC_RED; + default: + return LC_YELLOW; + } +} + uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category){ switch (log_category) { case Logs::Status: @@ -186,14 +210,11 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string m info.FontWeight = FW_NORMAL; wcscpy(info.FaceName, L"Lucida Console"); SetCurrentConsoleFontEx(console_handle, NULL, &info); - SetConsoleTextAttribute(console_handle, EQEmuLogSys::GetConsoleColorFromCategory(log_category)); - #endif - - std::cout << message << "\n"; - - #ifdef _WINDOWS - /* Always set back to white*/ + SetConsoleTextAttribute(console_handle, EQEmuLogSys::GetWindowsConsoleColorFromCategory(log_category)); + std::cout << message << "\n"; SetConsoleTextAttribute(console_handle, Console::Color::White); + #else + std::cout << EQEmuLogSys::GetLinuxConsoleColorFromCategory(log_category) << message << LC_RESET << std::endl; #endif } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 7b83ab996..17ebdeaea 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -153,7 +153,8 @@ private: std::function on_log_gmsay_hook; std::string FormatOutMessageString(uint16 log_category, std::string in_message); - uint16 GetConsoleColorFromCategory(uint16 log_category); + uint16 GetWindowsConsoleColorFromCategory(uint16 log_category); + std::string GetLinuxConsoleColorFromCategory(uint16 log_category); void ProcessConsoleMessage(uint16 log_category, const std::string message); void ProcessGMSay(uint16 log_category, std::string message); From ff5e82c50f534f0dde4bb6145c8c580b1e7b2228 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:57:31 -0600 Subject: [PATCH 635/707] Fix some indents --- common/eqemu_logsys.cpp | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index ed55c8a3e..b412e02fe 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -110,6 +110,7 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_category, std::string message) if (log_category == Logs::LogCategory::Netcode) return; + /* Check to see if the process that actually ran this is zone */ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ on_log_gmsay_hook(log_category, message); } @@ -153,23 +154,23 @@ uint16 EQEmuLogSys::GetWindowsConsoleColorFromCategory(uint16 log_category){ std::string EQEmuLogSys::GetLinuxConsoleColorFromCategory(uint16 log_category){ switch (log_category) { - case Logs::Status: - case Logs::Normal: - return LC_YELLOW; - case Logs::MySQLError: - case Logs::Error: - return LC_RED; - case Logs::MySQLQuery: - case Logs::Debug: - return LC_GREEN; - case Logs::Quests: - return LC_CYAN; - case Logs::Commands: - return LC_MAGENTA; - case Logs::Crash: - return LC_RED; - default: - return LC_YELLOW; + case Logs::Status: + case Logs::Normal: + return LC_YELLOW; + case Logs::MySQLError: + case Logs::Error: + return LC_RED; + case Logs::MySQLQuery: + case Logs::Debug: + return LC_GREEN; + case Logs::Quests: + return LC_CYAN; + case Logs::Commands: + return LC_MAGENTA; + case Logs::Crash: + return LC_RED; + default: + return LC_YELLOW; } } From e48234b2af3c4d13c6061c6ad63d817d4b1d3cb8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:58:33 -0600 Subject: [PATCH 636/707] Add uint16 debug_level to ProcessConsoleMessage --- common/eqemu_logsys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index b412e02fe..0ddaa9061 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -196,7 +196,7 @@ uint16 EQEmuLogSys::GetGMSayColorFromCategory(uint16 log_category){ } } -void EQEmuLogSys::ProcessConsoleMessage(uint16 log_category, const std::string message) +void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string message) { /* Check if category enabled for process */ if (log_settings[log_category].log_to_console == 0) @@ -228,7 +228,7 @@ void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::st std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, output_message); - EQEmuLogSys::ProcessConsoleMessage(log_category, output_debug_message); + EQEmuLogSys::ProcessConsoleMessage(0, log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); EQEmuLogSys::ProcessLogWrite(log_category, output_debug_message); } From 9faa2117d5854e6b97ac3066de1b18360539ce67 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:59:06 -0600 Subject: [PATCH 637/707] Add uint16 debug_level to ProcessLogWrite --- common/eqemu_logsys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 0ddaa9061..4ac5a359d 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -116,7 +116,7 @@ void EQEmuLogSys::ProcessGMSay(uint16 log_category, std::string message) } } -void EQEmuLogSys::ProcessLogWrite(uint16 log_category, std::string message) +void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, std::string message) { /* Check if category enabled for process */ if (log_settings[log_category].log_to_file == 0) @@ -230,7 +230,7 @@ void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::st EQEmuLogSys::ProcessConsoleMessage(0, log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); - EQEmuLogSys::ProcessLogWrite(log_category, output_debug_message); + EQEmuLogSys::ProcessLogWrite(0, log_category, output_debug_message); } void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ From cc1735bc3962c48fdce1a66eeea59e10ade24e31 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 02:59:32 -0600 Subject: [PATCH 638/707] Add uint16 debug_level to ProcessGMSay --- common/eqemu_logsys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 4ac5a359d..1d985bbb9 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -100,7 +100,7 @@ std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string return StringFormat("%s%s", category_string.c_str(), in_message.c_str()); } -void EQEmuLogSys::ProcessGMSay(uint16 log_category, std::string message) +void EQEmuLogSys::ProcessGMSay(uint16 debug_level, uint16 log_category, std::string message) { /* Check if category enabled for process */ if (log_settings[log_category].log_to_gmsay == 0) @@ -229,7 +229,7 @@ void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::st std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, output_message); EQEmuLogSys::ProcessConsoleMessage(0, log_category, output_debug_message); - EQEmuLogSys::ProcessGMSay(log_category, output_debug_message); + EQEmuLogSys::ProcessGMSay(0, log_category, output_debug_message); EQEmuLogSys::ProcessLogWrite(0, log_category, output_debug_message); } From f5b1f678a19b1089dd2e3d9445d662c7f536b558 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:00:00 -0600 Subject: [PATCH 639/707] Pass debug_level to subprocess commands --- common/eqemu_logsys.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 1d985bbb9..d7c3fbf47 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -228,9 +228,9 @@ void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::st std::string output_debug_message = EQEmuLogSys::FormatOutMessageString(log_category, output_message); - EQEmuLogSys::ProcessConsoleMessage(0, log_category, output_debug_message); - EQEmuLogSys::ProcessGMSay(0, log_category, output_debug_message); - EQEmuLogSys::ProcessLogWrite(0, log_category, output_debug_message); + EQEmuLogSys::ProcessConsoleMessage(debug_level, log_category, output_debug_message); + EQEmuLogSys::ProcessGMSay(debug_level, log_category, output_debug_message); + EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_debug_message); } void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ From f09e1d037fb4945be6df5f8f6852c80fa619fe2c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:01:41 -0600 Subject: [PATCH 640/707] Implement debug_level checking for ProcessConsoleMessage --- common/eqemu_logsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index d7c3fbf47..0ee066466 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -202,6 +202,10 @@ void EQEmuLogSys::ProcessConsoleMessage(uint16 debug_level, uint16 log_category, if (log_settings[log_category].log_to_console == 0) return; + /* Make sure the message inbound is at a debug level we're set at */ + if (log_settings[log_category].log_to_console < debug_level) + return; + #ifdef _WINDOWS HANDLE console_handle; console_handle = GetStdHandle(STD_OUTPUT_HANDLE); From aeff65064980b5269bf97a9accc66801819bc5f5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:02:15 -0600 Subject: [PATCH 641/707] Implement debug_level checking for ProcessLogWrite --- common/eqemu_logsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 0ee066466..035f0c09d 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -122,6 +122,10 @@ void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, std:: if (log_settings[log_category].log_to_file == 0) return; + /* Make sure the message inbound is at a debug level we're set at */ + if (log_settings[log_category].log_to_file < debug_level) + return; + char time_stamp[80]; EQEmuLogSys::SetCurrentTimeStamp(time_stamp); From b2ffcf1cf6ab1dbe8abbf09aa705b47718ca0309 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:02:41 -0600 Subject: [PATCH 642/707] Implement debug_level checking for ProcessGMSay --- common/eqemu_logsys.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 035f0c09d..470ccf9c7 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -110,6 +110,10 @@ void EQEmuLogSys::ProcessGMSay(uint16 debug_level, uint16 log_category, std::str if (log_category == Logs::LogCategory::Netcode) return; + /* Make sure the message inbound is at a debug level we're set at */ + if (log_settings[log_category].log_to_gmsay < debug_level) + return; + /* Check to see if the process that actually ran this is zone */ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ on_log_gmsay_hook(log_category, message); From e79c1c1a5abc05879d97a5bebb927c48849c2997 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:07:33 -0600 Subject: [PATCH 643/707] Fix Linux compiles --- common/eqemu_logsys.h | 6 +++--- common/tcp_connection.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 17ebdeaea..c388b4a37 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -156,9 +156,9 @@ private: uint16 GetWindowsConsoleColorFromCategory(uint16 log_category); std::string GetLinuxConsoleColorFromCategory(uint16 log_category); - void ProcessConsoleMessage(uint16 log_category, const std::string message); - void ProcessGMSay(uint16 log_category, std::string message); - void ProcessLogWrite(uint16 log_category, std::string message); + void ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string message); + void ProcessGMSay(uint16 debug_level, uint16 log_category, std::string message); + void ProcessLogWrite(uint16 debug_level, uint16 log_category, std::string message); }; extern EQEmuLogSys Log; diff --git a/common/tcp_connection.cpp b/common/tcp_connection.cpp index 6a8493f2e..7a393c8f5 100644 --- a/common/tcp_connection.cpp +++ b/common/tcp_connection.cpp @@ -899,7 +899,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { } TCPConnection* tcpc = (TCPConnection*) tmp; #ifndef WIN32 - Log.Out(Logs::Detail, Logs::TCP_Connection, __FUNCTION__ " Starting TCPConnectionLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::TCP_Connection, "%s Starting TCPConnectionLoop with thread ID %d", __FUNCTION__, pthread_self()); #endif tcpc->MLoopRunning.lock(); while (tcpc->RunLoop()) { @@ -926,7 +926,7 @@ ThreadReturnType TCPConnection::TCPConnectionLoop(void* tmp) { tcpc->MLoopRunning.unlock(); #ifndef WIN32 - Log.Out(Logs::Detail, Logs::TCP_Connection, __FUNCTION__ "Ending TCPConnectionLoop with thread ID %d", pthread_self()); + Log.Out(Logs::Detail, Logs::TCP_Connection, "%s Ending TCPConnectionLoop with thread ID %d", __FUNCTION__, pthread_self()); #endif THREAD_RETURN(nullptr); From 42dffec4ae2b489e54e64d3507065ff6b2571bed Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:20:40 -0600 Subject: [PATCH 644/707] Various logging adjustments --- common/eqemu_logsys.cpp | 2 +- common/eqemu_logsys.h | 4 +++- zone/embxs.cpp | 4 ++-- zone/tasks.cpp | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 470ccf9c7..a37fc0850 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -134,7 +134,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, std:: EQEmuLogSys::SetCurrentTimeStamp(time_stamp); if (process_log){ - process_log << time_stamp << " " << StringFormat("[%s] ", Logs::LogCategoryName[log_category]).c_str() << message << std::endl; + process_log << time_stamp << " " << message << std::endl; } } diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index c388b4a37..d3a81e5c8 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -140,7 +140,9 @@ public: }; LogSettings log_settings[Logs::LogCategory::MaxCategoryID]; + bool log_settings_loaded = false; + int log_platform = 0; uint16 GetGMSayColorFromCategory(uint16 log_category); @@ -152,9 +154,9 @@ private: std::function on_log_gmsay_hook; std::string FormatOutMessageString(uint16 log_category, std::string in_message); + std::string GetLinuxConsoleColorFromCategory(uint16 log_category); uint16 GetWindowsConsoleColorFromCategory(uint16 log_category); - std::string GetLinuxConsoleColorFromCategory(uint16 log_category); void ProcessConsoleMessage(uint16 debug_level, uint16 log_category, const std::string message); void ProcessGMSay(uint16 debug_level, uint16 log_category, std::string message); diff --git a/zone/embxs.cpp b/zone/embxs.cpp index 4c0e8211c..664416587 100644 --- a/zone/embxs.cpp +++ b/zone/embxs.cpp @@ -100,7 +100,7 @@ XS(XS_EQEmuIO_PRINT) int len = 0; for(i = 0; *cur != '\0'; i++, cur++) { if(*cur == '\n') { - Log.Out(Logs::Detail, Logs::Quests, str); + Log.Out(Logs::General, Logs::Quests, str); len = 0; pos = i+1; } else { @@ -108,7 +108,7 @@ XS(XS_EQEmuIO_PRINT) } } if(len > 0) { - Log.Out(Logs::Detail, Logs::Quests, str); + Log.Out(Logs::General, Logs::Quests, str); } } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 203950104..500e57ae6 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -3028,11 +3028,11 @@ void ClientTaskState::ProcessTaskProximities(Client *c, float X, float Y, float if((LastX==X) && (LastY==Y) && (LastZ==Z)) return; - Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Checking proximities for Position %8.3f, %8.3f, %8.3f\n", X, Y, Z); + Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Checking proximities for Position %8.3f, %8.3f, %8.3f", X, Y, Z); int ExploreID = taskmanager->ProximityManager.CheckProximities(X, Y, Z); if(ExploreID>0) { - Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i\n", X, Y, Z, ExploreID); + Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } } From 8b096e65afc3f029b623154c217f4c0c3592d833 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 03:46:27 -0600 Subject: [PATCH 645/707] logtest adjustments --- zone/command.cpp | 15 +++++++++++++-- zone/tasks.cpp | 2 +- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 59c738e49..3902242c6 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10392,9 +10392,20 @@ void command_logtest(Client *c, const Seperator *sep){ clock_t t = std::clock(); /* Function timer start */ if (sep->IsNumber(1)){ uint32 i = 0; - for (i = 0; i < atoi(sep->arg[1]); i++){ - Log.Out(Logs::General, Logs::None, "[%u] Test... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + std::ofstream log_test; + for (i = 0; i < atoi(sep->arg[1]); i++){ + log_test.open("logs/log_test.txt", std::ios_base::app | std::ios_base::out); + log_test << "this is a test\n"; + log_test.close(); } + Log.Out(Logs::General, Logs::Zone_Server, "[%u] Test #1... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); + t = std::clock(); + log_test.open("logs/log_test.txt", std::ios_base::app | std::ios_base::out); + for (i = 0; i < atoi(sep->arg[1]); i++){ + log_test << "this is a test\n"; + } + log_test.close(); + Log.Out(Logs::General, Logs::Zone_Server, "[%u] Test #2... Took %f seconds", i, ((float)(std::clock() - t)) / CLOCKS_PER_SEC); } } diff --git a/zone/tasks.cpp b/zone/tasks.cpp index 500e57ae6..cb8e34696 100644 --- a/zone/tasks.cpp +++ b/zone/tasks.cpp @@ -3031,7 +3031,7 @@ void ClientTaskState::ProcessTaskProximities(Client *c, float X, float Y, float Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Checking proximities for Position %8.3f, %8.3f, %8.3f", X, Y, Z); int ExploreID = taskmanager->ProximityManager.CheckProximities(X, Y, Z); - if(ExploreID>0) { + if(ExploreID > 0) { Log.Out(Logs::General, Logs::Tasks, "[PROXIMITY] Position %8.3f, %8.3f, %8.3f is within proximity %i", X, Y, Z, ExploreID); UpdateTasksOnExplore(c, ExploreID); } From cdde408602552e0f6ed1f3bc9b5f505ce70ff092 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 04:10:39 -0600 Subject: [PATCH 646/707] Some adjustments to file writing routines --- common/database.cpp | 11 +++++++++++ common/eqemu_logsys.h | 1 + 2 files changed, 12 insertions(+) diff --git a/common/database.cpp b/common/database.cpp index 712957f33..c0679cc48 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4171,11 +4171,22 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ "logsys_categories " "ORDER BY log_category_id"; auto results = QueryDatabase(query); + int log_category = 0; + log_settings.file_logs_enabled = false; + for (auto row = results.begin(); row != results.end(); ++row) { log_category = atoi(row[0]); log_settings[log_category].log_to_console = atoi(row[2]); log_settings[log_category].log_to_file = atoi(row[3]); log_settings[log_category].log_to_gmsay = atoi(row[4]); + + /* + This determines whether or not the process needs to actually file log anything. + 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].log_to_file > 0){ + log_settings.file_logs_enabled = true; + } } } \ No newline at end of file diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index d3a81e5c8..66124df74 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -142,6 +142,7 @@ public: LogSettings log_settings[Logs::LogCategory::MaxCategoryID]; bool log_settings_loaded = false; + bool file_logs_enabled = false; int log_platform = 0; From 1bbbb2821880e1f082b6ac00aa6fb7a472179c25 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 04:30:27 -0600 Subject: [PATCH 647/707] Refactor some of the database stuff for QueryServ for uniformity, should probably be done right later --- common/database.cpp | 4 ++-- common/eqemu_logsys.cpp | 5 ++++- queryserv/database.cpp | 28 ++++++++++++++-------------- queryserv/database.h | 8 ++++---- queryserv/lfguild.cpp | 16 ++++++++-------- queryserv/queryserv.cpp | 8 ++++++-- queryserv/worldserver.cpp | 18 +++++++++--------- 7 files changed, 47 insertions(+), 40 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index c0679cc48..129fa2859 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4173,7 +4173,7 @@ void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ auto results = QueryDatabase(query); int log_category = 0; - log_settings.file_logs_enabled = false; + Log.file_logs_enabled = false; for (auto row = results.begin(); row != results.end(); ++row) { log_category = atoi(row[0]); @@ -4186,7 +4186,7 @@ void Database::LoadLogSysSettings(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 (log_settings[log_category].log_to_file > 0){ - log_settings.file_logs_enabled = true; + Log.file_logs_enabled = true; } } } \ No newline at end of file diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index a37fc0850..0aadf0cdf 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -265,8 +265,8 @@ void EQEmuLogSys::CloseFileLogs() { if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ std::cout << "Closing down zone logs..." << std::endl; - process_log.close(); } + process_log.close(); } void EQEmuLogSys::StartFileLogs(const std::string log_name) @@ -276,4 +276,7 @@ void EQEmuLogSys::StartFileLogs(const std::string log_name) EQEmuLogSys::MakeDirectory("logs/zone"); process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); } + else{ + + } } \ No newline at end of file diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 585417e37..4b517016d 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -48,7 +48,7 @@ #include "../common/string_util.h" #include "../common/servertalk.h" -Database::Database () +QSDatabase::QSDatabase () { DBInitVars(); } @@ -57,13 +57,13 @@ Database::Database () Establish a connection to a mysql database with the supplied parameters */ -Database::Database(const char* host, const char* user, const char* passwd, const char* database, uint32 port) +QSDatabase::QSDatabase(const char* host, const char* user, const char* passwd, const char* database, uint32 port) { DBInitVars(); Connect(host, user, passwd, database, port); } -bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) +bool QSDatabase::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) { uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; @@ -81,24 +81,24 @@ bool Database::Connect(const char* host, const char* user, const char* passwd, c } } -void Database::DBInitVars() { +void QSDatabase::DBInitVars() { } -void Database::HandleMysqlError(uint32 errnum) { +void QSDatabase::HandleMysqlError(uint32 errnum) { } /* Close the connection to the database */ -Database::~Database() +QSDatabase::~QSDatabase() { } -void Database::AddSpeech(const char* from, const char* to, const char* message, uint16 minstatus, uint32 guilddbid, uint8 type) { +void QSDatabase::AddSpeech(const char* from, const char* to, const char* message, uint16 minstatus, uint32 guilddbid, uint8 type) { char *escapedFrom = new char[strlen(from) * 2 + 1]; char *escapedTo = new char[strlen(to) * 2 + 1]; @@ -123,7 +123,7 @@ void Database::AddSpeech(const char* from, const char* to, const char* message, } -void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { +void QSDatabase::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { std::string query = StringFormat("INSERT INTO `qs_player_trade_record` SET `time` = NOW(), " "`char1_id` = '%i', `char1_pp` = '%i', `char1_gp` = '%i', " @@ -164,7 +164,7 @@ void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { } -void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) { +void QSDatabase::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) { std::string query = StringFormat("INSERT INTO `qs_player_handin_record` SET `time` = NOW(), " "`quest_id` = '%i', `char_id` = '%i', `char_pp` = '%i', " @@ -205,7 +205,7 @@ void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) } -void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ +void QSDatabase::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ std::string query = StringFormat("INSERT INTO `qs_player_npc_kill_record` " "SET `npc_id` = '%i', `type` = '%i', " @@ -236,7 +236,7 @@ void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ } -void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { +void QSDatabase::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { std::string query = StringFormat("INSERT INTO `qs_player_delete_record` SET `time` = NOW(), " "`char_id` = '%i', `stack_size` = '%i', `char_items` = '%i'", @@ -269,7 +269,7 @@ void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { } -void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { +void QSDatabase::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { /* These are item moves */ std::string query = StringFormat("INSERT INTO `qs_player_move_record` SET `time` = NOW(), " @@ -305,7 +305,7 @@ void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { } -void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 items) { +void QSDatabase::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 items) { /* Merchant transactions are from the perspective of the merchant, not the player -U */ std::string query = StringFormat("INSERT INTO `qs_merchant_transaction_record` SET `time` = NOW(), " "`zone_id` = '%i', `merchant_id` = '%i', `merchant_pp` = '%i', " @@ -346,7 +346,7 @@ void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint3 } -void Database::GeneralQueryReceive(ServerPacket *pack) { +void QSDatabase::GeneralQueryReceive(ServerPacket *pack) { /* These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again */ diff --git a/queryserv/database.h b/queryserv/database.h index adcb8c811..fe99a866d 100644 --- a/queryserv/database.h +++ b/queryserv/database.h @@ -35,12 +35,12 @@ //atoi is not uint32 or uint32 safe!!!! #define atoul(str) strtoul(str, nullptr, 10) -class Database : public DBcore { +class QSDatabase : public DBcore { public: - Database(); - Database(const char* host, const char* user, const char* passwd, const char* database,uint32 port); + QSDatabase(); + QSDatabase(const char* host, const char* user, const char* passwd, const char* database,uint32 port); bool Connect(const char* host, const char* user, const char* passwd, const char* database,uint32 port); - ~Database(); + ~QSDatabase(); void AddSpeech(const char* from, const char* to, const char* message, uint16 minstatus, uint32 guilddbid, uint8 type); void LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 DetailCount); diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 340321f06..2684f4541 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -8,7 +8,7 @@ #include "../common/rulesys.h" extern WorldServer *worldserver; -extern Database database; +extern QSDatabase qs_database; PlayerLookingForGuild::PlayerLookingForGuild(char *Name, char *Comments, uint32 Level, uint32 Class, uint32 AACount, uint32 Timezone, uint32 TimePosted) { @@ -38,7 +38,7 @@ bool LFGuildManager::LoadDatabase() std::string query = "SELECT `type`,`name`,`comment`, " "`fromlevel`, `tolevel`, `classes`, " "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); if (!results.Success()) { return false; } @@ -239,7 +239,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char } std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); uint32 Now = time(nullptr); @@ -252,7 +252,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char "`classes`, `aacount`, `timezone`, `timeposted`) " "VALUES (0, '%s', '%s', %u, 0, %u, %u, %u, %u)", From, Comments, Level, Class, AAPoints, TimeZone, Now); - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -281,7 +281,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char } std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); uint32 Now = time(nullptr); @@ -296,7 +296,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char "VALUES (1, '%s', '%s', %u, %u, %u, %u, %u, %u)", GuildName, Comments, FromLevel, ToLevel, Classes, AACount, TimeZone, Now); - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); } @@ -324,7 +324,7 @@ void LFGuildManager::ExpireEntries() continue; std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); if(!results.Success()) it = Players.erase(it); @@ -336,7 +336,7 @@ void LFGuildManager::ExpireEntries() continue; std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); - auto results = database.QueryDatabase(query); + auto results = qs_database.QueryDatabase(query); if(!results.Success()) it2 = Guilds.erase(it2); diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index e227f515f..fe333e4a4 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -17,6 +17,7 @@ */ +#include "../common/database.h" #include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/opcodemgr.h" @@ -36,6 +37,7 @@ volatile bool RunLoops = true; TimeoutManager timeout_manager; Database database; +QSDatabase qs_database; LFGuildManager lfguildmanager; std::string WorldShortName; const queryservconfig *Config; @@ -50,7 +52,6 @@ void CatchSignal(int sig_num) { int main() { RegisterExecutablePlatform(ExePlatformQueryServ); - Log.LoadLogSettingsDefaults(); set_exception_handler(); Timer LFGuildExpireTimer(60000); Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect @@ -77,7 +78,7 @@ int main() { Log.Out(Logs::Detail, Logs::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ - if (!database.Connect( + if (!qs_database.Connect( Config->QSDatabaseHost.c_str(), Config->QSDatabaseUsername.c_str(), Config->QSDatabasePassword.c_str(), @@ -87,6 +88,9 @@ int main() { return 1; } + Log.LoadLogSettingsDefaults(); + database.LoadLogSysSettings(Log.log_settings); + if (signal(SIGINT, CatchSignal) == SIG_ERR) { Log.Out(Logs::Detail, Logs::QS_Server, "Could not set signal handler"); return 1; diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index 2d2f288a4..e043facf9 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -38,7 +38,7 @@ extern WorldServer worldserver; extern const queryservconfig *Config; -extern Database database; +extern QSDatabase qs_database; extern LFGuildManager lfguildmanager; WorldServer::WorldServer() @@ -78,42 +78,42 @@ void WorldServer::Process() Server_Speech_Struct *SSS = (Server_Speech_Struct*)pack->pBuffer; std::string tmp1 = SSS->from; std::string tmp2 = SSS->to; - database.AddSpeech(tmp1.c_str(), tmp2.c_str(), SSS->message, SSS->minstatus, SSS->guilddbid, SSS->type); + qs_database.AddSpeech(tmp1.c_str(), tmp2.c_str(), SSS->message, SSS->minstatus, SSS->guilddbid, SSS->type); break; } case ServerOP_QSPlayerLogTrades: { QSPlayerLogTrade_Struct *QS = (QSPlayerLogTrade_Struct*)pack->pBuffer; - database.LogPlayerTrade(QS, QS->_detail_count); + qs_database.LogPlayerTrade(QS, QS->_detail_count); break; } case ServerOP_QSPlayerLogHandins: { QSPlayerLogHandin_Struct *QS = (QSPlayerLogHandin_Struct*)pack->pBuffer; - database.LogPlayerHandin(QS, QS->_detail_count); + qs_database.LogPlayerHandin(QS, QS->_detail_count); break; } case ServerOP_QSPlayerLogNPCKills: { QSPlayerLogNPCKill_Struct *QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer; uint32 Members = pack->size - sizeof(QSPlayerLogNPCKill_Struct); if (Members > 0) Members = Members / sizeof(QSPlayerLogNPCKillsPlayers_Struct); - database.LogPlayerNPCKill(QS, Members); + qs_database.LogPlayerNPCKill(QS, Members); break; } case ServerOP_QSPlayerLogDeletes: { QSPlayerLogDelete_Struct *QS = (QSPlayerLogDelete_Struct*)pack->pBuffer; uint32 Items = QS->char_count; - database.LogPlayerDelete(QS, Items); + qs_database.LogPlayerDelete(QS, Items); break; } case ServerOP_QSPlayerLogMoves: { QSPlayerLogMove_Struct *QS = (QSPlayerLogMove_Struct*)pack->pBuffer; uint32 Items = QS->char_count; - database.LogPlayerMove(QS, Items); + qs_database.LogPlayerMove(QS, Items); break; } case ServerOP_QSPlayerLogMerchantTransactions: { QSMerchantLogTransaction_Struct *QS = (QSMerchantLogTransaction_Struct*)pack->pBuffer; uint32 Items = QS->char_count + QS->merchant_count; - database.LogMerchantTransaction(QS, Items); + qs_database.LogMerchantTransaction(QS, Items); break; } case ServerOP_QueryServGeneric: { @@ -155,7 +155,7 @@ void WorldServer::Process() } case ServerOP_QSSendQuery: { /* Process all packets here */ - database.GeneralQueryReceive(pack); + qs_database.GeneralQueryReceive(pack); break; } } From d191086d3e15eafbb83e8564911723a7e5c10e65 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 04:45:14 -0600 Subject: [PATCH 648/707] Add LoadLogSysSettings to other processes --- queryserv/queryserv.cpp | 1 + shared_memory/main.cpp | 4 ++++ world/net.cpp | 3 ++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index fe333e4a4..48825a67a 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -88,6 +88,7 @@ int main() { return 1; } + /* Register Log System and Settings */ Log.LoadLogSettingsDefaults(); database.LoadLogSysSettings(Log.log_settings); diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 345616e8f..da385e6ba 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -57,6 +57,10 @@ int main(int argc, char **argv) { return 1; } + /* Register Log System and Settings */ + Log.LoadLogSettingsDefaults(); + database.LoadLogSysSettings(Log.log_settings); + bool load_all = true; bool load_items = false; bool load_factions = false; diff --git a/world/net.cpp b/world/net.cpp index d78aeecf7..c83b2db01 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -182,7 +182,8 @@ int main(int argc, char** argv) { } guild_mgr.SetDatabase(&database); - Log.LoadLogSettingsDefaults(); + /* Register Log System and Settings */ + Log.LoadLogSettingsDefaults(); database.LoadLogSysSettings(Log.log_settings); if (argc >= 2) { From d5018029a4f834056f05aed75dfe409fa276e24f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 04:45:44 -0600 Subject: [PATCH 649/707] Add LoadLogSysSettings to client export utility --- client_files/export/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 14fe0fc60..42d72b38b 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -55,6 +55,10 @@ int main(int argc, char **argv) { return 1; } + /* Register Log System and Settings */ + Log.LoadLogSettingsDefaults(); + database.LoadLogSysSettings(Log.log_settings); + ExportSpells(&database); ExportSkillCaps(&database); ExportBaseData(&database); From 0110755c474deeae8431496bd2254d3da3feac8e Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 04:56:13 -0600 Subject: [PATCH 650/707] Adjust defaults for LoadLogSettingsDefault --- common/eqemu_logsys.cpp | 6 ++++++ ucs/ucs.cpp | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 0aadf0cdf..ace8692f5 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -89,6 +89,12 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[i].log_to_file = 0; log_settings[i].log_to_gmsay = 0; } + + log_settings[Logs::World_Server].log_to_console = 1; + log_settings[Logs::Zone_Server].log_to_console = 1; + log_settings[Logs::QS_Server].log_to_console = 1; + log_settings[Logs::UCS_Server].log_to_console = 1; + log_settings_loaded = true; } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index fd9688def..86462aefe 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -78,20 +78,20 @@ int main() { Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect - Log.Out(Logs::Detail, Logs::UCS_Server, "Starting EQEmu Universal Chat Server."); + Log.Out(Logs::General, Logs::UCS_Server, "Starting EQEmu Universal Chat Server."); if (!ucsconfig::LoadConfig()) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Loading server configuration failed."); + Log.Out(Logs::General, Logs::UCS_Server, "Loading server configuration failed."); return 1; } - Config = ucsconfig::get(); + Config = ucsconfig::get(); WorldShortName = Config->ShortName; - Log.Out(Logs::Detail, Logs::UCS_Server, "Connecting to MySQL..."); + Log.Out(Logs::General, Logs::UCS_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), @@ -99,22 +99,22 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Out(Logs::Detail, Logs::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::General, Logs::World_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(Logs::Detail, Logs::World_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::General, Logs::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(Logs::General, Logs::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.Out(Logs::Detail, Logs::UCS_Server, "No rule set configured, using default rules"); + Log.Out(Logs::General, Logs::UCS_Server, "No rule set configured, using default rules"); } else { - Log.Out(Logs::Detail, Logs::UCS_Server, "Loaded default rule set 'default'", tmp); + Log.Out(Logs::General, Logs::UCS_Server, "Loaded default rule set 'default'", tmp); } } @@ -122,7 +122,7 @@ int main() { if(Config->ChatPort != Config->MailPort) { - Log.Out(Logs::Detail, Logs::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); + Log.Out(Logs::General, Logs::UCS_Server, "MailPort and CharPort must be the same in eqemu_config.xml for UCS."); exit(1); } @@ -133,11 +133,11 @@ int main() { database.LoadChatChannels(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::UCS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::UCS_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::UCS_Server, "Could not set signal handler"); return 1; } From 9bfe45ddbdf8a53778a2a455b19a5aca0fd0a87f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:04:16 -0600 Subject: [PATCH 651/707] QueryServ adjustments --- queryserv/queryserv.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 48825a67a..b48e72c25 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -66,16 +66,16 @@ int main() { */ - Log.Out(Logs::Detail, Logs::QS_Server, "Starting EQEmu QueryServ."); + Log.Out(Logs::General, Logs::QS_Server, "Starting EQEmu QueryServ."); if (!queryservconfig::LoadConfig()) { - Log.Out(Logs::Detail, Logs::QS_Server, "Loading server configuration failed."); + Log.Out(Logs::General, Logs::QS_Server, "Loading server configuration failed."); return 1; } Config = queryservconfig::get(); WorldShortName = Config->ShortName; - Log.Out(Logs::Detail, Logs::QS_Server, "Connecting to MySQL..."); + Log.Out(Logs::General, Logs::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ if (!qs_database.Connect( @@ -84,7 +84,7 @@ int main() { Config->QSDatabasePassword.c_str(), Config->QSDatabaseDB.c_str(), Config->QSDatabasePort)) { - Log.Out(Logs::Detail, Logs::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection."); return 1; } @@ -93,11 +93,11 @@ int main() { database.LoadLogSysSettings(Log.log_settings); if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::QS_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::QS_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler"); return 1; } From c730519e277e301589109ffe604f44b2b274af60 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:07:22 -0600 Subject: [PATCH 652/707] Fix some categories from before convert --- ucs/ucs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 86462aefe..8ff86f9eb 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -99,14 +99,14 @@ int main() { Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Out(Logs::General, Logs::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::General, Logs::UCS_Server, "Cannot continue without a database connection."); return 1; } char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(Logs::General, Logs::World_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::General, Logs::UCS_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { Log.Out(Logs::General, Logs::UCS_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } From e4797d04f094897a310db97b8bf9130600907eec Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:18:21 -0600 Subject: [PATCH 653/707] Change some defaults for logs --- common/eqemu_logsys.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index ace8692f5..9f5a94d7a 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -94,6 +94,8 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[Logs::Zone_Server].log_to_console = 1; log_settings[Logs::QS_Server].log_to_console = 1; log_settings[Logs::UCS_Server].log_to_console = 1; + log_settings[Logs::Crash].log_to_console = 1; + log_settings[Logs::MySQLError].log_to_console = 1; log_settings_loaded = true; } From 931134688a0dbaacfec3f1503b50e2e7e9fa3596 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:18:44 -0600 Subject: [PATCH 654/707] Add a copy of load log settings to UCS because of how split Database classes are laid out --- ucs/database.cpp | 31 +++++++++++++++++++++++++++++++ ucs/database.h | 3 ++- ucs/ucs.cpp | 33 +++++++++++++++------------------ 3 files changed, 48 insertions(+), 19 deletions(-) diff --git a/ucs/database.cpp b/ucs/database.cpp index 7cd5b7d09..a295880f2 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -578,3 +578,34 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends } +void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ + std::string query = + "SELECT " + "log_category_id, " + "log_category_description, " + "log_to_console, " + "log_to_file, " + "log_to_gmsay " + "FROM " + "logsys_categories " + "ORDER BY log_category_id"; + auto results = QueryDatabase(query); + + int log_category = 0; + Log.file_logs_enabled = false; + + for (auto row = results.begin(); row != results.end(); ++row) { + log_category = atoi(row[0]); + log_settings[log_category].log_to_console = atoi(row[2]); + log_settings[log_category].log_to_file = atoi(row[3]); + log_settings[log_category].log_to_gmsay = atoi(row[4]); + + /* + This determines whether or not the process needs to actually file log anything. + 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].log_to_file > 0){ + Log.file_logs_enabled = true; + } + } +} \ No newline at end of file diff --git a/ucs/database.h b/ucs/database.h index fc9b96d19..a8c382982 100644 --- a/ucs/database.h +++ b/ucs/database.h @@ -57,7 +57,8 @@ public: void ExpireMail(); void AddFriendOrIgnore(int CharID, int Type, std::string Name); void RemoveFriendOrIgnore(int CharID, int Type, std::string Name); - void GetFriendsAndIgnore(int CharID, std::vector &Friends, std::vector &Ignorees); + void GetFriendsAndIgnore(int CharID, std::vector &Friends, std::vector &Ignorees); + void LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings); protected: diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 8ff86f9eb..e67c9e445 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -33,25 +33,21 @@ #include #include -volatile bool RunLoops = true; - -uint32 MailMessagesSent = 0; -uint32 ChatMessagesSent = 0; - -TimeoutManager timeout_manager; - -Clientlist *CL; - ChatChannelList *ChannelList; - +Clientlist *CL; +EQEmuLogSys Log; +TimeoutManager timeout_manager; Database database; - -std::string WorldShortName; +WorldServer *worldserver = nullptr; const ucsconfig *Config; -WorldServer *worldserver = nullptr; -EQEmuLogSys Log; +std::string WorldShortName; + +uint32 ChatMessagesSent = 0; +uint32 MailMessagesSent = 0; + +volatile bool RunLoops = true; void CatchSignal(int sig_num) { @@ -80,10 +76,8 @@ int main() { Log.Out(Logs::General, Logs::UCS_Server, "Starting EQEmu Universal Chat Server."); - if (!ucsconfig::LoadConfig()) { - - Log.Out(Logs::General, Logs::UCS_Server, "Loading server configuration failed."); - + if (!ucsconfig::LoadConfig()) { + Log.Out(Logs::General, Logs::UCS_Server, "Loading server configuration failed."); return 1; } @@ -103,6 +97,9 @@ int main() { return 1; } + /* Register Log System and Settings */ + database.LoadLogSysSettings(Log.log_settings); + char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { From 7f2f6a8612b0dfb44af970f7e56928acb2287083 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:22:15 -0600 Subject: [PATCH 655/707] Placing Log defaults after RegisterExecutablePlatform and installing database log setting loads right after database connection for all processes --- client_files/export/main.cpp | 1 - client_files/import/main.cpp | 2 ++ queryserv/queryserv.cpp | 2 +- world/net.cpp | 2 +- zone/net.cpp | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 42d72b38b..633fecc79 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -56,7 +56,6 @@ int main(int argc, char **argv) { } /* Register Log System and Settings */ - Log.LoadLogSettingsDefaults(); database.LoadLogSysSettings(Log.log_settings); ExportSpells(&database); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 67cc28373..8522227a7 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -53,6 +53,8 @@ int main(int argc, char **argv) { return 1; } + database.LoadLogSysSettings(Log.log_settings); + ImportSpells(&database); ImportSkillCaps(&database); ImportBaseData(&database); diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index b48e72c25..c01d10265 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -52,6 +52,7 @@ void CatchSignal(int sig_num) { int main() { RegisterExecutablePlatform(ExePlatformQueryServ); + Log.LoadLogSettingsDefaults(); set_exception_handler(); Timer LFGuildExpireTimer(60000); Timer InterserverTimer(INTERSERVER_TIMER); // does auto-reconnect @@ -89,7 +90,6 @@ int main() { } /* Register Log System and Settings */ - Log.LoadLogSettingsDefaults(); database.LoadLogSysSettings(Log.log_settings); if (signal(SIGINT, CatchSignal) == SIG_ERR) { diff --git a/world/net.cpp b/world/net.cpp index c83b2db01..97ac46353 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -113,6 +113,7 @@ void CatchSignal(int sig_num); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformWorld); + Log.LoadLogSettingsDefaults(); set_exception_handler(); /* Database Version Check */ @@ -183,7 +184,6 @@ int main(int argc, char** argv) { guild_mgr.SetDatabase(&database); /* Register Log System and Settings */ - Log.LoadLogSettingsDefaults(); database.LoadLogSysSettings(Log.log_settings); if (argc >= 2) { diff --git a/zone/net.cpp b/zone/net.cpp index 8fe7f2a74..55591c1c2 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -115,6 +115,7 @@ extern void MapOpcodes(); int main(int argc, char** argv) { RegisterExecutablePlatform(ExePlatformZone); + Log.LoadLogSettingsDefaults(); set_exception_handler(); const char *zone_name; QServ = new QueryServ; @@ -166,7 +167,6 @@ int main(int argc, char** argv) { } /* Register Log System and Settings */ - Log.LoadLogSettingsDefaults(); Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); database.LoadLogSysSettings(Log.log_settings); From a64c21eb96cc9edd44c4c9d7d8b6d86387b3b3cb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:30:19 -0600 Subject: [PATCH 656/707] Undo Queryserv refactoring because our database class stuff is stupid --- queryserv/database.cpp | 60 ++++++++++++++++++++++++++++++--------- queryserv/database.h | 12 +++++--- queryserv/lfguild.cpp | 16 +++++------ queryserv/queryserv.cpp | 4 +-- queryserv/worldserver.cpp | 18 ++++++------ 5 files changed, 72 insertions(+), 38 deletions(-) diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 4b517016d..1a97ecfc2 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -48,7 +48,7 @@ #include "../common/string_util.h" #include "../common/servertalk.h" -QSDatabase::QSDatabase () +Database::Database () { DBInitVars(); } @@ -57,13 +57,13 @@ QSDatabase::QSDatabase () Establish a connection to a mysql database with the supplied parameters */ -QSDatabase::QSDatabase(const char* host, const char* user, const char* passwd, const char* database, uint32 port) +Database::Database(const char* host, const char* user, const char* passwd, const char* database, uint32 port) { DBInitVars(); Connect(host, user, passwd, database, port); } -bool QSDatabase::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) +bool Database::Connect(const char* host, const char* user, const char* passwd, const char* database, uint32 port) { uint32 errnum= 0; char errbuf[MYSQL_ERRMSG_SIZE]; @@ -81,24 +81,24 @@ bool QSDatabase::Connect(const char* host, const char* user, const char* passwd, } } -void QSDatabase::DBInitVars() { +void Database::DBInitVars() { } -void QSDatabase::HandleMysqlError(uint32 errnum) { +void Database::HandleMysqlError(uint32 errnum) { } /* Close the connection to the database */ -QSDatabase::~QSDatabase() +Database::~Database() { } -void QSDatabase::AddSpeech(const char* from, const char* to, const char* message, uint16 minstatus, uint32 guilddbid, uint8 type) { +void Database::AddSpeech(const char* from, const char* to, const char* message, uint16 minstatus, uint32 guilddbid, uint8 type) { char *escapedFrom = new char[strlen(from) * 2 + 1]; char *escapedTo = new char[strlen(to) * 2 + 1]; @@ -123,7 +123,7 @@ void QSDatabase::AddSpeech(const char* from, const char* to, const char* message } -void QSDatabase::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { +void Database::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) { std::string query = StringFormat("INSERT INTO `qs_player_trade_record` SET `time` = NOW(), " "`char1_id` = '%i', `char1_pp` = '%i', `char1_gp` = '%i', " @@ -164,7 +164,7 @@ void QSDatabase::LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 detailCount) } -void QSDatabase::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) { +void Database::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCount) { std::string query = StringFormat("INSERT INTO `qs_player_handin_record` SET `time` = NOW(), " "`quest_id` = '%i', `char_id` = '%i', `char_pp` = '%i', " @@ -205,7 +205,7 @@ void QSDatabase::LogPlayerHandin(QSPlayerLogHandin_Struct* QS, uint32 detailCoun } -void QSDatabase::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ +void Database::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members){ std::string query = StringFormat("INSERT INTO `qs_player_npc_kill_record` " "SET `npc_id` = '%i', `type` = '%i', " @@ -236,7 +236,7 @@ void QSDatabase::LogPlayerNPCKill(QSPlayerLogNPCKill_Struct* QS, uint32 members) } -void QSDatabase::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { +void Database::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { std::string query = StringFormat("INSERT INTO `qs_player_delete_record` SET `time` = NOW(), " "`char_id` = '%i', `stack_size` = '%i', `char_items` = '%i'", @@ -269,7 +269,7 @@ void QSDatabase::LogPlayerDelete(QSPlayerLogDelete_Struct* QS, uint32 items) { } -void QSDatabase::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { +void Database::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { /* These are item moves */ std::string query = StringFormat("INSERT INTO `qs_player_move_record` SET `time` = NOW(), " @@ -305,7 +305,7 @@ void QSDatabase::LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 items) { } -void QSDatabase::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 items) { +void Database::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 items) { /* Merchant transactions are from the perspective of the merchant, not the player -U */ std::string query = StringFormat("INSERT INTO `qs_merchant_transaction_record` SET `time` = NOW(), " "`zone_id` = '%i', `merchant_id` = '%i', `merchant_pp` = '%i', " @@ -346,7 +346,7 @@ void QSDatabase::LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uin } -void QSDatabase::GeneralQueryReceive(ServerPacket *pack) { +void Database::GeneralQueryReceive(ServerPacket *pack) { /* These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again */ @@ -363,3 +363,35 @@ void QSDatabase::GeneralQueryReceive(ServerPacket *pack) { safe_delete(pack); safe_delete(queryBuffer); } + +void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ + std::string query = + "SELECT " + "log_category_id, " + "log_category_description, " + "log_to_console, " + "log_to_file, " + "log_to_gmsay " + "FROM " + "logsys_categories " + "ORDER BY log_category_id"; + auto results = QueryDatabase(query); + + int log_category = 0; + Log.file_logs_enabled = false; + + for (auto row = results.begin(); row != results.end(); ++row) { + log_category = atoi(row[0]); + log_settings[log_category].log_to_console = atoi(row[2]); + log_settings[log_category].log_to_file = atoi(row[3]); + log_settings[log_category].log_to_gmsay = atoi(row[4]); + + /* + This determines whether or not the process needs to actually file log anything. + 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].log_to_file > 0){ + Log.file_logs_enabled = true; + } + } +} \ No newline at end of file diff --git a/queryserv/database.h b/queryserv/database.h index fe99a866d..898e300c4 100644 --- a/queryserv/database.h +++ b/queryserv/database.h @@ -23,6 +23,7 @@ #define AUTHENTICATION_TIMEOUT 60 #define INVALID_ID 0xFFFFFFFF +#include "../common/eqemu_logsys.h" #include "../common/global_define.h" #include "../common/types.h" #include "../common/dbcore.h" @@ -35,12 +36,12 @@ //atoi is not uint32 or uint32 safe!!!! #define atoul(str) strtoul(str, nullptr, 10) -class QSDatabase : public DBcore { +class Database : public DBcore { public: - QSDatabase(); - QSDatabase(const char* host, const char* user, const char* passwd, const char* database,uint32 port); + Database(); + Database(const char* host, const char* user, const char* passwd, const char* database,uint32 port); bool Connect(const char* host, const char* user, const char* passwd, const char* database,uint32 port); - ~QSDatabase(); + ~Database(); void AddSpeech(const char* from, const char* to, const char* message, uint16 minstatus, uint32 guilddbid, uint8 type); void LogPlayerTrade(QSPlayerLogTrade_Struct* QS, uint32 DetailCount); @@ -50,6 +51,9 @@ public: void LogPlayerMove(QSPlayerLogMove_Struct* QS, uint32 Items); void LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 Items); void GeneralQueryReceive(ServerPacket *pack); + + void LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings); + protected: void HandleMysqlError(uint32 errnum); private: diff --git a/queryserv/lfguild.cpp b/queryserv/lfguild.cpp index 2684f4541..340321f06 100644 --- a/queryserv/lfguild.cpp +++ b/queryserv/lfguild.cpp @@ -8,7 +8,7 @@ #include "../common/rulesys.h" extern WorldServer *worldserver; -extern QSDatabase qs_database; +extern Database database; PlayerLookingForGuild::PlayerLookingForGuild(char *Name, char *Comments, uint32 Level, uint32 Class, uint32 AACount, uint32 Timezone, uint32 TimePosted) { @@ -38,7 +38,7 @@ bool LFGuildManager::LoadDatabase() std::string query = "SELECT `type`,`name`,`comment`, " "`fromlevel`, `tolevel`, `classes`, " "`aacount`, `timezone`, `timeposted` FROM `lfguild`"; - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); if (!results.Success()) { return false; } @@ -239,7 +239,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char } std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 0 AND `name` = '%s'", From); - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); uint32 Now = time(nullptr); @@ -252,7 +252,7 @@ void LFGuildManager::TogglePlayer(uint32 FromZoneID, uint32 FromInstanceID, char "`classes`, `aacount`, `timezone`, `timeposted`) " "VALUES (0, '%s', '%s', %u, 0, %u, %u, %u, %u)", From, Comments, Level, Class, AAPoints, TimeZone, Now); - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); } ServerPacket *pack = new ServerPacket(ServerOP_QueryServGeneric, strlen(From) + strlen(Comments) + 30); @@ -281,7 +281,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char } std::string query = StringFormat("DELETE FROM `lfguild` WHERE `type` = 1 AND `name` = '%s'", GuildName); - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); uint32 Now = time(nullptr); @@ -296,7 +296,7 @@ void LFGuildManager::ToggleGuild(uint32 FromZoneID, uint32 FromInstanceID, char "VALUES (1, '%s', '%s', %u, %u, %u, %u, %u, %u)", GuildName, Comments, FromLevel, ToLevel, Classes, AACount, TimeZone, Now); - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); } @@ -324,7 +324,7 @@ void LFGuildManager::ExpireEntries() continue; std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 0 AND `name` = '%s'", (*it).Name.c_str()); - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); if(!results.Success()) it = Players.erase(it); @@ -336,7 +336,7 @@ void LFGuildManager::ExpireEntries() continue; std::string query = StringFormat("DELETE from `lfguild` WHERE `type` = 1 AND `name` = '%s'", (*it2).Name.c_str()); - auto results = qs_database.QueryDatabase(query); + auto results = database.QueryDatabase(query); if(!results.Success()) it2 = Guilds.erase(it2); diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index c01d10265..f285f8410 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -17,7 +17,6 @@ */ -#include "../common/database.h" #include "../common/global_define.h" #include "../common/eqemu_logsys.h" #include "../common/opcodemgr.h" @@ -37,7 +36,6 @@ volatile bool RunLoops = true; TimeoutManager timeout_manager; Database database; -QSDatabase qs_database; LFGuildManager lfguildmanager; std::string WorldShortName; const queryservconfig *Config; @@ -79,7 +77,7 @@ int main() { Log.Out(Logs::General, Logs::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ - if (!qs_database.Connect( + if (!database.Connect( Config->QSDatabaseHost.c_str(), Config->QSDatabaseUsername.c_str(), Config->QSDatabasePassword.c_str(), diff --git a/queryserv/worldserver.cpp b/queryserv/worldserver.cpp index e043facf9..2d2f288a4 100644 --- a/queryserv/worldserver.cpp +++ b/queryserv/worldserver.cpp @@ -38,7 +38,7 @@ extern WorldServer worldserver; extern const queryservconfig *Config; -extern QSDatabase qs_database; +extern Database database; extern LFGuildManager lfguildmanager; WorldServer::WorldServer() @@ -78,42 +78,42 @@ void WorldServer::Process() Server_Speech_Struct *SSS = (Server_Speech_Struct*)pack->pBuffer; std::string tmp1 = SSS->from; std::string tmp2 = SSS->to; - qs_database.AddSpeech(tmp1.c_str(), tmp2.c_str(), SSS->message, SSS->minstatus, SSS->guilddbid, SSS->type); + database.AddSpeech(tmp1.c_str(), tmp2.c_str(), SSS->message, SSS->minstatus, SSS->guilddbid, SSS->type); break; } case ServerOP_QSPlayerLogTrades: { QSPlayerLogTrade_Struct *QS = (QSPlayerLogTrade_Struct*)pack->pBuffer; - qs_database.LogPlayerTrade(QS, QS->_detail_count); + database.LogPlayerTrade(QS, QS->_detail_count); break; } case ServerOP_QSPlayerLogHandins: { QSPlayerLogHandin_Struct *QS = (QSPlayerLogHandin_Struct*)pack->pBuffer; - qs_database.LogPlayerHandin(QS, QS->_detail_count); + database.LogPlayerHandin(QS, QS->_detail_count); break; } case ServerOP_QSPlayerLogNPCKills: { QSPlayerLogNPCKill_Struct *QS = (QSPlayerLogNPCKill_Struct*)pack->pBuffer; uint32 Members = pack->size - sizeof(QSPlayerLogNPCKill_Struct); if (Members > 0) Members = Members / sizeof(QSPlayerLogNPCKillsPlayers_Struct); - qs_database.LogPlayerNPCKill(QS, Members); + database.LogPlayerNPCKill(QS, Members); break; } case ServerOP_QSPlayerLogDeletes: { QSPlayerLogDelete_Struct *QS = (QSPlayerLogDelete_Struct*)pack->pBuffer; uint32 Items = QS->char_count; - qs_database.LogPlayerDelete(QS, Items); + database.LogPlayerDelete(QS, Items); break; } case ServerOP_QSPlayerLogMoves: { QSPlayerLogMove_Struct *QS = (QSPlayerLogMove_Struct*)pack->pBuffer; uint32 Items = QS->char_count; - qs_database.LogPlayerMove(QS, Items); + database.LogPlayerMove(QS, Items); break; } case ServerOP_QSPlayerLogMerchantTransactions: { QSMerchantLogTransaction_Struct *QS = (QSMerchantLogTransaction_Struct*)pack->pBuffer; uint32 Items = QS->char_count + QS->merchant_count; - qs_database.LogMerchantTransaction(QS, Items); + database.LogMerchantTransaction(QS, Items); break; } case ServerOP_QueryServGeneric: { @@ -155,7 +155,7 @@ void WorldServer::Process() } case ServerOP_QSSendQuery: { /* Process all packets here */ - qs_database.GeneralQueryReceive(pack); + database.GeneralQueryReceive(pack); break; } } From ad5d1e4814df05b1aaec898ef00d4cd999beb016 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:36:15 -0600 Subject: [PATCH 657/707] Some EQEmuLogSys changes regarding class variables --- common/eqemu_logsys.cpp | 5 ++--- common/eqemu_logsys.h | 7 ++++--- queryserv/queryserv.cpp | 18 +++++++++--------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 9f5a94d7a..6354d7a19 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -82,8 +82,9 @@ EQEmuLogSys::~EQEmuLogSys(){ void EQEmuLogSys::LoadLogSettingsDefaults() { + /* Get Executable platform currently running this code (Zone/World/etc) */ log_platform = GetExecutablePlatformInt(); - /* Write defaults */ + /* Zero out Array */ for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){ log_settings[i].log_to_console = 0; log_settings[i].log_to_file = 0; @@ -96,8 +97,6 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[Logs::UCS_Server].log_to_console = 1; log_settings[Logs::Crash].log_to_console = 1; log_settings[Logs::MySQLError].log_to_console = 1; - - log_settings_loaded = true; } std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string in_message){ diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 66124df74..26cffdc57 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -141,10 +141,11 @@ public: LogSettings log_settings[Logs::LogCategory::MaxCategoryID]; - bool log_settings_loaded = false; - bool file_logs_enabled = false; + bool file_logs_enabled = false; /* Set when log settings are loaded to determine if keeping a file open is necessary */ - int log_platform = 0; + int log_platform = 0; /* Sets Executable platform (Zone/World/UCS) etc. */ + + std::string process_file_name; /* File name used in writing logs */ uint16 GetGMSayColorFromCategory(uint16 log_category); diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index f285f8410..1f9aa5b1d 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -77,15 +77,15 @@ int main() { Log.Out(Logs::General, Logs::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ - if (!database.Connect( - Config->QSDatabaseHost.c_str(), - Config->QSDatabaseUsername.c_str(), - Config->QSDatabasePassword.c_str(), - Config->QSDatabaseDB.c_str(), - Config->QSDatabasePort)) { - Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection."); - return 1; - } + // if (!database.Connect( + // Config->QSDatabaseHost.c_str(), + // Config->QSDatabaseUsername.c_str(), + // Config->QSDatabasePassword.c_str(), + // Config->QSDatabaseDB.c_str(), + // Config->QSDatabasePort)) { + // Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection."); + // return 1; + // } /* Register Log System and Settings */ database.LoadLogSysSettings(Log.log_settings); From 01940ee5ed37601d58b1b2d357cb140418741ade Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 05:52:50 -0600 Subject: [PATCH 658/707] Implement crash logging, 'crash_processname_pid.log' at the root of logs/ --- common/eqemu_logsys.cpp | 19 ++++++++++++++++++- queryserv/queryserv.cpp | 18 +++++++++--------- 2 files changed, 27 insertions(+), 10 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 6354d7a19..5b473c7ae 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -28,6 +28,7 @@ #include #include #include +#include std::ofstream process_log; @@ -84,6 +85,7 @@ void EQEmuLogSys::LoadLogSettingsDefaults() { /* Get Executable platform currently running this code (Zone/World/etc) */ log_platform = GetExecutablePlatformInt(); + /* Zero out Array */ for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){ log_settings[i].log_to_console = 0; @@ -91,12 +93,18 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[i].log_to_gmsay = 0; } + /* Set Defaults */ log_settings[Logs::World_Server].log_to_console = 1; log_settings[Logs::Zone_Server].log_to_console = 1; log_settings[Logs::QS_Server].log_to_console = 1; log_settings[Logs::UCS_Server].log_to_console = 1; log_settings[Logs::Crash].log_to_console = 1; log_settings[Logs::MySQLError].log_to_console = 1; + + /* Declare process file names for log writing */ + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld){ process_file_name = "world"; } + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ){ process_file_name = "query_server"; } + } std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string in_message){ @@ -129,6 +137,15 @@ void EQEmuLogSys::ProcessGMSay(uint16 debug_level, uint16 log_category, std::str void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, std::string message) { + if (log_category == Logs::Crash){ + char time_stamp[80]; + EQEmuLogSys::SetCurrentTimeStamp(time_stamp); + std::ofstream crash_log; + crash_log.open(StringFormat("logs/crash_%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); + crash_log << time_stamp << " " << message << "\n"; + crash_log.close(); + } + /* Check if category enabled for process */ if (log_settings[log_category].log_to_file == 0) return; @@ -249,7 +266,7 @@ void EQEmuLogSys::Out(Logs::DebugLevel debug_level, uint16 log_category, std::st EQEmuLogSys::ProcessConsoleMessage(debug_level, log_category, output_debug_message); EQEmuLogSys::ProcessGMSay(debug_level, log_category, output_debug_message); - EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_debug_message); + EQEmuLogSys::ProcessLogWrite(debug_level, log_category, output_message); } void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 1f9aa5b1d..f285f8410 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -77,15 +77,15 @@ int main() { Log.Out(Logs::General, Logs::QS_Server, "Connecting to MySQL..."); /* MySQL Connection */ - // if (!database.Connect( - // Config->QSDatabaseHost.c_str(), - // Config->QSDatabaseUsername.c_str(), - // Config->QSDatabasePassword.c_str(), - // Config->QSDatabaseDB.c_str(), - // Config->QSDatabasePort)) { - // Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection."); - // return 1; - // } + if (!database.Connect( + Config->QSDatabaseHost.c_str(), + Config->QSDatabaseUsername.c_str(), + Config->QSDatabasePassword.c_str(), + Config->QSDatabaseDB.c_str(), + Config->QSDatabasePort)) { + Log.Out(Logs::General, Logs::QS_Server, "Cannot continue without a database connection."); + return 1; + } /* Register Log System and Settings */ database.LoadLogSysSettings(Log.log_settings); From 9ae28d7619d743c66687b2278b8055f6f765a884 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 06:13:12 -0600 Subject: [PATCH 659/707] More process based logging work --- common/eqemu_logsys.cpp | 30 ++++++++++++++++++++++-------- zone/net.cpp | 1 + 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 5b473c7ae..e8bf940e4 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -102,9 +102,16 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[Logs::MySQLError].log_to_console = 1; /* Declare process file names for log writing */ - if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld){ process_file_name = "world"; } - if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ){ process_file_name = "query_server"; } - + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld){ + process_file_name = "world"; + } + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ){ + process_file_name = "query_server"; + } + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + process_file_name = "zone"; + } + } std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string in_message){ @@ -274,7 +281,7 @@ void EQEmuLogSys::SetCurrentTimeStamp(char* time_stamp){ struct tm * time_info; time(&raw_time); time_info = localtime(&raw_time); - strftime(time_stamp, 80, "[%d-%m-%Y :: %H:%M:%S]", time_info); + strftime(time_stamp, 80, "[%m-%d-%Y :: %H:%M:%S]", time_info); } void EQEmuLogSys::MakeDirectory(std::string directory_name){ @@ -288,19 +295,26 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ void EQEmuLogSys::CloseFileLogs() { if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - std::cout << "Closing down zone logs..." << std::endl; + //std::cout << "Closing down zone logs..." << std::endl; + } + if (process_log.is_open()){ + process_log.close(); } - process_log.close(); } void EQEmuLogSys::StartFileLogs(const std::string log_name) { + EQEmuLogSys::CloseFileLogs(); if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ + if (log_name != "") + process_file_name = log_name; + std::cout << "Starting Zone Logs..." << std::endl; EQEmuLogSys::MakeDirectory("logs/zone"); - process_log.open(StringFormat("logs/zone/%s.txt", log_name.c_str()), std::ios_base::app | std::ios_base::out); + process_log.open(StringFormat("logs/zone/%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } else{ - + std::cout << "Starting Process Log..." << std::endl; + process_log.open(StringFormat("logs/%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } } \ No newline at end of file diff --git a/zone/net.cpp b/zone/net.cpp index 55591c1c2..9f46bd384 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -169,6 +169,7 @@ int main(int argc, char** argv) { /* Register Log System and Settings */ Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(""); /* Guilds */ guild_mgr.SetDatabase(&database); From e4829225f6dcb6829e32002ce9cd49bfa0da3005 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 06:15:56 -0600 Subject: [PATCH 660/707] Add file log handling in every process --- client_files/export/main.cpp | 1 + client_files/import/main.cpp | 1 + common/eqemu_logsys.h | 2 +- queryserv/queryserv.cpp | 1 + shared_memory/main.cpp | 2 +- ucs/ucs.cpp | 1 + world/net.cpp | 1 + zone/net.cpp | 2 +- 8 files changed, 8 insertions(+), 3 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 633fecc79..f950907ac 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -57,6 +57,7 @@ int main(int argc, char **argv) { /* Register Log System and Settings */ database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(); ExportSpells(&database); ExportSkillCaps(&database); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 8522227a7..67b0c7140 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -54,6 +54,7 @@ int main(int argc, char **argv) { } database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(); ImportSpells(&database); ImportSkillCaps(&database); diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 26cffdc57..223b87610 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -131,7 +131,7 @@ public: void MakeDirectory(std::string directory_name); void Out(Logs::DebugLevel debug_level, uint16 log_category, std::string message, ...); void SetCurrentTimeStamp(char* time_stamp); - void StartFileLogs(const std::string log_name); + void StartFileLogs(const std::string log_name = ""); struct LogSettings{ uint8 log_to_file; diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index f285f8410..b724276e6 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -89,6 +89,7 @@ int main() { /* Register Log System and Settings */ database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { Log.Out(Logs::General, Logs::QS_Server, "Could not set signal handler"); diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index da385e6ba..bddf03b06 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -58,8 +58,8 @@ int main(int argc, char **argv) { } /* Register Log System and Settings */ - Log.LoadLogSettingsDefaults(); database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(); bool load_all = true; bool load_items = false; diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index e67c9e445..e00754370 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -99,6 +99,7 @@ int main() { /* Register Log System and Settings */ database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(); char tmp[64]; diff --git a/world/net.cpp b/world/net.cpp index 97ac46353..fae6efd1b 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -185,6 +185,7 @@ int main(int argc, char** argv) { /* Register Log System and Settings */ database.LoadLogSysSettings(Log.log_settings); + Log.StartFileLogs(); if (argc >= 2) { char tmp[2]; diff --git a/zone/net.cpp b/zone/net.cpp index 9f46bd384..7d25c1ff7 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -169,7 +169,7 @@ int main(int argc, char** argv) { /* Register Log System and Settings */ Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); database.LoadLogSysSettings(Log.log_settings); - Log.StartFileLogs(""); + Log.StartFileLogs(); /* Guilds */ guild_mgr.SetDatabase(&database); From f4847607fdcd18ce51bd845ec88bf994a07ca60f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 06:26:12 -0600 Subject: [PATCH 661/707] More work on process logging --- common/eqemu_logsys.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index e8bf940e4..826d4955e 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -101,7 +101,9 @@ void EQEmuLogSys::LoadLogSettingsDefaults() log_settings[Logs::Crash].log_to_console = 1; log_settings[Logs::MySQLError].log_to_console = 1; - /* Declare process file names for log writing */ + /* Declare process file names for log writing + If there is no process_file_name declared, no log file will be written, simply + */ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld){ process_file_name = "world"; } @@ -111,7 +113,15 @@ void EQEmuLogSys::LoadLogSettingsDefaults() if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ process_file_name = "zone"; } - + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformUCS){ + process_file_name = "ucs"; + } + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin){ + process_file_name = "login"; + } + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin){ + process_file_name = "launcher"; + } } std::string EQEmuLogSys::FormatOutMessageString(uint16 log_category, std::string in_message){ @@ -305,16 +315,28 @@ void EQEmuLogSys::CloseFileLogs() void EQEmuLogSys::StartFileLogs(const std::string log_name) { EQEmuLogSys::CloseFileLogs(); + + /* When loading settings, we must have been given a reason in category based logging to output to a file in order to even create or open one... */ + if (file_logs_enabled == false) + return; + if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ if (log_name != "") process_file_name = log_name; + if (process_file_name == ""){ + return; + } + std::cout << "Starting Zone Logs..." << std::endl; EQEmuLogSys::MakeDirectory("logs/zone"); process_log.open(StringFormat("logs/zone/%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } else{ - std::cout << "Starting Process Log..." << std::endl; + if (process_file_name == ""){ + return; + } + std::cout << "Starting Process Log (" << process_file_name << ")..." << std::endl; process_log.open(StringFormat("logs/%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } } \ No newline at end of file From 8ae2d86962d0090226b3a04c437ab6175457851a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 06:49:31 -0600 Subject: [PATCH 662/707] rename process_file_name to platform_file_name for consistency --- common/eqemu_logsys.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 826d4955e..962d4e4a1 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -105,22 +105,22 @@ void EQEmuLogSys::LoadLogSettingsDefaults() If there is no process_file_name declared, no log file will be written, simply */ if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformWorld){ - process_file_name = "world"; + platform_file_name = "world"; } if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformQueryServ){ - process_file_name = "query_server"; + platform_file_name = "query_server"; } if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - process_file_name = "zone"; + platform_file_name = "zone"; } if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformUCS){ - process_file_name = "ucs"; + platform_file_name = "ucs"; } if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin){ - process_file_name = "login"; + platform_file_name = "login"; } if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformLogin){ - process_file_name = "launcher"; + platform_file_name = "launcher"; } } @@ -158,7 +158,7 @@ void EQEmuLogSys::ProcessLogWrite(uint16 debug_level, uint16 log_category, std:: char time_stamp[80]; EQEmuLogSys::SetCurrentTimeStamp(time_stamp); std::ofstream crash_log; - crash_log.open(StringFormat("logs/crash_%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); + crash_log.open(StringFormat("logs/crash_%s_%i.txt", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); crash_log << time_stamp << " " << message << "\n"; crash_log.close(); } @@ -322,21 +322,21 @@ void EQEmuLogSys::StartFileLogs(const std::string log_name) if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ if (log_name != "") - process_file_name = log_name; + platform_file_name = log_name; - if (process_file_name == ""){ + if (platform_file_name == ""){ return; } std::cout << "Starting Zone Logs..." << std::endl; EQEmuLogSys::MakeDirectory("logs/zone"); - process_log.open(StringFormat("logs/zone/%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); + process_log.open(StringFormat("logs/zone/%s_%i.txt", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } else{ - if (process_file_name == ""){ + if (platform_file_name == ""){ return; } - std::cout << "Starting Process Log (" << process_file_name << ")..." << std::endl; - process_log.open(StringFormat("logs/%s_%i.txt", process_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); + std::cout << "Starting Process Log (" << platform_file_name << ")..." << std::endl; + process_log.open(StringFormat("logs/%s_%i.txt", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } } \ No newline at end of file From f7ca12f7cc9bb6c004d1667019c11e6f7159067f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 18:47:20 -0600 Subject: [PATCH 663/707] Changed defaults to use enum --- common/eqemu_logsys.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 962d4e4a1..03c690ec5 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -94,12 +94,12 @@ void EQEmuLogSys::LoadLogSettingsDefaults() } /* Set Defaults */ - log_settings[Logs::World_Server].log_to_console = 1; - log_settings[Logs::Zone_Server].log_to_console = 1; - log_settings[Logs::QS_Server].log_to_console = 1; - log_settings[Logs::UCS_Server].log_to_console = 1; - log_settings[Logs::Crash].log_to_console = 1; - log_settings[Logs::MySQLError].log_to_console = 1; + log_settings[Logs::World_Server].log_to_console = Logs::General; + log_settings[Logs::Zone_Server].log_to_console = Logs::General; + log_settings[Logs::QS_Server].log_to_console = Logs::General; + log_settings[Logs::UCS_Server].log_to_console = Logs::General; + log_settings[Logs::Crash].log_to_console = Logs::General; + log_settings[Logs::MySQLError].log_to_console = Logs::General; /* Declare process file names for log writing If there is no process_file_name declared, no log file will be written, simply From bd757417d5fb621047315856f78203aeebf26ad4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:05:11 -0600 Subject: [PATCH 664/707] Platform changes for getpid() --- common/eqemu_logsys.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 03c690ec5..6224d287d 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -28,7 +28,6 @@ #include #include #include -#include std::ofstream process_log; @@ -38,7 +37,9 @@ std::ofstream process_log; #include #include #include + #include #else + #include #include #endif From ce3d4e678f4f5fa9c3c491fa84a4dd53b3698ce7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:19:57 -0600 Subject: [PATCH 665/707] Push something that apparently didn't make its way through before --- common/eqemu_logsys.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/eqemu_logsys.h b/common/eqemu_logsys.h index 223b87610..3578aad0c 100644 --- a/common/eqemu_logsys.h +++ b/common/eqemu_logsys.h @@ -145,7 +145,7 @@ public: int log_platform = 0; /* Sets Executable platform (Zone/World/UCS) etc. */ - std::string process_file_name; /* File name used in writing logs */ + std::string platform_file_name; /* File name used in writing logs */ uint16 GetGMSayColorFromCategory(uint16 log_category); From 98f0d4df4928869bc7b50f99220b9b830fe66b1a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:22:28 -0600 Subject: [PATCH 666/707] UpdateAdmin Linux build fix --- zone/client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/client.cpp b/zone/client.cpp index cd58cfa7c..85d4b61dd 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -1502,7 +1502,7 @@ void Client::UpdateAdmin(bool iFromDB) { if(m_pp.gm) { - Log.Out(Logs::Moderate, Logs::Zone_Server, __FUNCTION__ " - %s is a GM", GetName()); + Log.Out(Logs::Moderate, Logs::Zone_Server, "%s - %s is a GM", __FUNCTION__ , GetName()); // no need for this, having it set in pp you already start as gm // and it's also set in your spawn packet so other people see it too // SendAppearancePacket(AT_GM, 1, false); From 440ca97a795458b4a98b3bf2bf6ed2e699031261 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:40:55 -0600 Subject: [PATCH 667/707] Remove Unneeded DebugBreak: --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 266850411..841fac506 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -75,7 +75,6 @@ Client *Entity::CastToClient() { if (this == 0x00) { std::cout << "CastToClient error (nullptr)" << std::endl; - DebugBreak(); return 0; } #ifdef _EQDEBUG From 7fef8de50a4d1563f7c14859d3f6379564f82931 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:14 -0600 Subject: [PATCH 668/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 841fac506..4936a1f69 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -80,7 +80,6 @@ Client *Entity::CastToClient() #ifdef _EQDEBUG if (!IsClient()) { std::cout << "CastToClient error (not client?)" << std::endl; - DebugBreak(); return 0; } #endif From f44155a31772a156e949e1b7790c115203e0fdb4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:17 -0600 Subject: [PATCH 669/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 4936a1f69..60a2a87ac 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -91,7 +91,6 @@ NPC *Entity::CastToNPC() #ifdef _EQDEBUG if (!IsNPC()) { std::cout << "CastToNPC error" << std::endl; - DebugBreak(); return 0; } #endif From a19f7f702ca4c4b4eea0a3a724567497ad28af11 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:18 -0600 Subject: [PATCH 670/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 60a2a87ac..55d88f1be 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -102,7 +102,6 @@ Mob *Entity::CastToMob() #ifdef _EQDEBUG if (!IsMob()) { std::cout << "CastToMob error" << std::endl; - DebugBreak(); return 0; } #endif From 6e582fb68f4e3c02dac225875d7b91455ad6561f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:19 -0600 Subject: [PATCH 671/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 55d88f1be..b727a2e81 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -113,7 +113,6 @@ Merc *Entity::CastToMerc() #ifdef _EQDEBUG if (!IsMerc()) { std::cout << "CastToMerc error" << std::endl; - DebugBreak(); return 0; } #endif From 6c545a144cd89f64db175f02a2607d241b923f6f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:20 -0600 Subject: [PATCH 672/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index b727a2e81..805f5f4ec 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -135,7 +135,6 @@ Corpse *Entity::CastToCorpse() #ifdef _EQDEBUG if (!IsCorpse()) { std::cout << "CastToCorpse error" << std::endl; - DebugBreak(); return 0; } #endif From 29fe791ad0753b4db344b1bad77708eac79e9569 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:21 -0600 Subject: [PATCH 673/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 805f5f4ec..176f1af8e 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -146,7 +146,6 @@ Object *Entity::CastToObject() #ifdef _EQDEBUG if (!IsObject()) { std::cout << "CastToObject error" << std::endl; - DebugBreak(); return 0; } #endif From 456356d6260a9134c08f6ec829895595893f7671 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:22 -0600 Subject: [PATCH 674/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 176f1af8e..34f630b59 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -156,7 +156,6 @@ Object *Entity::CastToObject() #ifdef _EQDEBUG if(!IsGroup()) { std::cout << "CastToGroup error" << std::endl; - DebugBreak(); return 0; } #endif From 0db638c8c01618b0691c41e19db5f781d9df876c Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:23 -0600 Subject: [PATCH 675/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 34f630b59..eb387d403 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -176,7 +176,6 @@ const Client *Entity::CastToClient() const { if (this == 0x00) { std::cout << "CastToClient error (nullptr)" << std::endl; - DebugBreak(); return 0; } #ifdef _EQDEBUG From 26b65a05a91399869ffe9d9405acdc6b479fe48f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:24 -0600 Subject: [PATCH 676/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index eb387d403..1229362b3 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -181,7 +181,6 @@ const Client *Entity::CastToClient() const #ifdef _EQDEBUG if (!IsClient()) { std::cout << "CastToClient error (not client?)" << std::endl; - DebugBreak(); return 0; } #endif From 32cba9083cf52bfba04dd5dd6d1c72ce4ddf90e2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:25 -0600 Subject: [PATCH 677/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 1229362b3..9f797d94c 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -192,7 +192,6 @@ const NPC *Entity::CastToNPC() const #ifdef _EQDEBUG if (!IsNPC()) { std::cout << "CastToNPC error" << std::endl; - DebugBreak(); return 0; } #endif From 90dd9f8aeb1ca4d7bb6a4c042fffc85a9a9c626b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:26 -0600 Subject: [PATCH 678/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 9f797d94c..d272f62e4 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -203,7 +203,6 @@ const Mob *Entity::CastToMob() const #ifdef _EQDEBUG if (!IsMob()) { std::cout << "CastToMob error" << std::endl; - DebugBreak(); return 0; } #endif From 07d2eab1831c88127e88f4aac85acc358d2691ac Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:27 -0600 Subject: [PATCH 679/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index d272f62e4..b922b6e2d 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -214,7 +214,6 @@ const Merc *Entity::CastToMerc() const #ifdef _EQDEBUG if (!IsMerc()) { std::cout << "CastToMerc error" << std::endl; - DebugBreak(); return 0; } #endif From 56b0a2aa4f463de0324bc3c81df59a3fcad75634 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:28 -0600 Subject: [PATCH 680/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index b922b6e2d..3eec3d0fc 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -235,7 +235,6 @@ const Corpse *Entity::CastToCorpse() const #ifdef _EQDEBUG if (!IsCorpse()) { std::cout << "CastToCorpse error" << std::endl; - DebugBreak(); return 0; } #endif From a6a86f030c85fa8e739132c89c29a8311eeccefe Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:29 -0600 Subject: [PATCH 681/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 3eec3d0fc..924e95f11 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -246,7 +246,6 @@ const Object *Entity::CastToObject() const #ifdef _EQDEBUG if (!IsObject()) { std::cout << "CastToObject error" << std::endl; - DebugBreak(); return 0; } #endif From 013216ff2b878401b13b1a334649c186fba04e28 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:41:30 -0600 Subject: [PATCH 682/707] Remove Unneeded DebugBreak --- zone/entity.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/zone/entity.cpp b/zone/entity.cpp index 924e95f11..717986bd6 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -268,7 +268,6 @@ Bot *Entity::CastToBot() #ifdef _EQDEBUG if (!IsBot()) { std::cout << "CastToBot error" << std::endl; - DebugBreak(); return 0; } #endif From c202b9e7b6247923da41b468405244e5c0e1b645 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 19:54:08 -0600 Subject: [PATCH 683/707] Linux fix in worldserver.cpp with __FUNCTION__ --- zone/worldserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index f305133dd..dc3b23339 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -746,7 +746,7 @@ void WorldServer::Process() { } case ServerOP_SyncWorldTime: { if(zone!=0) { - Log.Out(Logs::Moderate, Logs::Zone_Server, __FUNCTION__ "Received Message SyncWorldTime"); + Log.Out(Logs::Moderate, Logs::Zone_Server, "%s Received Message SyncWorldTime", __FUNCTION__); eqTimeOfDay* newtime = (eqTimeOfDay*) pack->pBuffer; zone->zone_time.setEQTimeOfDay(newtime->start_eqtime, newtime->start_realtime); EQApplicationPacket* outapp = new EQApplicationPacket(OP_TimeOfDay, sizeof(TimeOfDay_Struct)); From 38c94f6dda5e041d391460c3e1f7dcfaa8a873da Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 20:00:48 -0600 Subject: [PATCH 684/707] Push table update --- .../2015_1_15_logsys_categories_table.sql | 70 +++++++++++++------ 1 file changed, 50 insertions(+), 20 deletions(-) diff --git a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql index 6e6847416..fee695604 100644 --- a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql +++ b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql @@ -1,3 +1,17 @@ +/* +Navicat MySQL Data Transfer + +Source Server : localhost +Source Server Version : 50505 +Source Host : localhost:3306 +Source Database : ez + +Target Server Type : MYSQL +Target Server Version : 50505 +File Encoding : 65001 + +Date: 2015-01-20 20:00:17 +*/ SET FOREIGN_KEY_CHECKS=0; @@ -17,23 +31,39 @@ CREATE TABLE `logsys_categories` ( -- ---------------------------- -- Records of logsys_categories -- ---------------------------- -INSERT INTO `logsys_categories` VALUES ('1', 'Zone_Server', '1', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('2', 'World_Server', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('3', 'UCS_Server', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('4', 'QS_Server', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('5', 'WebInterface_Server', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('6', 'AA', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('7', 'Doors', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('8', 'Guilds', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('9', 'Inventory', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('10', 'Launcher', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('11', 'Netcode - Does not log to gmsay for loop reasons', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('12', 'Object', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('13', 'Rules', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('14', 'Skills', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('15', 'Spawns', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('16', 'Spells', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('17', 'Tasks', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('18', 'Trading', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('19', 'Tradeskills', '0', '0', '1'); -INSERT INTO `logsys_categories` VALUES ('20', 'Tribute', '0', '0', '1'); +INSERT INTO `logsys_categories` VALUES ('1', 'AA', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('2', 'AI', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('3', 'Aggro', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('4', 'Attack', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('5', 'Client_Server_Packet', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('6', 'Combat', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('7', 'Commands', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('8', 'Crash', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('9', 'Debug', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('10', 'Doors', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('11', 'Error', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('12', 'Guilds', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('13', 'Inventory', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('14', 'Launcher', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('15', 'Netcode', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('16', 'Normal', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('17', 'Object', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('18', 'Pathing', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('19', 'QS_Server', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('20', 'Quests', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('21', 'Rules', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('22', 'Skills', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('23', 'Spawns', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('24', 'Spells', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('25', 'Status', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('26', 'TCP_Connection', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('27', 'Tasks', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('28', 'Tradeskills', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('29', 'Trading', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('30', 'Tribute', '0', '1', '0'); +INSERT INTO `logsys_categories` VALUES ('31', 'UCS_Server', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('32', 'WebInterface_Server', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('33', 'World_Server', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('34', 'Zone Server', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('35', 'MySQL Error', '1', '1', '1'); +INSERT INTO `logsys_categories` VALUES ('36', 'MySQL Queries', '0', '1', '0'); From 7101d84b275194173cae8763e43d78b588d3b3d1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 20:01:44 -0600 Subject: [PATCH 685/707] Remove garbage in commit --- .../2015_1_15_logsys_categories_table.sql | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql index fee695604..45d9cde3b 100644 --- a/utils/sql/git/required/2015_1_15_logsys_categories_table.sql +++ b/utils/sql/git/required/2015_1_15_logsys_categories_table.sql @@ -1,20 +1,3 @@ -/* -Navicat MySQL Data Transfer - -Source Server : localhost -Source Server Version : 50505 -Source Host : localhost:3306 -Source Database : ez - -Target Server Type : MYSQL -Target Server Version : 50505 -File Encoding : 65001 - -Date: 2015-01-20 20:00:17 -*/ - -SET FOREIGN_KEY_CHECKS=0; - -- ---------------------------- -- Table structure for logsys_categories -- ---------------------------- From 1871c3f24f6edf6d51374c3670f4394c89fccee4 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 23:18:23 -0600 Subject: [PATCH 686/707] Implement first pieces of #log --- zone/command.cpp | 28 +++++++++++++++++++++++++++- zone/command.h | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/zone/command.cpp b/zone/command.cpp index 3902242c6..33ceca542 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -427,7 +427,8 @@ int command_init(void) { command_add("close_shop", nullptr, 100, command_merchantcloseshop) || command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) || - command_add("logtest", "Performs log performance testing.", 250, command_logtest) + command_add("logtest", "Performs log performance testing.", 250, command_logtest) || + command_add("log", "Manage anything to do with logs", 250, command_log) ) { command_deinit(); @@ -10414,4 +10415,29 @@ void command_crashtest(Client *c, const Seperator *sep) c->Message(0, "Alright, now we get an GPF ;) "); char* gpf = 0; memcpy(gpf, "Ready to crash", 30); +} + +void command_log(Client *c, const Seperator *sep){ + if (sep->argnum > 0) { + if(strcasecmp(sep->arg[1], "reload_all") == 0){ + c->Message(0, "Yes this is working"); + } + if (strcasecmp(sep->arg[1], "list_settings") == 0){ + c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]"); + int redisplay_columns = 0; + for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){ + if (redisplay_columns == 10){ + c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]"); + redisplay_columns = 0; + } + c->Message(0, StringFormat("--- %i | %u | %u | %u | %s", i, Log.log_settings[i].log_to_console, Log.log_settings[i].log_to_file, Log.log_settings[i].log_to_gmsay, Logs::LogCategoryName[i]).c_str()); + redisplay_columns++; + } + } + } + else { + c->Message(0, "#log usage:"); + c->Message(0, "--- #log reload_all - Reloads all rules defined in database in world and all zone processes"); + c->Message(0, "--- #log list_settings - Shows current log settings and categories"); + } } \ No newline at end of file diff --git a/zone/command.h b/zone/command.h index ab32bfd5e..2e15788cd 100644 --- a/zone/command.h +++ b/zone/command.h @@ -323,6 +323,7 @@ void command_merchantopenshop(Client *c, const Seperator *sep); void command_merchantcloseshop(Client *c, const Seperator *sep); void command_shownumhits(Client *c, const Seperator *sep); void command_logtest(Client *c, const Seperator *sep); +void command_log(Client *c, const Seperator *sep); #ifdef EQPROFILE void command_profiledump(Client *c, const Seperator *sep); From d4460b94be8d2128294795464e73609b2ebd84e3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Tue, 20 Jan 2015 23:21:32 -0600 Subject: [PATCH 687/707] Rename #log to #logs after thinking deeply about it --- zone/command.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 33ceca542..67d8a1f38 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -428,7 +428,7 @@ int command_init(void) { command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) || command_add("logtest", "Performs log performance testing.", 250, command_logtest) || - command_add("log", "Manage anything to do with logs", 250, command_log) + command_add("logs", "Manage anything to do with logs", 250, command_logs) ) { command_deinit(); @@ -10417,7 +10417,7 @@ void command_crashtest(Client *c, const Seperator *sep) memcpy(gpf, "Ready to crash", 30); } -void command_log(Client *c, const Seperator *sep){ +void command_logs(Client *c, const Seperator *sep){ if (sep->argnum > 0) { if(strcasecmp(sep->arg[1], "reload_all") == 0){ c->Message(0, "Yes this is working"); @@ -10436,8 +10436,9 @@ void command_log(Client *c, const Seperator *sep){ } } else { - c->Message(0, "#log usage:"); - c->Message(0, "--- #log reload_all - Reloads all rules defined in database in world and all zone processes"); - c->Message(0, "--- #log list_settings - Shows current log settings and categories"); + c->Message(0, "#logs usage:"); + c->Message(0, "--- #logs reload_all - Reloads all rules defined in database in world and all zone processes"); + c->Message(0, "--- #logs list_settings - Shows current log settings and categories"); + c->Message(0, "--- #logs set - Sets in memory the log settings, if you want settings to be permanent, edit your 'logsys_categories' table"); } } \ No newline at end of file From 6cfe9e301bbe8e2eb2d269e608129b4c42d7fc25 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 00:01:28 -0600 Subject: [PATCH 688/707] Preliminary log setting commands --- zone/command.cpp | 23 +++++++++++++++++++++++ zone/command.h | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/zone/command.cpp b/zone/command.cpp index 67d8a1f38..7b33b46c0 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10418,10 +10418,33 @@ void command_crashtest(Client *c, const Seperator *sep) } void command_logs(Client *c, const Seperator *sep){ + int logs_set = 0; if (sep->argnum > 0) { if(strcasecmp(sep->arg[1], "reload_all") == 0){ c->Message(0, "Yes this is working"); } + if (strcasecmp(sep->arg[1], "set") == 0){ + if (strcasecmp(sep->arg[4], "log_to_console") == 0){ + Log.log_settings[atoi(sep->arg[2])].log_to_console = atoi(sep->arg[3]); + logs_set = 1; + } + else if (strcasecmp(sep->arg[4], "log_to_file") == 0){ + Log.log_settings[atoi(sep->arg[2])].log_to_file = atoi(sep->arg[3]); + logs_set = 1; + } + else if (strcasecmp(sep->arg[4], "log_to_gmsay") == 0){ + Log.log_settings[atoi(sep->arg[2])].log_to_gmsay = atoi(sep->arg[3]); + logs_set = 1; + } + else{ + c->Message(0, "--- #logs set - Sets in memory the log settings, if you want settings to be permanent, edit your 'logsys_categories' table"); + c->Message(0, "--- #logs set 20 1 log_to_gmsay - Would output Quest errors to gmsay"); + } + if (logs_set == 1){ + c->Message(15, "Your Log Settings have been applied"); + c->Message(15, "%s :: Debug Level: %i - Category: %s", sep->arg[4], atoi(sep->arg[3]), Logs::LogCategoryName[atoi(sep->arg[2])]); + } + } if (strcasecmp(sep->arg[1], "list_settings") == 0){ c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]"); int redisplay_columns = 0; diff --git a/zone/command.h b/zone/command.h index 2e15788cd..dbbd7e770 100644 --- a/zone/command.h +++ b/zone/command.h @@ -323,7 +323,7 @@ void command_merchantopenshop(Client *c, const Seperator *sep); void command_merchantcloseshop(Client *c, const Seperator *sep); void command_shownumhits(Client *c, const Seperator *sep); void command_logtest(Client *c, const Seperator *sep); -void command_log(Client *c, const Seperator *sep); +void command_logs(Client *c, const Seperator *sep); #ifdef EQPROFILE void command_profiledump(Client *c, const Seperator *sep); From 47bb4c0b2b1a1999adcd7f4aa1a90eaaa7ef7ec1 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 01:26:33 -0600 Subject: [PATCH 689/707] Implement #logs set [console|file|gmsay] --- zone/command.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 7b33b46c0..1f1bd7fc4 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10424,33 +10424,33 @@ void command_logs(Client *c, const Seperator *sep){ c->Message(0, "Yes this is working"); } if (strcasecmp(sep->arg[1], "set") == 0){ - if (strcasecmp(sep->arg[4], "log_to_console") == 0){ - Log.log_settings[atoi(sep->arg[2])].log_to_console = atoi(sep->arg[3]); + if (strcasecmp(sep->arg[2], "console") == 0){ + Log.log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]); logs_set = 1; } - else if (strcasecmp(sep->arg[4], "log_to_file") == 0){ - Log.log_settings[atoi(sep->arg[2])].log_to_file = atoi(sep->arg[3]); + else if (strcasecmp(sep->arg[2], "file") == 0){ + Log.log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]); logs_set = 1; } - else if (strcasecmp(sep->arg[4], "log_to_gmsay") == 0){ - Log.log_settings[atoi(sep->arg[2])].log_to_gmsay = atoi(sep->arg[3]); + else if (strcasecmp(sep->arg[2], "gmsay") == 0){ + Log.log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]); logs_set = 1; } else{ - c->Message(0, "--- #logs set - Sets in memory the log settings, if you want settings to be permanent, edit your 'logsys_categories' table"); - c->Message(0, "--- #logs set 20 1 log_to_gmsay - Would output Quest errors to gmsay"); + c->Message(0, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); + c->Message(0, "--- #logs set gmsay 20 1 - Would output Quest errors to gmsay"); } - if (logs_set == 1){ + if (logs_set == 1){ c->Message(15, "Your Log Settings have been applied"); - c->Message(15, "%s :: Debug Level: %i - Category: %s", sep->arg[4], atoi(sep->arg[3]), Logs::LogCategoryName[atoi(sep->arg[2])]); + c->Message(15, "Output Method: %s :: Debug Level: %i - Category: %s", sep->arg[2], atoi(sep->arg[4]), Logs::LogCategoryName[atoi(sep->arg[3])]); } } if (strcasecmp(sep->arg[1], "list_settings") == 0){ - c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]"); + c->Message(0, "[Category ID | console | file | gmsay | Category Description]"); int redisplay_columns = 0; for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){ if (redisplay_columns == 10){ - c->Message(0, "[Category ID | log_to_console | log_to_file | log_to_gmsay | Category Description]"); + c->Message(0, "[Category ID | console | file | gmsay | Category Description]"); redisplay_columns = 0; } c->Message(0, StringFormat("--- %i | %u | %u | %u | %s", i, Log.log_settings[i].log_to_console, Log.log_settings[i].log_to_file, Log.log_settings[i].log_to_gmsay, Logs::LogCategoryName[i]).c_str()); @@ -10462,6 +10462,6 @@ void command_logs(Client *c, const Seperator *sep){ c->Message(0, "#logs usage:"); c->Message(0, "--- #logs reload_all - Reloads all rules defined in database in world and all zone processes"); c->Message(0, "--- #logs list_settings - Shows current log settings and categories"); - c->Message(0, "--- #logs set - Sets in memory the log settings, if you want settings to be permanent, edit your 'logsys_categories' table"); + c->Message(0, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); } } \ No newline at end of file From ef0d383de96f5fa6e62509a4d107527a665ce3d5 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 02:12:22 -0600 Subject: [PATCH 690/707] Adjust #logs set --- zone/command.cpp | 49 +++++++++++++++++++++++++----------------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 1f1bd7fc4..a91eae5eb 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10420,32 +10420,12 @@ void command_crashtest(Client *c, const Seperator *sep) void command_logs(Client *c, const Seperator *sep){ int logs_set = 0; if (sep->argnum > 0) { + /* #logs reload_all */ if(strcasecmp(sep->arg[1], "reload_all") == 0){ c->Message(0, "Yes this is working"); } - if (strcasecmp(sep->arg[1], "set") == 0){ - if (strcasecmp(sep->arg[2], "console") == 0){ - Log.log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]); - logs_set = 1; - } - else if (strcasecmp(sep->arg[2], "file") == 0){ - Log.log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]); - logs_set = 1; - } - else if (strcasecmp(sep->arg[2], "gmsay") == 0){ - Log.log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]); - logs_set = 1; - } - else{ - c->Message(0, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); - c->Message(0, "--- #logs set gmsay 20 1 - Would output Quest errors to gmsay"); - } - if (logs_set == 1){ - c->Message(15, "Your Log Settings have been applied"); - c->Message(15, "Output Method: %s :: Debug Level: %i - Category: %s", sep->arg[2], atoi(sep->arg[4]), Logs::LogCategoryName[atoi(sep->arg[3])]); - } - } - if (strcasecmp(sep->arg[1], "list_settings") == 0){ + /* #logs list_settings */ + if (strcasecmp(sep->arg[1], "list_settings") == 0 || (strcasecmp(sep->arg[1], "set") == 0 && strcasecmp(sep->arg[3], "") == 0)){ c->Message(0, "[Category ID | console | file | gmsay | Category Description]"); int redisplay_columns = 0; for (int i = 0; i < Logs::LogCategory::MaxCategoryID; i++){ @@ -10457,6 +10437,29 @@ void command_logs(Client *c, const Seperator *sep){ redisplay_columns++; } } + /* #logs set */ + if (strcasecmp(sep->arg[1], "set") == 0){ + if (strcasecmp(sep->arg[2], "console") == 0){ + Log.log_settings[atoi(sep->arg[3])].log_to_console = atoi(sep->arg[4]); + logs_set = 1; + } + else if (strcasecmp(sep->arg[2], "file") == 0){ + Log.log_settings[atoi(sep->arg[3])].log_to_file = atoi(sep->arg[4]); + logs_set = 1; + } + else if (strcasecmp(sep->arg[2], "gmsay") == 0){ + Log.log_settings[atoi(sep->arg[3])].log_to_gmsay = atoi(sep->arg[4]); + logs_set = 1; + } + else{ + c->Message(0, "--- #logs set [console|file|gmsay] - Sets log settings during the lifetime of the zone"); + c->Message(0, "--- #logs set gmsay 20 1 - Would output Quest errors to gmsay"); + } + if (logs_set == 1){ + c->Message(15, "Your Log Settings have been applied"); + c->Message(15, "Output Method: %s :: Debug Level: %i - Category: %s", sep->arg[2], atoi(sep->arg[4]), Logs::LogCategoryName[atoi(sep->arg[3])]); + } + } } else { c->Message(0, "#logs usage:"); From a59138d2d910ca75fefb33f80ee41079473c5f82 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 03:01:21 -0600 Subject: [PATCH 691/707] Implement #logs reload_all - To reload world and zone their log settings from the database --- common/servertalk.h | 21 +++++++++++---------- world/zoneserver.cpp | 5 +++++ zone/command.cpp | 7 +++++-- zone/worldserver.cpp | 4 ++++ 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/common/servertalk.h b/common/servertalk.h index f458c758e..547dda9b1 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -180,16 +180,17 @@ #define ServerOP_CZSignalClientByName 0x4007 #define ServerOP_CZMessagePlayer 0x4008 #define ServerOP_ReloadWorld 0x4009 - -#define ServerOP_QSPlayerLogTrades 0x4010 -#define ServerOP_QSPlayerLogHandins 0x4011 -#define ServerOP_QSPlayerLogNPCKills 0x4012 -#define ServerOP_QSPlayerLogDeletes 0x4013 -#define ServerOP_QSPlayerLogMoves 0x4014 -#define ServerOP_QSPlayerLogMerchantTransactions 0x4015 -#define ServerOP_QSSendQuery 0x4016 -#define ServerOP_CZSignalNPC 0x4017 -#define ServerOP_CZSetEntityVariableByNPCTypeID 0x4018 +#define ServerOP_ReloadLogs 0x4010 +/* Query Server OP Codes */ +#define ServerOP_QSPlayerLogTrades 0x5010 +#define ServerOP_QSPlayerLogHandins 0x5011 +#define ServerOP_QSPlayerLogNPCKills 0x5012 +#define ServerOP_QSPlayerLogDeletes 0x5013 +#define ServerOP_QSPlayerLogMoves 0x5014 +#define ServerOP_QSPlayerLogMerchantTransactions 0x5015 +#define ServerOP_QSSendQuery 0x5016 +#define ServerOP_CZSignalNPC 0x5017 +#define ServerOP_CZSetEntityVariableByNPCTypeID 0x5018 /* Query Serv Generic Packet Flag/Type Enumeration */ enum { QSG_LFGuild = 0 }; diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index d8909dbd8..51c07954e 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -792,6 +792,11 @@ bool ZoneServer::Process() { client_list.SendClientVersionSummary(srcvss->Name); break; } + case ServerOP_ReloadLogs: { + zoneserver_list.SendPacket(pack); + database.LoadLogSysSettings(Log.log_settings); + break; + } case ServerOP_ReloadRules: { zoneserver_list.SendPacket(pack); RuleManager::Instance()->LoadRules(&database, "default"); diff --git a/zone/command.cpp b/zone/command.cpp index a91eae5eb..65144d8f1 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -10421,8 +10421,11 @@ void command_logs(Client *c, const Seperator *sep){ int logs_set = 0; if (sep->argnum > 0) { /* #logs reload_all */ - if(strcasecmp(sep->arg[1], "reload_all") == 0){ - c->Message(0, "Yes this is working"); + if (strcasecmp(sep->arg[1], "reload_all") == 0){ + ServerPacket *pack = new ServerPacket(ServerOP_ReloadLogs, 0); + worldserver.SendPacket(pack); + c->Message(13, "Successfully sent the packet to world to reload log settings from the database for all zones"); + safe_delete(pack); } /* #logs list_settings */ if (strcasecmp(sep->arg[1], "list_settings") == 0 || (strcasecmp(sep->arg[1], "set") == 0 && strcasecmp(sep->arg[3], "") == 0)){ diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index dc3b23339..b35894d04 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -1748,6 +1748,10 @@ void WorldServer::Process() { RuleManager::Instance()->LoadRules(&database, RuleManager::Instance()->GetActiveRuleset()); break; } + case ServerOP_ReloadLogs: { + database.LoadLogSysSettings(Log.log_settings); + break; + } case ServerOP_CameraShake: { if(zone) From 1e59416f331f3a7530d61e2896c78163e17cd5ba Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 16:49:25 -0600 Subject: [PATCH 692/707] Post merge manual fixes --- zone/command.cpp | 2 +- zone/inventory.cpp | 12 ++++++------ zone/tune.cpp | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/zone/command.cpp b/zone/command.cpp index 3c5d3c3a7..18b0892a0 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -425,7 +425,7 @@ int command_init(void) { command_add("open_shop", nullptr, 100, command_merchantopenshop) || command_add("merchant_close_shop", "Closes a merchant shop", 100, command_merchantcloseshop) || command_add("close_shop", nullptr, 100, command_merchantcloseshop) || - command_add("tune", "Calculate ideal statical values related to combat.", 100, command_tune) + command_add("tune", "Calculate ideal statical values related to combat.", 100, command_tune) || command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) || command_add("logtest", "Performs log performance testing.", 250, command_logtest) || command_add("logs", "Manage anything to do with logs", 250, command_logs) diff --git a/zone/inventory.cpp b/zone/inventory.cpp index 35b6aec8f..c108dfb10 100644 --- a/zone/inventory.cpp +++ b/zone/inventory.cpp @@ -2188,7 +2188,7 @@ void Client::RemoveDuplicateLore(bool client_update) auto inst = m_inv.PopItem(MainPowerSource); if (inst) { if (CheckLoreConflict(inst->GetItem())) { - Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Lore Duplication Error: Deleting %s from slot %i", inst->GetItem()->Name, MainPowerSource); database.SaveInventory(character_id, nullptr, MainPowerSource); } else { @@ -2301,7 +2301,7 @@ void Client::MoveSlotNotAllowed(bool client_update) auto inst = m_inv.PopItem(MainPowerSource); bool is_arrow = (inst->GetItem()->ItemType == ItemTypeArrow) ? true : false; int16 free_slot_id = m_inv.FindFreeSlot(inst->IsType(ItemClassContainer), true, inst->GetItem()->Size, is_arrow); - Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, slot_id, free_slot_id); + Log.Out(Logs::Detail, Logs::Inventory, "Slot Assignment Error: Moving %s from slot %i to %i", inst->GetItem()->Name, MainPowerSource, free_slot_id); PutItemInInventory(free_slot_id, *inst, (GetClientVersion() >= EQClientSoF) ? client_update : false); database.SaveInventory(character_id, nullptr, MainPowerSource); safe_delete(inst); @@ -2552,13 +2552,13 @@ void Client::SetBandolier(const EQApplicationPacket *app) { // If there was an item in that weapon slot, put it in the inventory Log.Out(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); - _log(INVENTORY__BANDOLIER, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); + Log.Out(Logs::Detail, Logs::Inventory, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); if (MoveItemToInventory(InvItem)) { database.SaveInventory(character_id, 0, WeaponSlot); - Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), + Log.Out(Logs::General, Logs::Error, "returning item %s in weapon slot %i to inventory", InvItem->GetItem()->Name, WeaponSlot); } else { - _log(INVENTORY__BANDOLIER, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); + Log.Out(Logs::General, Logs::Error, "Char: %s, ERROR returning %s to inventory", GetName(), InvItem->GetItem()->Name); } safe_delete(InvItem); } @@ -2826,7 +2826,7 @@ bool Client::InterrogateInventory(Client* requester, bool log, bool silent, bool log = true; if (log) { - _Log.Out(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); + Log.Out(Logs::General, Logs::Error, "Client::InterrogateInventory() called for %s by %s with an error state of %s", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); } if (!silent) { requester->Message(1, "--- Inventory Interrogation Report for %s (requested by: %s, error state: %s) ---", GetName(), requester->GetName(), (error ? "TRUE" : "FALSE")); diff --git a/zone/tune.cpp b/zone/tune.cpp index 2f071e458..4153d5b84 100644 --- a/zone/tune.cpp +++ b/zone/tune.cpp @@ -20,7 +20,7 @@ //#define TUNE_DEBUG 20 #endif -#include "../common/debug.h" +#include "../common/global_define.h" #include "../common/eq_constants.h" #include "../common/eq_packet_structs.h" #include "../common/rulesys.h" From 51b3ae9e0a4bd148c09a0656d1c87f74da05f592 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 16:55:56 -0600 Subject: [PATCH 693/707] Add shownumhits command back in from merge --- zone/command.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/zone/command.cpp b/zone/command.cpp index 18b0892a0..4ee902696 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -426,6 +426,7 @@ int command_init(void) { command_add("merchant_close_shop", "Closes a merchant shop", 100, command_merchantcloseshop) || command_add("close_shop", nullptr, 100, command_merchantcloseshop) || command_add("tune", "Calculate ideal statical values related to combat.", 100, command_tune) || + command_add("shownumhits", "Shows buffs numhits for yourself.", 0, command_shownumhits) || command_add("crashtest", "- Crash the zoneserver", 255, command_crashtest) || command_add("logtest", "Performs log performance testing.", 250, command_logtest) || command_add("logs", "Manage anything to do with logs", 250, command_logs) From 683a81a6c8d52b877794c3b8519cca559b460953 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:39:36 -0600 Subject: [PATCH 694/707] Post merge fixes --- world/client.cpp | 2 +- zone/entity.cpp | 26 -------------------------- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/world/client.cpp b/world/client.cpp index cd10b8228..50b56cb0d 100644 --- a/world/client.cpp +++ b/world/client.cpp @@ -1442,7 +1442,7 @@ bool Client::OPCharCreate(char *name, CharCreate_Struct *cc) } } else { - clog(WORLD__CLIENT, "Found 'TitaniumStartZoneID' rule setting: %i", RuleI(World, TitaniumStartZoneID)); + Log.Out(Logs::General, Logs::World_Server, "Found 'TitaniumStartZoneID' rule setting: %i", RuleI(World, TitaniumStartZoneID)); if (RuleI(World, TitaniumStartZoneID) > 0) { /* if there's a startzone variable put them in there */ pp.zone_id = RuleI(World, TitaniumStartZoneID); diff --git a/zone/entity.cpp b/zone/entity.cpp index 54a2b7aee..5600ccc83 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -3509,32 +3509,6 @@ bool EntityList::LimitCheckName(const char *npc_name) return true; } -void EntityList::RadialSetLogging(Mob *around, bool enabled, bool clients, - bool non_clients, float range) -{ - float range2 = range * range; - - auto it = mob_list.begin(); - while (it != mob_list.end()) { - Mob *mob = it->second; - - ++it; - - if (mob->IsClient()) { - if (!clients) - continue; - } else { - if (!non_clients) - continue; - } - - if (ComparativeDistance(around->GetPosition(), mob->GetPosition()) > range2) - continue; - - - } -} - void EntityList::UpdateHoTT(Mob *target) { auto it = client_list.begin(); From 7ce5acf7013443393b85ff5e6204138e653f776f Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:43:47 -0600 Subject: [PATCH 695/707] Cleanup CloseFileLogs() --- common/eqemu_logsys.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index 6224d287d..d31744cd1 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -305,9 +305,6 @@ void EQEmuLogSys::MakeDirectory(std::string directory_name){ void EQEmuLogSys::CloseFileLogs() { - if (EQEmuLogSys::log_platform == EQEmuExePlatform::ExePlatformZone){ - //std::cout << "Closing down zone logs..." << std::endl; - } if (process_log.is_open()){ process_log.close(); } From 92737339b318e489072d5f18c88239537e9c7b1a Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:46:56 -0600 Subject: [PATCH 696/707] Properly close process files in zone and world --- world/net.cpp | 1 + zone/net.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/world/net.cpp b/world/net.cpp index fae6efd1b..da77b387c 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -493,6 +493,7 @@ int main(int argc, char** argv) { eqsf.Close(); Log.Out(Logs::Detail, Logs::World_Server,"Signaling HTTP service to stop..."); http_server.Stop(); + Log.CloseFileLogs(); return 0; } diff --git a/zone/net.cpp b/zone/net.cpp index 7d25c1ff7..5c74d209d 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -479,6 +479,7 @@ int main(int argc, char** argv) { command_deinit(); safe_delete(parse); Log.Out(Logs::Detail, Logs::Zone_Server, "Proper zone shutdown complete."); + Log.CloseFileLogs(); return 0; } @@ -495,6 +496,7 @@ void Shutdown() RunLoops = false; worldserver.Disconnect(); Log.Out(Logs::Detail, Logs::Zone_Server, "Shutting down..."); + Log.CloseFileLogs(); } uint32 NetConnection::GetIP() From 37b544202801898b6dffe30438728920ce9af36b Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:47:36 -0600 Subject: [PATCH 697/707] Cleanup some log entries in world --- world/net.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/world/net.cpp b/world/net.cpp index da77b387c..ade37759e 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -482,16 +482,16 @@ int main(int argc, char** argv) { } Sleep(20); } - Log.Out(Logs::Detail, Logs::World_Server,"World main loop completed."); - Log.Out(Logs::Detail, Logs::World_Server,"Shutting down console connections (if any)."); + Log.Out(Logs::Detail, Logs::World_Server, "World main loop completed."); + Log.Out(Logs::Detail, Logs::World_Server, "Shutting down console connections (if any)."); console_list.KillAll(); - Log.Out(Logs::Detail, Logs::World_Server,"Shutting down zone connections (if any)."); + Log.Out(Logs::Detail, Logs::World_Server, "Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - Log.Out(Logs::Detail, Logs::World_Server,"Zone (TCP) listener stopped."); + Log.Out(Logs::Detail, Logs::World_Server, "Zone (TCP) listener stopped."); tcps.Close(); - Log.Out(Logs::Detail, Logs::World_Server,"Client (UDP) listener stopped."); + Log.Out(Logs::Detail, Logs::World_Server, "Client (UDP) listener stopped."); eqsf.Close(); - Log.Out(Logs::Detail, Logs::World_Server,"Signaling HTTP service to stop..."); + Log.Out(Logs::Detail, Logs::World_Server, "Signaling HTTP service to stop..."); http_server.Stop(); Log.CloseFileLogs(); From ab82fc17025c761b8d13b057cbfd0461696b38b8 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:51:26 -0600 Subject: [PATCH 698/707] Add properl file log closing to queryserv --- queryserv/queryserv.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index b724276e6..485417a0f 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -120,6 +120,7 @@ int main() { timeout_manager.CheckTimeouts(); Sleep(100); } + Log.CloseFileLogs(); } void UpdateWindowTitle(char* iNewTitle) { From cb99f92287a82293cbb15c841676a4eb9f7d5a89 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:52:59 -0600 Subject: [PATCH 699/707] Add properl file log closing to import and UCS --- client_files/import/main.cpp | 2 ++ ucs/ucs.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 67b0c7140..7e12b2fa2 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -60,6 +60,8 @@ int main(int argc, char **argv) { ImportSkillCaps(&database); ImportBaseData(&database); + Log.CloseFileLogs(); + return 0; } diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index e00754370..69a03c84e 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -167,6 +167,8 @@ int main() { CL->CloseAllConnections(); + Log.CloseFileLogs(); + } void UpdateWindowTitle(char* iNewTitle) { From 0cab51b68bd1a8a5f6347be04d3ebef26cf9e1f7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:53:39 -0600 Subject: [PATCH 700/707] Add proper file log closing to eq_launch --- eqlaunch/eqlaunch.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/eqlaunch/eqlaunch.cpp b/eqlaunch/eqlaunch.cpp index db737e9a5..76c9b48d1 100644 --- a/eqlaunch/eqlaunch.cpp +++ b/eqlaunch/eqlaunch.cpp @@ -177,6 +177,8 @@ int main(int argc, char *argv[]) { delete zone->second; } + Log.CloseFileLogs(); + return 0; } From ae5887b915ce5096f94ab159a9ae335aa7be57a3 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:54:12 -0600 Subject: [PATCH 701/707] Add proper file log closing to shared_memory --- shared_memory/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index bddf03b06..3ea29c47b 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -174,5 +174,7 @@ int main(int argc, char **argv) { } } + Log.CloseFileLogs(); + return 0; } From 43a9a4742c5d0d74a12d7a32bf92bad766115110 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 18:54:40 -0600 Subject: [PATCH 702/707] Add proper file log closing to export --- client_files/export/main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index f950907ac..10c4e0ca9 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -63,6 +63,8 @@ int main(int argc, char **argv) { ExportSkillCaps(&database); ExportBaseData(&database); + Log.CloseFileLogs(); + return 0; } From 46010fbfdf4bead4715b72fad19e0f8ea27f5927 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 19:04:13 -0600 Subject: [PATCH 703/707] Rename LoadLogSysSettings to LoadLogSettings --- client_files/export/main.cpp | 2 +- client_files/import/main.cpp | 2 +- common/database.cpp | 2 +- common/database.h | 2 +- queryserv/database.cpp | 2 +- queryserv/database.h | 2 +- queryserv/queryserv.cpp | 2 +- shared_memory/main.cpp | 2 +- ucs/database.cpp | 2 +- ucs/database.h | 2 +- ucs/ucs.cpp | 2 +- world/net.cpp | 2 +- world/zoneserver.cpp | 2 +- zone/net.cpp | 2 +- zone/worldserver.cpp | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/client_files/export/main.cpp b/client_files/export/main.cpp index 10c4e0ca9..865fbd6d8 100644 --- a/client_files/export/main.cpp +++ b/client_files/export/main.cpp @@ -56,7 +56,7 @@ int main(int argc, char **argv) { } /* Register Log System and Settings */ - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); ExportSpells(&database); diff --git a/client_files/import/main.cpp b/client_files/import/main.cpp index 7e12b2fa2..a8477f77a 100644 --- a/client_files/import/main.cpp +++ b/client_files/import/main.cpp @@ -53,7 +53,7 @@ int main(int argc, char **argv) { return 1; } - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); ImportSpells(&database); diff --git a/common/database.cpp b/common/database.cpp index 129fa2859..e336de437 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -4159,7 +4159,7 @@ uint32 Database::GetGuildIDByCharID(uint32 char_id) return atoi(row[0]); } -void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ +void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){ std::string query = "SELECT " "log_category_id, " diff --git a/common/database.h b/common/database.h index e6515c5f6..8bea5b83c 100644 --- a/common/database.h +++ b/common/database.h @@ -646,7 +646,7 @@ public: void AddReport(std::string who, std::string against, std::string lines); /* EQEmuLogSys */ - void LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings); + void LoadLogSettings(EQEmuLogSys::LogSettings* log_settings); private: void DBInitVars(); diff --git a/queryserv/database.cpp b/queryserv/database.cpp index 1a97ecfc2..e788c801c 100644 --- a/queryserv/database.cpp +++ b/queryserv/database.cpp @@ -364,7 +364,7 @@ void Database::GeneralQueryReceive(ServerPacket *pack) { safe_delete(queryBuffer); } -void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ +void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){ std::string query = "SELECT " "log_category_id, " diff --git a/queryserv/database.h b/queryserv/database.h index 898e300c4..b2d32341b 100644 --- a/queryserv/database.h +++ b/queryserv/database.h @@ -52,7 +52,7 @@ public: void LogMerchantTransaction(QSMerchantLogTransaction_Struct* QS, uint32 Items); void GeneralQueryReceive(ServerPacket *pack); - void LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings); + void LoadLogSettings(EQEmuLogSys::LogSettings* log_settings); protected: void HandleMysqlError(uint32 errnum); diff --git a/queryserv/queryserv.cpp b/queryserv/queryserv.cpp index 485417a0f..4ce00ed4b 100644 --- a/queryserv/queryserv.cpp +++ b/queryserv/queryserv.cpp @@ -88,7 +88,7 @@ int main() { } /* Register Log System and Settings */ - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); if (signal(SIGINT, CatchSignal) == SIG_ERR) { diff --git a/shared_memory/main.cpp b/shared_memory/main.cpp index 3ea29c47b..2623ccd26 100644 --- a/shared_memory/main.cpp +++ b/shared_memory/main.cpp @@ -58,7 +58,7 @@ int main(int argc, char **argv) { } /* Register Log System and Settings */ - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); bool load_all = true; diff --git a/ucs/database.cpp b/ucs/database.cpp index a295880f2..75be71377 100644 --- a/ucs/database.cpp +++ b/ucs/database.cpp @@ -578,7 +578,7 @@ void Database::GetFriendsAndIgnore(int charID, std::vector &friends } -void Database::LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings){ +void Database::LoadLogSettings(EQEmuLogSys::LogSettings* log_settings){ std::string query = "SELECT " "log_category_id, " diff --git a/ucs/database.h b/ucs/database.h index a8c382982..ade93ef42 100644 --- a/ucs/database.h +++ b/ucs/database.h @@ -58,7 +58,7 @@ public: void AddFriendOrIgnore(int CharID, int Type, std::string Name); void RemoveFriendOrIgnore(int CharID, int Type, std::string Name); void GetFriendsAndIgnore(int CharID, std::vector &Friends, std::vector &Ignorees); - void LoadLogSysSettings(EQEmuLogSys::LogSettings* log_settings); + void LoadLogSettings(EQEmuLogSys::LogSettings* log_settings); protected: diff --git a/ucs/ucs.cpp b/ucs/ucs.cpp index 69a03c84e..b6beeb268 100644 --- a/ucs/ucs.cpp +++ b/ucs/ucs.cpp @@ -98,7 +98,7 @@ int main() { } /* Register Log System and Settings */ - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); char tmp[64]; diff --git a/world/net.cpp b/world/net.cpp index ade37759e..12e3c4a3b 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -184,7 +184,7 @@ int main(int argc, char** argv) { guild_mgr.SetDatabase(&database); /* Register Log System and Settings */ - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); if (argc >= 2) { diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 51c07954e..65c80cac7 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -794,7 +794,7 @@ bool ZoneServer::Process() { } case ServerOP_ReloadLogs: { zoneserver_list.SendPacket(pack); - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); break; } case ServerOP_ReloadRules: { diff --git a/zone/net.cpp b/zone/net.cpp index 5c74d209d..826db4ab8 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -168,7 +168,7 @@ int main(int argc, char** argv) { /* Register Log System and Settings */ Log.OnLogHookCallBackZone(&Zone::GMSayHookCallBackProcess); - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); Log.StartFileLogs(); /* Guilds */ diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index ac5899638..e3cee409b 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -1749,7 +1749,7 @@ void WorldServer::Process() { break; } case ServerOP_ReloadLogs: { - database.LoadLogSysSettings(Log.log_settings); + database.LoadLogSettings(Log.log_settings); break; } case ServerOP_CameraShake: From 9f25b52f9ac4d9f87a0d70ec9002ae12d61861c2 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 19:08:43 -0600 Subject: [PATCH 704/707] Change some zone server Logging to General (Level 1) debugging --- zone/net.cpp | 58 ++++++++++++++++++++++++++-------------------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/zone/net.cpp b/zone/net.cpp index 826db4ab8..dd96f0e17 100644 --- a/zone/net.cpp +++ b/zone/net.cpp @@ -146,7 +146,7 @@ int main(int argc, char** argv) { worldserver.SetLauncherName("NONE"); } - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading server configuration.."); + Log.Out(Logs::General, Logs::Zone_Server, "Loading server configuration.."); if (!ZoneConfig::LoadConfig()) { Log.Out(Logs::General, Logs::Error, "Loading server configuration failed."); return 1; @@ -155,7 +155,7 @@ int main(int argc, char** argv) { worldserver.SetPassword(Config->SharedKey.c_str()); - Log.Out(Logs::Detail, Logs::Zone_Server, "Connecting to MySQL..."); + Log.Out(Logs::General, Logs::Zone_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), @@ -179,7 +179,7 @@ int main(int argc, char** argv) { _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif - Log.Out(Logs::Detail, Logs::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.Out(Logs::General, Logs::Zone_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); /* * Setup nice signal handlers @@ -199,85 +199,85 @@ int main(int argc, char** argv) { } #endif - Log.Out(Logs::Detail, Logs::Zone_Server, "Mapping Incoming Opcodes"); + Log.Out(Logs::General, Logs::Zone_Server, "Mapping Incoming Opcodes"); MapOpcodes(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading Variables"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading Variables"); database.LoadVariables(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading zone names"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading zone names"); database.LoadZoneNames(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading items"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading items"); if (!database.LoadItems()) { Log.Out(Logs::General, Logs::Error, "Loading items FAILED!"); Log.Out(Logs::General, Logs::Error, "Failed. But ignoring error and going on..."); } - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading npc faction lists"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading npc faction lists"); if (!database.LoadNPCFactionLists()) { Log.Out(Logs::General, Logs::Error, "Loading npcs faction lists FAILED!"); return 1; } - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading loot tables"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading loot tables"); if (!database.LoadLoot()) { Log.Out(Logs::General, Logs::Error, "Loading loot FAILED!"); return 1; } - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading skill caps"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading skill caps"); if (!database.LoadSkillCaps()) { Log.Out(Logs::General, Logs::Error, "Loading skill caps FAILED!"); return 1; } - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading spells"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading spells"); EQEmu::MemoryMappedFile *mmf = nullptr; LoadSpells(&mmf); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading base data"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading base data"); if (!database.LoadBaseData()) { Log.Out(Logs::General, Logs::Error, "Loading base data FAILED!"); return 1; } - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading guilds"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading guilds"); guild_mgr.LoadGuilds(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading factions"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading factions"); database.LoadFactionData(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading titles"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading titles"); title_manager.LoadTitles(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading AA effects"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading AA effects"); database.LoadAAEffects(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading tributes"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading tributes"); database.LoadTributes(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading corpse timers"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading corpse timers"); database.GetDecayTimes(npcCorpseDecayTimes); - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading commands"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading commands"); int retval=command_init(); if(retval<0) Log.Out(Logs::General, Logs::Error, "Command loading FAILED"); else - Log.Out(Logs::Detail, Logs::Zone_Server, "%d commands loaded", retval); + Log.Out(Logs::General, Logs::Zone_Server, "%d commands loaded", retval); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::General, Logs::Zone_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { Log.Out(Logs::General, Logs::Error, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.Out(Logs::Detail, Logs::Zone_Server, "No rule set configured, using default rules"); + Log.Out(Logs::General, Logs::Zone_Server, "No rule set configured, using default rules"); } else { - Log.Out(Logs::Detail, Logs::Zone_Server, "Loaded default rule set 'default'", tmp); + Log.Out(Logs::General, Logs::Zone_Server, "Loaded default rule set 'default'", tmp); } } } @@ -300,7 +300,7 @@ int main(int argc, char** argv) { #endif //now we have our parser, load the quests - Log.Out(Logs::Detail, Logs::Zone_Server, "Loading quests"); + Log.Out(Logs::General, Logs::Zone_Server, "Loading quests"); parse->ReloadQuests(); if (!worldserver.Connect()) { @@ -315,7 +315,7 @@ int main(int argc, char** argv) { #endif #endif if (!strlen(zone_name) || !strcmp(zone_name,".")) { - Log.Out(Logs::Detail, Logs::Zone_Server, "Entering sleep mode"); + Log.Out(Logs::General, Logs::Zone_Server, "Entering sleep mode"); } else if (!Zone::Bootup(database.GetZoneID(zone_name), 0, true)) { //todo: go above and fix this to allow cmd line instance Log.Out(Logs::General, Logs::Error, "Zone Bootup failed :: Zone::Bootup"); zone = 0; @@ -347,7 +347,7 @@ int main(int argc, char** argv) { worldserver.Process(); if (!eqsf.IsOpen() && Config->ZonePort!=0) { - Log.Out(Logs::Detail, Logs::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); + Log.Out(Logs::General, Logs::Zone_Server, "Starting EQ Network server on port %d",Config->ZonePort); if (!eqsf.Open(Config->ZonePort)) { Log.Out(Logs::General, Logs::Error, "Failed to open port %d",Config->ZonePort); ZoneConfig::SetZonePort(0); @@ -478,14 +478,14 @@ int main(int argc, char** argv) { safe_delete(taskmanager); command_deinit(); safe_delete(parse); - Log.Out(Logs::Detail, Logs::Zone_Server, "Proper zone shutdown complete."); + Log.Out(Logs::General, Logs::Zone_Server, "Proper zone shutdown complete."); Log.CloseFileLogs(); return 0; } void CatchSignal(int sig_num) { #ifdef _WINDOWS - Log.Out(Logs::Detail, Logs::Zone_Server, "Recieved signal: %i", sig_num); + Log.Out(Logs::General, Logs::Zone_Server, "Recieved signal: %i", sig_num); #endif RunLoops = false; } @@ -495,7 +495,7 @@ void Shutdown() Zone::Shutdown(true); RunLoops = false; worldserver.Disconnect(); - Log.Out(Logs::Detail, Logs::Zone_Server, "Shutting down..."); + Log.Out(Logs::General, Logs::Zone_Server, "Shutting down..."); Log.CloseFileLogs(); } From e1bfbfa30c486f452e2e6f1610ff65637654fbcb Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 19:15:36 -0600 Subject: [PATCH 705/707] Change some world server Logging to General (Level 1) debugging --- world/net.cpp | 112 +++++++++++++++++++++++++------------------------- 1 file changed, 56 insertions(+), 56 deletions(-) diff --git a/world/net.cpp b/world/net.cpp index 12e3c4a3b..b775685f5 100644 --- a/world/net.cpp +++ b/world/net.cpp @@ -126,30 +126,30 @@ int main(int argc, char** argv) { } // Load server configuration - Log.Out(Logs::Detail, Logs::World_Server, "Loading server configuration.."); + Log.Out(Logs::General, Logs::World_Server, "Loading server configuration.."); if (!WorldConfig::LoadConfig()) { - Log.Out(Logs::Detail, Logs::World_Server, "Loading server configuration failed."); + Log.Out(Logs::General, Logs::World_Server, "Loading server configuration failed."); return 1; } const WorldConfig *Config=WorldConfig::get(); - Log.Out(Logs::Detail, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); + Log.Out(Logs::General, Logs::World_Server, "CURRENT_VERSION: %s", CURRENT_VERSION); #ifdef _DEBUG _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); #endif if (signal(SIGINT, CatchSignal) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::World_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::World_Server, "Could not set signal handler"); return 1; } if (signal(SIGTERM, CatchSignal) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::World_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::World_Server, "Could not set signal handler"); return 1; } #ifndef WIN32 if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) { - Log.Out(Logs::Detail, Logs::World_Server, "Could not set signal handler"); + Log.Out(Logs::General, Logs::World_Server, "Could not set signal handler"); return 1; } #endif @@ -158,7 +158,7 @@ int main(int argc, char** argv) { if (Config->LoginCount == 0) { if (Config->LoginHost.length()) { loginserverlist.Add(Config->LoginHost.c_str(), Config->LoginPort, Config->LoginAccount.c_str(), Config->LoginPassword.c_str()); - Log.Out(Logs::Detail, Logs::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); + Log.Out(Logs::General, Logs::World_Server, "Added loginserver %s:%i", Config->LoginHost.c_str(), Config->LoginPort); } } else { LinkedList loginlist=Config->loginlist; @@ -166,19 +166,19 @@ int main(int argc, char** argv) { iterator.Reset(); while(iterator.MoreElements()) { loginserverlist.Add(iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort, iterator.GetData()->LoginAccount.c_str(), iterator.GetData()->LoginPassword.c_str()); - Log.Out(Logs::Detail, Logs::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); + Log.Out(Logs::General, Logs::World_Server, "Added loginserver %s:%i", iterator.GetData()->LoginHost.c_str(), iterator.GetData()->LoginPort); iterator.Advance(); } } - Log.Out(Logs::Detail, Logs::World_Server, "Connecting to MySQL..."); + Log.Out(Logs::General, Logs::World_Server, "Connecting to MySQL..."); if (!database.Connect( Config->DatabaseHost.c_str(), Config->DatabaseUsername.c_str(), Config->DatabasePassword.c_str(), Config->DatabaseDB.c_str(), Config->DatabasePort)) { - Log.Out(Logs::Detail, Logs::World_Server, "Cannot continue without a database connection."); + Log.Out(Logs::General, Logs::World_Server, "Cannot continue without a database connection."); return 1; } guild_mgr.SetDatabase(&database); @@ -278,56 +278,56 @@ int main(int argc, char** argv) { } if(Config->WorldHTTPEnabled) { - Log.Out(Logs::Detail, Logs::World_Server, "Starting HTTP world service..."); + Log.Out(Logs::General, Logs::World_Server, "Starting HTTP world service..."); http_server.Start(Config->WorldHTTPPort, Config->WorldHTTPMimeFile.c_str()); } else { - Log.Out(Logs::Detail, Logs::World_Server, "HTTP world service disabled."); + Log.Out(Logs::General, Logs::World_Server, "HTTP world service disabled."); } - Log.Out(Logs::Detail, Logs::World_Server, "Checking Database Conversions.."); + Log.Out(Logs::General, Logs::World_Server, "Checking Database Conversions.."); database.CheckDatabaseConversions(); - Log.Out(Logs::Detail, Logs::World_Server, "Loading variables.."); + Log.Out(Logs::General, Logs::World_Server, "Loading variables.."); database.LoadVariables(); - Log.Out(Logs::Detail, Logs::World_Server, "Loading zones.."); + Log.Out(Logs::General, Logs::World_Server, "Loading zones.."); database.LoadZoneNames(); - Log.Out(Logs::Detail, Logs::World_Server, "Clearing groups.."); + Log.Out(Logs::General, Logs::World_Server, "Clearing groups.."); database.ClearGroup(); - Log.Out(Logs::Detail, Logs::World_Server, "Clearing raids.."); + Log.Out(Logs::General, Logs::World_Server, "Clearing raids.."); database.ClearRaid(); database.ClearRaidDetails(); database.ClearRaidLeader(); - Log.Out(Logs::Detail, Logs::World_Server, "Loading items.."); + Log.Out(Logs::General, Logs::World_Server, "Loading items.."); if (!database.LoadItems()) - Log.Out(Logs::Detail, Logs::World_Server, "Error: Could not load item data. But ignoring"); - Log.Out(Logs::Detail, Logs::World_Server, "Loading skill caps.."); + Log.Out(Logs::General, Logs::World_Server, "Error: Could not load item data. But ignoring"); + Log.Out(Logs::General, Logs::World_Server, "Loading skill caps.."); if (!database.LoadSkillCaps()) - Log.Out(Logs::Detail, Logs::World_Server, "Error: Could not load skill cap data. But ignoring"); - Log.Out(Logs::Detail, Logs::World_Server, "Loading guilds.."); + Log.Out(Logs::General, Logs::World_Server, "Error: Could not load skill cap data. But ignoring"); + Log.Out(Logs::General, Logs::World_Server, "Loading guilds.."); guild_mgr.LoadGuilds(); //rules: { char tmp[64]; if (database.GetVariable("RuleSet", tmp, sizeof(tmp)-1)) { - Log.Out(Logs::Detail, Logs::World_Server, "Loading rule set '%s'", tmp); + Log.Out(Logs::General, Logs::World_Server, "Loading rule set '%s'", tmp); if(!RuleManager::Instance()->LoadRules(&database, tmp)) { - Log.Out(Logs::Detail, Logs::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); + Log.Out(Logs::General, Logs::World_Server, "Failed to load ruleset '%s', falling back to defaults.", tmp); } } else { if(!RuleManager::Instance()->LoadRules(&database, "default")) { - Log.Out(Logs::Detail, Logs::World_Server, "No rule set configured, using default rules"); + Log.Out(Logs::General, Logs::World_Server, "No rule set configured, using default rules"); } else { - Log.Out(Logs::Detail, Logs::World_Server, "Loaded default rule set 'default'", tmp); + Log.Out(Logs::General, Logs::World_Server, "Loaded default rule set 'default'", tmp); } } } if(RuleB(World, ClearTempMerchantlist)){ - Log.Out(Logs::Detail, Logs::World_Server, "Clearing temporary merchant lists.."); + Log.Out(Logs::General, Logs::World_Server, "Clearing temporary merchant lists.."); database.ClearMerchantTemp(); } - Log.Out(Logs::Detail, Logs::World_Server, "Loading EQ time of day.."); + Log.Out(Logs::General, Logs::World_Server, "Loading EQ time of day.."); if (!zoneserver_list.worldclock.loadFile(Config->EQTimeFile.c_str())) - Log.Out(Logs::Detail, Logs::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); - Log.Out(Logs::Detail, Logs::World_Server, "Loading launcher list.."); + Log.Out(Logs::General, Logs::World_Server, "Unable to load %s", Config->EQTimeFile.c_str()); + Log.Out(Logs::General, Logs::World_Server, "Loading launcher list.."); launcher_list.LoadList(); char tmp[20]; @@ -336,45 +336,45 @@ int main(int argc, char** argv) { if ((strcasecmp(tmp, "1") == 0)) { holdzones = true; } - Log.Out(Logs::Detail, Logs::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); + Log.Out(Logs::General, Logs::World_Server, "Reboot zone modes %s",holdzones ? "ON" : "OFF"); - Log.Out(Logs::Detail, Logs::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); + Log.Out(Logs::General, Logs::World_Server, "Deleted %i stale player corpses from database", database.DeleteStalePlayerCorpses()); - Log.Out(Logs::Detail, Logs::World_Server, "Loading adventures..."); + Log.Out(Logs::General, Logs::World_Server, "Loading adventures..."); if(!adventure_manager.LoadAdventureTemplates()) { - Log.Out(Logs::Detail, Logs::World_Server, "Unable to load adventure templates."); + Log.Out(Logs::General, Logs::World_Server, "Unable to load adventure templates."); } if(!adventure_manager.LoadAdventureEntries()) { - Log.Out(Logs::Detail, Logs::World_Server, "Unable to load adventure templates."); + Log.Out(Logs::General, Logs::World_Server, "Unable to load adventure templates."); } adventure_manager.Load(); adventure_manager.LoadLeaderboardInfo(); - Log.Out(Logs::Detail, Logs::World_Server, "Purging expired instances"); + Log.Out(Logs::General, Logs::World_Server, "Purging expired instances"); database.PurgeExpiredInstances(); Timer PurgeInstanceTimer(450000); PurgeInstanceTimer.Start(450000); - Log.Out(Logs::Detail, Logs::World_Server, "Loading char create info..."); + Log.Out(Logs::General, Logs::World_Server, "Loading char create info..."); database.LoadCharacterCreateAllocations(); database.LoadCharacterCreateCombos(); char errbuf[TCPConnection_ErrorBufferSize]; if (tcps.Open(Config->WorldTCPPort, errbuf)) { - Log.Out(Logs::Detail, Logs::World_Server,"Zone (TCP) listener started."); + Log.Out(Logs::General, Logs::World_Server,"Zone (TCP) listener started."); } else { - Log.Out(Logs::Detail, Logs::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); - Log.Out(Logs::Detail, Logs::World_Server," %s",errbuf); + Log.Out(Logs::General, Logs::World_Server,"Failed to start zone (TCP) listener on port %d:",Config->WorldTCPPort); + Log.Out(Logs::General, Logs::World_Server," %s",errbuf); return 1; } if (eqsf.Open()) { - Log.Out(Logs::Detail, Logs::World_Server,"Client (UDP) listener started."); + Log.Out(Logs::General, Logs::World_Server,"Client (UDP) listener started."); } else { - Log.Out(Logs::Detail, Logs::World_Server,"Failed to start client (UDP) listener (port 9000)"); + Log.Out(Logs::General, Logs::World_Server,"Failed to start client (UDP) listener (port 9000)"); return 1; } @@ -402,7 +402,7 @@ int main(int argc, char** argv) { //structures and opcodes for that patch. struct in_addr in; in.s_addr = eqs->GetRemoteIP(); - Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); + Log.Out(Logs::General, Logs::World_Server, "New connection from %s:%d", inet_ntoa(in),ntohs(eqs->GetRemotePort())); stream_identifier.AddStream(eqs); //takes the stream } @@ -415,19 +415,19 @@ int main(int argc, char** argv) { struct in_addr in; in.s_addr = eqsi->GetRemoteIP(); if (RuleB(World, UseBannedIPsTable)){ //Lieka: Check to see if we have the responsibility for blocking IPs. - Log.Out(Logs::Detail, Logs::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); + Log.Out(Logs::General, Logs::World_Server, "Checking inbound connection %s against BannedIPs table", inet_ntoa(in)); if (!database.CheckBannedIPs(inet_ntoa(in))){ //Lieka: Check inbound IP against banned IP table. - Log.Out(Logs::Detail, Logs::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); + Log.Out(Logs::General, Logs::World_Server, "Connection %s PASSED banned IPs check. Processing connection.", inet_ntoa(in)); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); } else { - Log.Out(Logs::Detail, Logs::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); + Log.Out(Logs::General, Logs::World_Server, "Connection from %s FAILED banned IPs check. Closing connection.", inet_ntoa(in)); eqsi->Close(); //Lieka: If the inbound IP is on the banned table, close the EQStream. } } if (!RuleB(World, UseBannedIPsTable)){ - Log.Out(Logs::Detail, Logs::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); + Log.Out(Logs::General, Logs::World_Server, "New connection from %s:%d, processing connection", inet_ntoa(in), ntohs(eqsi->GetRemotePort())); auto client = new Client(eqsi); // @merth: client->zoneattempt=0; client_list.Add(client); @@ -439,7 +439,7 @@ int main(int argc, char** argv) { while ((tcpc = tcps.NewQueuePop())) { struct in_addr in; in.s_addr = tcpc->GetrIP(); - Log.Out(Logs::Detail, Logs::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); + Log.Out(Logs::General, Logs::World_Server, "New TCP connection from %s:%d", inet_ntoa(in),tcpc->GetrPort()); console_list.Add(new Console(tcpc)); } @@ -482,16 +482,16 @@ int main(int argc, char** argv) { } Sleep(20); } - Log.Out(Logs::Detail, Logs::World_Server, "World main loop completed."); - Log.Out(Logs::Detail, Logs::World_Server, "Shutting down console connections (if any)."); + Log.Out(Logs::General, Logs::World_Server, "World main loop completed."); + Log.Out(Logs::General, Logs::World_Server, "Shutting down console connections (if any)."); console_list.KillAll(); - Log.Out(Logs::Detail, Logs::World_Server, "Shutting down zone connections (if any)."); + Log.Out(Logs::General, Logs::World_Server, "Shutting down zone connections (if any)."); zoneserver_list.KillAll(); - Log.Out(Logs::Detail, Logs::World_Server, "Zone (TCP) listener stopped."); + Log.Out(Logs::General, Logs::World_Server, "Zone (TCP) listener stopped."); tcps.Close(); - Log.Out(Logs::Detail, Logs::World_Server, "Client (UDP) listener stopped."); + Log.Out(Logs::General, Logs::World_Server, "Client (UDP) listener stopped."); eqsf.Close(); - Log.Out(Logs::Detail, Logs::World_Server, "Signaling HTTP service to stop..."); + Log.Out(Logs::General, Logs::World_Server, "Signaling HTTP service to stop..."); http_server.Stop(); Log.CloseFileLogs(); @@ -499,9 +499,9 @@ int main(int argc, char** argv) { } void CatchSignal(int sig_num) { - Log.Out(Logs::Detail, Logs::World_Server,"Caught signal %d",sig_num); + Log.Out(Logs::General, Logs::World_Server,"Caught signal %d",sig_num); if(zoneserver_list.worldclock.saveFile(WorldConfig::get()->EQTimeFile.c_str())==false) - Log.Out(Logs::Detail, Logs::World_Server,"Failed to save time file."); + Log.Out(Logs::General, Logs::World_Server,"Failed to save time file."); RunLoops = false; } From 376bba5156946318d6a5cf1c684c2e704a6d82a9 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 19:37:54 -0600 Subject: [PATCH 706/707] Some log changes --- common/eqemu_logsys.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/eqemu_logsys.cpp b/common/eqemu_logsys.cpp index d31744cd1..2613cbe5b 100644 --- a/common/eqemu_logsys.cpp +++ b/common/eqemu_logsys.cpp @@ -326,7 +326,7 @@ void EQEmuLogSys::StartFileLogs(const std::string log_name) return; } - std::cout << "Starting Zone Logs..." << std::endl; + EQEmuLogSys::Out(Logs::General, Logs::Status, "Starting File Log 'logs/%s_%i.txt'", platform_file_name.c_str(), getpid()); EQEmuLogSys::MakeDirectory("logs/zone"); process_log.open(StringFormat("logs/zone/%s_%i.txt", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } @@ -334,7 +334,7 @@ void EQEmuLogSys::StartFileLogs(const std::string log_name) if (platform_file_name == ""){ return; } - std::cout << "Starting Process Log (" << platform_file_name << ")..." << std::endl; + EQEmuLogSys::Out(Logs::General, Logs::Status, "Starting File Log 'logs/%s_%i.txt'", platform_file_name.c_str(), getpid()); process_log.open(StringFormat("logs/%s_%i.txt", platform_file_name.c_str(), getpid()), std::ios_base::app | std::ios_base::out); } } \ No newline at end of file From b4ff915cbbd0c77cd7a95ca103e486dc417e6cf7 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Wed, 21 Jan 2015 19:39:51 -0600 Subject: [PATCH 707/707] Change zone file log name format once it boots up --- zone/zone.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zone/zone.cpp b/zone/zone.cpp index 9c92b63f0..2cb78b302 100644 --- a/zone/zone.cpp +++ b/zone/zone.cpp @@ -151,7 +151,7 @@ bool Zone::Bootup(uint32 iZoneID, uint32 iInstanceID, bool iStaticZone) { /* Set Logging */ - Log.StartFileLogs(StringFormat("%s_ver-%u_instid-%u_port-%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); + Log.StartFileLogs(StringFormat("%s_version_%u_inst_id_%u_port_%u", zone->GetShortName(), zone->GetInstanceVersion(), zone->GetInstanceID(), ZoneConfig::get()->ZonePort)); return true; }