aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver
diff options
context:
space:
mode:
authorSubv <s.v.h21@hotmail.com>2012-08-07 13:44:22 -0500
committerSubv <s.v.h21@hotmail.com>2012-08-07 13:44:22 -0500
commitd82266bc0ef31df82dc67c1023d6208df6ac247b (patch)
treea0c5970a82e568ca54a25809555b7abad52e1bc1 /src/server/worldserver
parent224cf663e2af8b355b4bdca4069080636321b0ba (diff)
parentf8cd39b2ed1056f409c2690ac8bb661fbcb68e18 (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
Conflicts: src/server/authserver/Server/AuthSocket.cpp src/server/game/Achievements/AchievementMgr.cpp src/server/game/Chat/Chat.h src/server/game/Chat/Commands/Level1.cpp src/server/game/Chat/Commands/Level2.cpp src/server/game/Chat/Commands/Level3.cpp src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCStructure.h src/server/game/Entities/Object/Object.cpp src/server/game/Entities/Object/Updates/UpdateData.cpp src/server/game/Entities/Player/Player.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Guilds/Guild.cpp src/server/game/Guilds/GuildMgr.cpp src/server/game/Handlers/AuctionHouseHandler.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/ChatHandler.cpp src/server/game/Handlers/GroupHandler.cpp src/server/game/Handlers/ItemHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Handlers/MiscHandler.cpp src/server/game/Handlers/MovementHandler.cpp src/server/game/Handlers/PetHandler.cpp src/server/game/Handlers/QuestHandler.cpp src/server/game/Handlers/VehicleHandler.cpp src/server/game/Server/WorldSession.cpp src/server/game/Server/WorldSocket.cpp src/server/game/Spells/Auras/SpellAuraEffects.cpp src/server/game/Spells/SpellEffects.cpp src/server/game/Spells/SpellMgr.cpp src/server/game/World/World.cpp src/server/scripts/Commands/cs_debug.cpp src/server/scripts/Commands/cs_modify.cpp src/server/scripts/Commands/cs_reload.cpp src/server/scripts/Kalimdor/azuremyst_isle.cpp src/server/shared/Logging/Log.cpp src/server/shared/Logging/Log.h src/server/worldserver/worldserver.conf.dist
Diffstat (limited to 'src/server/worldserver')
-rw-r--r--src/server/worldserver/CMakeLists.txt1
-rwxr-xr-xsrc/server/worldserver/CommandLine/CliRunnable.cpp2
-rwxr-xr-xsrc/server/worldserver/Main.cpp22
-rwxr-xr-xsrc/server/worldserver/Master.cpp86
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp6
-rwxr-xr-xsrc/server/worldserver/RemoteAccess/RASocket.cpp30
-rwxr-xr-xsrc/server/worldserver/TCSoap/TCSoap.cpp6
-rw-r--r--src/server/worldserver/worldserver.conf.dist513
8 files changed, 263 insertions, 403 deletions
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index 0d51f30449e..eb5bb04d766 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -80,7 +80,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Calendar
${CMAKE_SOURCE_DIR}/src/server/game/Chat
${CMAKE_SOURCE_DIR}/src/server/game/Chat/Channels
- ${CMAKE_SOURCE_DIR}/src/server/game/Chat/Commands
${CMAKE_SOURCE_DIR}/src/server/game/Combat
${CMAKE_SOURCE_DIR}/src/server/game/Conditions
${CMAKE_SOURCE_DIR}/src/server/game/DataStores
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 699e7cad97c..23eeca11f66 100755
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -135,7 +135,7 @@ int kb_hit_return()
void CliRunnable::run()
{
///- Display the list of available CLI functions then beep
- //sLog->outString("");
+ //sLog->outInfo(LOG_FILTER_WORLDSERVER, "");
#if PLATFORM != PLATFORM_WINDOWS
rl_attempted_completion_function = cli_completion;
rl_event_hook = cli_hook_func;
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index 04820f59355..862ed28f2d3 100755
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -58,7 +58,7 @@ uint32 realmID; ///< Id of the realm
/// Print out the usage string for this program on the console.
void usage(const char *prog)
{
- sLog->outString("Usage: \n %s [<options>]\n"
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Usage: \n %s [<options>]\n"
" -c config_file use config_file as configuration file\n\r"
#ifdef _WIN32
" Running as service functions:\n\r"
@@ -81,7 +81,7 @@ extern int main(int argc, char **argv)
{
if (++c >= argc)
{
- sLog->outError("Runtime-Error: -c option requires an input argument");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Runtime-Error: -c option requires an input argument");
usage(argv[0]);
return 1;
}
@@ -97,25 +97,25 @@ extern int main(int argc, char **argv)
{
if (++c >= argc)
{
- sLog->outError("Runtime-Error: -s option requires an input argument");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Runtime-Error: -s option requires an input argument");
usage(argv[0]);
return 1;
}
if (strcmp(argv[c], "install") == 0)
{
if (WinServiceInstall())
- sLog->outString("Installing service");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Installing service");
return 1;
}
else if (strcmp(argv[c], "uninstall") == 0)
{
if (WinServiceUninstall())
- sLog->outString("Uninstalling service");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Uninstalling service");
return 1;
}
else
{
- sLog->outError("Runtime-Error: unsupported option %s", argv[c]);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Runtime-Error: unsupported option %s", argv[c]);
usage(argv[0]);
return 1;
}
@@ -131,14 +131,14 @@ extern int main(int argc, char **argv)
if (!ConfigMgr::Load(cfg_file))
{
- sLog->outError("Invalid or missing configuration file : %s", cfg_file);
- sLog->outError("Verify that the file exists and has \'[worldserver]' written in the top of the file!");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Invalid or missing configuration file : %s", cfg_file);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Verify that the file exists and has \'[worldserver]' written in the top of the file!");
return 1;
}
- sLog->outString("Using configuration file %s.", cfg_file);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using configuration file %s.", cfg_file);
- sLog->outString("Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
- sLog->outString("Using ACE version: %s", ACE_VERSION);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using ACE version: %s", ACE_VERSION);
///- and run the 'Master'
/// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd?
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 03b2859c514..48e07c727b4 100755
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -84,7 +84,7 @@ public:
{
if (!_delaytime)
return;
- sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
m_loops = 0;
w_loops = 0;
m_lastchange = 0;
@@ -102,11 +102,11 @@ public:
// possible freeze
else if (getMSTimeDiff(w_lastchange, curtime) > _delaytime)
{
- sLog->outError("World Thread hangs, kicking out server!");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "World Thread hangs, kicking out server!");
ASSERT(false);
}
}
- sLog->outString("Anti-freeze thread exiting without problems.");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Anti-freeze thread exiting without problems.");
}
};
@@ -124,18 +124,18 @@ int Master::Run()
BigNumber seed1;
seed1.SetRand(16 * 8);
- sLog->outString("%s (worldserver-daemon)", _FULLVERSION);
- sLog->outString("<Ctrl-C> to stop.\n");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "%s (worldserver-daemon)", _FULLVERSION);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "<Ctrl-C> to stop.\n");
- sLog->outString(" ______ __");
- sLog->outString("/\\__ _\\ __ __/\\ \\__");
- sLog->outString("\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
- sLog->outString(" \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
- sLog->outString(" \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
- sLog->outString(" \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
- sLog->outString(" \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
- sLog->outString(" C O R E /\\___/");
- sLog->outString("http://TrinityCore.org \\/__/\n");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " ______ __");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "/\\__ _\\ __ __/\\ \\__");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, " C O R E /\\___/");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "http://TrinityCore.org \\/__/\n");
/// worldserver PID file creation
std::string pidfile = ConfigMgr::GetStringDefault("PidFile", "");
@@ -144,11 +144,11 @@ int Master::Run()
uint32 pid = CreatePIDFile(pidfile);
if (!pid)
{
- sLog->outError("Cannot create PID file %s.\n", pidfile.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot create PID file %s.\n", pidfile.c_str());
return 1;
}
- sLog->outString("Daemon PID: %u\n", pid);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Daemon PID: %u\n", pid);
}
///- Start the databases
@@ -161,13 +161,13 @@ int Master::Run()
///- Initialize the World
sWorld->SetInitialWorldSettings();
- // Initialise the signal handlers
+ ///- Initialize the signal handlers
WorldServerSignalHandler SignalINT, SignalTERM;
#ifdef _WIN32
WorldServerSignalHandler SignalBREAK;
#endif /* _WIN32 */
- // Register worldserver's signal handlers
+ ///- Register worldserver's signal handlers
ACE_Sig_Handler Handler;
Handler.register_handler(SIGINT, &SignalINT);
Handler.register_handler(SIGTERM, &SignalTERM);
@@ -210,17 +210,16 @@ int Master::Run()
if (!curAff)
{
- sLog->outError("Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", Aff, appAff);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", Aff, appAff);
}
else
{
if (SetProcessAffinityMask(hProcess, curAff))
- sLog->outString("Using processors (bitmask, hex): %x", curAff);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", curAff);
else
- sLog->outError("Can't set used processors (hex): %x", curAff);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x", curAff);
}
}
- sLog->outString("");
}
bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false);
@@ -229,10 +228,9 @@ int Master::Run()
if (Prio)
{
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
- sLog->outString("worldserver process priority class set to HIGH");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to HIGH");
else
- sLog->outError("Can't set worldserver process priority class.");
- sLog->outString("");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class.");
}
}
#endif
@@ -250,7 +248,7 @@ int Master::Run()
if (uint32 freeze_delay = ConfigMgr::GetIntDefault("MaxCoreStuckTime", 0))
{
FreezeDetectorRunnable* fdr = new FreezeDetectorRunnable();
- fdr->SetDelayTime(freeze_delay*1000);
+ fdr->SetDelayTime(freeze_delay * 1000);
ACE_Based::Thread freeze_thread(fdr);
freeze_thread.setPriority(ACE_Based::Highest);
}
@@ -259,9 +257,9 @@ int Master::Run()
uint16 wsport = sWorld->getIntConfig(CONFIG_PORT_WORLD);
std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
- if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str ()) == -1)
+ if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str()) == -1)
{
- sLog->outError("Failed to start network");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Failed to start network");
World::StopNow(ERROR_EXIT_CODE);
// go down and shutdown the server
}
@@ -269,7 +267,7 @@ int Master::Run()
// set server online (allow connecting now)
LoginDatabase.DirectPExecute("UPDATE realmlist SET flag = flag & ~%u, population = 0 WHERE id = '%u'", REALM_FLAG_INVALID, realmID);
- sLog->outString("%s (worldserver-daemon) ready...", _FULLVERSION);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "%s (worldserver-daemon) ready...", _FULLVERSION);
// when the main thread closes the singletons get unloaded
// since worldrunnable uses them, it will crash if unloaded after master
@@ -291,7 +289,7 @@ int Master::Run()
_StopDB();
- sLog->outString("Halting process...");
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Halting process...");
if (cliThread)
{
@@ -356,21 +354,20 @@ bool Master::_StartDB()
{
MySQL::Library_Init();
- sLog->SetLogDB(false);
std::string dbstring;
uint8 async_threads, synch_threads;
dbstring = ConfigMgr::GetStringDefault("WorldDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("World database not specified in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "World database not specified in configuration file");
return false;
}
async_threads = ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog->outError("World database: invalid number of worker threads specified. "
+ sLog->outError(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -379,7 +376,7 @@ bool Master::_StartDB()
///- Initialise the world database
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog->outError("Cannot connect to world database %s", dbstring.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot connect to world database %s", dbstring.c_str());
return false;
}
@@ -387,14 +384,14 @@ bool Master::_StartDB()
dbstring = ConfigMgr::GetStringDefault("CharacterDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("Character database not specified in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Character database not specified in configuration file");
return false;
}
async_threads = ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog->outError("Character database: invalid number of worker threads specified. "
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -404,7 +401,7 @@ bool Master::_StartDB()
///- Initialise the Character database
if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog->outError("Cannot connect to Character database %s", dbstring.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot connect to Character database %s", dbstring.c_str());
return false;
}
@@ -412,14 +409,14 @@ bool Master::_StartDB()
dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
- sLog->outError("Login database not specified in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Login database not specified in configuration file");
return false;
}
async_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog->outError("Login database: invalid number of worker threads specified. "
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -428,7 +425,7 @@ bool Master::_StartDB()
///- Initialise the login database
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog->outError("Cannot connect to login database %s", dbstring.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Cannot connect to login database %s", dbstring.c_str());
return false;
}
@@ -436,14 +433,11 @@ bool Master::_StartDB()
realmID = ConfigMgr::GetIntDefault("RealmID", 0);
if (!realmID)
{
- sLog->outError("Realm ID not defined in configuration file");
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Realm ID not defined in configuration file");
return false;
}
- sLog->outString("Realm running as realm ID %d", realmID);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Realm running as realm ID %d", realmID);
- ///- Initialize the DB logging system
- sLog->SetLogDBLater(ConfigMgr::GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished.
- sLog->SetLogDB(false);
sLog->SetRealmID(realmID);
///- Clean the database before starting
@@ -454,7 +448,7 @@ bool Master::_StartDB()
sWorld->LoadDBVersion();
- sLog->outString("Using World DB: %s", sWorld->GetDBVersion());
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Using World DB: %s", sWorld->GetDBVersion());
return true;
}
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp
index 3f5d7bde736..7a1fff51afd 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -67,11 +67,11 @@ void RARunnable::run()
if (acceptor.open(listen_addr, m_Reactor) == -1)
{
- sLog->outError("Trinity RA can not bind to port %d on %s", raport, stringip.c_str());
+ sLog->outError(LOG_FILTER_WORLDSERVER, "Trinity RA can not bind to port %d on %s", raport, stringip.c_str());
return;
}
- sLog->outString("Starting Trinity RA on port %d on %s", raport, stringip.c_str());
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "Starting Trinity RA on port %d on %s", raport, stringip.c_str());
while (!World::IsStopped())
{
@@ -82,5 +82,5 @@ void RARunnable::run()
break;
}
- sLog->outStaticDebug("Trinity RA thread exiting");
+ sLog->outDebug(LOG_FILTER_WORLDSERVER, "Trinity RA thread exiting");
}
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index ebc7c7624d9..18c90aa5ba5 100755
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -45,18 +45,18 @@ int RASocket::open(void *)
if (peer().get_remote_addr(remote_addr) == -1)
{
- sLog->outError("RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
+ sLog->outError(LOG_FILTER_WORLDSERVER, "RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
return -1;
}
- sLog->outRemote("Incoming connection from %s", remote_addr.get_host_addr());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Incoming connection from %s", remote_addr.get_host_addr());
return activate();
}
int RASocket::handle_close(ACE_HANDLE, ACE_Reactor_Mask)
{
- sLog->outRemote("Closing connection");
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Closing connection");
peer().close_reader();
wait();
destroy();
@@ -122,7 +122,7 @@ int RASocket::recv_line(std::string& out_line)
if (recv_line(message_block) == -1)
{
- sLog->outRemote("Recv error %s", ACE_OS::strerror(errno));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Recv error %s", ACE_OS::strerror(errno));
return -1;
}
@@ -136,7 +136,7 @@ int RASocket::process_command(const std::string& command)
if (command.length() == 0)
return 0;
- sLog->outRemote("Got command: %s", command.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Got command: %s", command.c_str());
// handle quit, exit and logout commands to terminate connection
if (command == "quit" || command == "exit" || command == "logout") {
@@ -186,7 +186,7 @@ int RASocket::check_access_level(const std::string& user)
if (!result)
{
- sLog->outRemote("User %s does not exist in database", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User %s does not exist in database", user.c_str());
return -1;
}
@@ -194,12 +194,12 @@ int RASocket::check_access_level(const std::string& user)
if (fields[1].GetUInt8() < _minLevel)
{
- sLog->outRemote("User %s has no privilege to login", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User %s has no privilege to login", user.c_str());
return -1;
}
else if (fields[2].GetInt32() != -1)
{
- sLog->outRemote("User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
return -1;
}
@@ -225,7 +225,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass)
if (!result)
{
- sLog->outRemote("Wrong password for user: %s", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Wrong password for user: %s", user.c_str());
return -1;
}
@@ -248,7 +248,7 @@ int RASocket::authenticate()
if (recv_line(pass) == -1)
return -1;
- sLog->outRemote("Login attempt for user: %s", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Login attempt for user: %s", user.c_str());
if (check_access_level(user) == -1)
return -1;
@@ -256,7 +256,7 @@ int RASocket::authenticate()
if (check_password(user, pass) == -1)
return -1;
- sLog->outRemote("User login: %s", user.c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "User login: %s", user.c_str());
return 0;
}
@@ -290,7 +290,7 @@ int RASocket::subnegotiate()
if (n >= 1024)
{
- sLog->outRemote("RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
return -1;
}
@@ -324,7 +324,7 @@ int RASocket::subnegotiate()
uint8 param = buf[++i];
ss << uint32(param);
- sLog->outRemote(ss.str().c_str());
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, ss.str().c_str());
}
++i;
}
@@ -385,7 +385,7 @@ void RASocket::zprint(void* callbackArg, const char * szText)
if (socket->putq(mb, const_cast<ACE_Time_Value*>(&ACE_Time_Value::zero)) == -1)
{
- sLog->outRemote("Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
mb->release();
}
}
@@ -406,7 +406,7 @@ void RASocket::commandFinished(void* callbackArg, bool /*success*/)
if (socket->putq(mb) == -1)
{
// getting here is bad, command can't be marked as complete
- sLog->outRemote("Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
+ sLog->outDebug(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
mb->release();
}
}
diff --git a/src/server/worldserver/TCSoap/TCSoap.cpp b/src/server/worldserver/TCSoap/TCSoap.cpp
index 26b28b25fbb..3ce4d4f59cb 100755
--- a/src/server/worldserver/TCSoap/TCSoap.cpp
+++ b/src/server/worldserver/TCSoap/TCSoap.cpp
@@ -32,11 +32,11 @@ void TCSoapRunnable::run()
soap.send_timeout = 5;
if (!soap_valid_socket(soap_bind(&soap, m_host.c_str(), m_port, 100)))
{
- sLog->outError("TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "TCSoap: couldn't bind to %s:%d", m_host.c_str(), m_port);
exit(-1);
}
- sLog->outString("TCSoap: bound to http://%s:%d", m_host.c_str(), m_port);
+ sLog->outInfo(LOG_FILTER_WORLDSERVER, "TCSoap: bound to http://%s:%d", m_host.c_str(), m_port);
while (!World::IsStopped())
{
@@ -119,7 +119,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
int acc = connection.pendingCommands.acquire();
if (acc)
{
- sLog->outError("TCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
+ sLog->outError(LOG_FILTER_WORLDSERVER, "TCSoap: Error while acquiring lock, acc = %i, errno = %u", acc, errno);
}
// alright, command finished
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index 71ec75ea678..477b3065dee 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -404,320 +404,6 @@ PersistentCharacterCleanFlags = 0
PidFile = ""
#
-# LogLevel
-# Description: Server console level of logging
-# Default: 1 - (Basic)
-# 0 - (Minimum)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-LogLevel = 1
-
-#
-# LogFile
-# Description: Log file for main server log.
-# Default: "Server.log" - (Enabled)
-# "" - (Disabled)
-
-LogFile = "Server.log"
-
-#
-# LogTimestamp
-# Description: Append timestamp to the server log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogTimestamp = 0
-
-#
-# LogFileLevel
-# Description: Server file level of logging
-# Default: 0 - (Minimum)
-# 1 - (Basic)
-# 2 - (Detail)
-# 3 - (Full/Debug)
-
-LogFileLevel = 0
-
-#
-# Debug Log Mask
-# Description: Bitmask that determines which debug log output (level 3)
-# will be logged.
-# Possible flags:
-# 1 - Anything related to units that doesn't fit in other
-# categories.
-# 2 - Anything related to pets.
-# 4 - Anything related to vehicles.
-# 8 - Anything related to C++ AI, instance scripts, etc.
-# 16 - Anything related to DB AI, such as SAI, EAI, CreatureAI
-# 32 - Anything related to DB map scripts
-# 64 - Anything related to network input/output,
-# such as packet handlers and netcode logs
-# 128 - Anything related to the spellsystem and aurasystem
-# 256 - Anything related to the achievement system
-# 512 - Anything related to the condition system
-# 1024 - Anything related to the pool system
-# 2048 - Anything related to the auction house
-# 4096 - Anything related to arena's and battlegrounds
-# 8192 - Anything related to outdoor PVP
-# 16384 - Anything related to the chat system
-# 32768 - Anything related to the LFG system
-# 65536 - Anything related to maps, instances (not scripts),
-# grids, cells, visibility, etc.
-# 131072 - Anything related to player loading from DB
-# (Player::_LoadXXX functions)
-# 262144 - Anything related to items
-# 524288 - Anything related to player skills
-# (do not confuse with spells)
-# 1048576 - Anything related to loot
-# 2097152 - Anything related to guilds
-# 4194304 - Anything related to transports
-# 8388608 - Anything related to Warden anti cheat
-# 16777216 - Incoming/outgoing Opcodes
-#
-# Simply add the values together to create a bitmask.
-# For more info see enum DebugLogFilters in Log.h
-#
-# Default: 0 (nothing)
-
-DebugLogMask = 0
-
-#
-# PacketLogFile
-# Description: Binary packet logging file for the world server.
-# Filename extension must be .bin to be parsable with WowPacketParser.
-# Example: "World.bin" - (Enabled)
-# Default: "" - (Disabled)
-
-PacketLogFile = ""
-
-#
-# DBErrorLogFile
-# Description: Log file for database errors.
-# Default: "DBErrors.log" - (Enabled)
-# "" - (Disabled)
-
-DBErrorLogFile = "DBErrors.log"
-
-#
-# CharLogFile
-# Description: Log file for character operations
-# Default: "Char.log" - (Enabled)
-# "" - (Disabled)
-
-CharLogFile = "Char.log"
-
-#
-# CharLogTimestamp
-# Description: Append timestamp to the character log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-CharLogTimestamp = 0
-
-#
-# CharLogDump
-# Description: Write a character dump in the CharLogFile before deleting it.
-# For restoration, copy character data from log file starting from
-# line == START DUMP == to line == END DUMP == (exclusive)
-# and load it using the "pdump load" command.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-CharLogDump = 0
-
-#
-# CharLogDump.Separate
-# Description: Write character dump to separate files files rather than adding it to the
-# CharLogFile.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-CharLogDump.Separate = 0
-
-#
-# CharLogDump.SeparateDir
-# Description: Write dump files into the sub folder within the log folder.
-# Example: "chardumps" - (Enabled)
-# Default: "" - (Disabled)
-
-CharLogDump.SeparateDir = ""
-
-#
-# GmLogFile
-# Description: Log file for gamemaster commands.
-# Default: "GM.log" - (Enabled)
-# "" - (Disabled)
-
-GmLogFile = "GM.log"
-
-#
-# GmLogTimestamp
-# Description: Append timestamp to the gamemaster log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-GmLogTimestamp = 0
-
-#
-# GmLogPerAccount
-# Description: Create a log file per gamemaster account.
-# Important: Logs not created if GmLogFile is not set.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-GmLogPerAccount = 0
-
-#
-# RaLogFile
-# Description: Log file for Remote Access commands.
-# Default: "RA.log" - (Enabled)
-# "" - (Disabled)
-
-RaLogFile = "RA.log"
-
-#
-# ArenaLogFile
-# Description: Log file for arena fights and arena team creations.
-# Example: "Arena.log" - (Enabled)
-# Default: "" - (Disabled)
-
-ArenaLogFile = ""
-
-#
-# ArenaLog.ExtendedInfo
-# Description: Include extended info to ArenaLogFile for each player after rated arena
-# matches (guid, name, team, IP, healing/damage done, killing blows).
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-ArenaLog.ExtendedInfo = 0
-
-#
-# SQLDeveloperLogFile
-# Description: Log file for core-generated SQL queries/dumps
-# Example: "SQLDev.log" - (Enabled)
-# Default: "" - (Disabled)
-
-SQLDeveloperLogFile = ""
-
-#
-# SQLDriverLogFile
-# Description: Log file for SQL driver events.
-# Example: "SQLDriver.log" - (Enabled)
-# Default: "" - (Disabled)
-
-SQLDriverLogFile = ""
-
-#
-# SQLDriverQueryLogging
-# Description: Log SQL queries to the SQLDriverLogFile and console.
-# Default: 0 - (Disabled, Query errors only)
-# 1 - (Enabled, Full query logging - may have performance impact)
-
-SQLDriverQueryLogging = 0
-
-#
-# LogColors
-# Description: Colors for log messages (Format: "normal basic detail debug").
-# Colors: 0 - Black
-# 1 - Red
-# 2 - Green
-# 3 - Brown
-# 4 - Blue
-# 5 - Magenta
-# 6 - Cyan
-# 7 - Grey
-# 8 - Yellow
-# 9 - Lred
-# 10 - Lgreen
-# 11 - Lblue
-# 12 - Lmagenta
-# 13 - Lcyan
-# 14 - White
-# Example: "13 11 9 5" - (Enabled)
-# Default: "" - (Disabled)
-
-LogColors = ""
-
-#
-# EnableLogDB
-# Description: Write log messages to database (LogDatabaseInfo).
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-EnableLogDB = 0
-
-#
-# DBLogLevel
-# Description: Log level of databases logging.
-# Default: 2 - (Detail)
-# 0 - (Minimum)
-# 1 - (Basic)
-# 3 - (Full/Debug)
-
-DBLogLevel = 2
-
-#
-# LogDB.Char
-# Description: Log character operations to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.Char = 0
-
-#
-# LogDB.GM
-# Description: Log gamemaster commands to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.GM = 0
-
-#
-# LogDB.RA
-# Description: Log remote access events to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.RA = 0
-
-#
-# LogDB.World
-# Description: Log world server packets to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled, May have performance impact)
-
-LogDB.World = 0
-
-#
-# LogDB.Chat
-# Description: Log chat messages to database.
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-LogDB.Chat = 0
-
-
-# ChatLogFile
-# Description: Log file for chat logs.
-# Default: "Chat.log" - (Enabled)
-# "" - (Disabled)
-
-ChatLogFile = "Chat.log"
-
-# ChatLogTimestamp
-# Description: Append timestamp to the chat log file name.
-# Logname_YYYY-MM-DD_HH-MM-SS.Ext for Logname.Ext
-# Default: 0 - (Disabled)
-# 1 - (Enabled)
-
-ChatLogTimestamp = 0
-
-#
# ChatLogs.Channel
# Description: Log custom channel chat.
# Default: 0 - (Disabled)
@@ -791,6 +477,7 @@ ChatLogs.Addon = 0
ChatLogs.BattleGround = 0
+# Extended Logging system configuration moved to end of file (on purpose)
#
###################################################################################################
@@ -1462,15 +1149,6 @@ Warden.NumMemChecks = 3
Warden.NumOtherChecks = 7
#
-# Warden.LogFile
-# Description: Client check fails will be logged here.
-# Default: "" - (Disabled)
-# "Warden.log" - (Enabled)
-#
-
-Warden.LogFile = ""
-
-#
# Warden.ClientResponseDelay
# Description: Time (in seconds) before client is getting disconnecting for not responding.
# Default: 600 - (10 Minutes)
@@ -2889,3 +2567,192 @@ PlayerDump.DisallowOverwrite = 1
#
###################################################################################################
+
+###################################################################################################
+#
+# Logging system options.
+#
+# Appender config values: Given a appender "name"
+# Appender.name
+# Description: Defines 'where to log'
+# Format: Type,LogLevel,Flags,optional1,optional2
+#
+# Type
+# 0 - (None)
+# 1 - (Console)
+# 2 - (File)
+# 3 - (DB)
+#
+# LogLevel
+# 0 - (Disabled)
+# 1 - (Trace)
+# 2 - (Debug)
+# 3 - (Info)
+# 4 - (Warn)
+# 5 - (Error)
+# 6 - (Fatal)
+#
+# Flags: Default Console = 6, File = 7, DB = 0
+# 0 - None
+# 1 - Prefix Timestamp to the text
+# 2 - Prefix Log Level to the text
+# 4 - Prefix Log Filter type to the text
+# 8 - Append timestamp to the log file name. Format: YYYY-MM-DD_HH-MM-SS (Only used with Type = 2)
+# 16 - Make a backup of existing file before overwrite (Only used with Mode = w)
+#
+# Colors (read as optional1 if Type = Console)
+# Format: "fatal error warn info debug trace"
+# 0 - BLACK
+# 1 - RED
+# 2 - GREEN
+# 3 - BROWN
+# 4 - BLUE
+# 5 - MAGENTA
+# 6 - CYAN
+# 7 - GREY
+# 8 - YELLOW
+# 9 - LRED
+# 10 - LGREEN
+# 11 - LBLUE
+# 12 - LMAGENTA
+# 13 - LCYAN
+# 14 - WHITE
+# Example: "13 11 9 5 3 1"
+#
+# File: Name of the file (read as optional1 if Type = File)
+# Allows to use one "%u" to create dynamic files
+#
+# Mode: Mode to open the file (read as optional2 if Type = File)
+# a - (Append)
+# w - (Overwrite)
+#
+
+Appender.Console=1,2,6
+Appender.Server=2,2,7,Server.log,w
+Appender.GM=2,2,7,GM.log
+Appender.SQL=2,2,7,SQL.log
+Appender.DBErrors=2,2,7,DBErrors.log
+Appender.Char=2,2,7,Char.log,w
+Appender.RA=2,2,7,RA.log
+Appender.Arenas=2,2,7,Arena.log
+Appender.SQLDev=2,2,7,SQLDev.log
+Appender.SQLDriver=2,2,7,SQLDriver.log
+Appender.Warden=2,2,7,Warden.log
+Appender.Chat=2,2,7,Chat.log
+
+# Logger config values: Given a logger "name"
+# Logger.name
+# Description: Defines 'What to log'
+# Format: Type,LogLevel,AppenderList
+# Type
+# 0 - Default. Each type that has no config will
+# rely on this one. Core will create this logger
+# (disabled) if it's not configured
+# 1 - Units that doesn't fit in other categories
+# 2 - Pets
+# 3 - Vehicles
+# 4 - C++ AI, instance scripts, etc.
+# 5 - DB AI, such as SAI, EAI, CreatureAI
+# 6 - DB map scripts
+# 7 - Network input/output,
+# such as packet handlers and netcode logs
+# 8 - Spellsystem and aurasystem
+# 9 - Achievement system
+# 10 - Condition system
+# 11 - Pool system
+# 12 - Auction house
+# 13 - Arena's and battlegrounds
+# 14 - Outdoor PVP
+# 15 - Chat system
+# 16 - LFG system
+# 17 - Maps, instances (not scripts),
+# grids, cells, visibility, etc.
+# 18 - Player that doesn't fit in other categories.
+# 19 - Player loading from DB
+# (Player::_LoadXXX functions)
+# 20 - Items
+# 21 - Player skills (do not confuse with spells)
+# 22 - Player chat logs
+# 23 - loot
+# 24 - guilds
+# 25 - transports
+# 26 - SQL. DB errors
+# 27 - GM Commands
+# 28 - Remote Access Commands
+# 29 - Warden
+# 30 - Authserver
+# 31 - Worldserver
+# 32 - Game Events
+# 33 - Calendar
+# 34 - Character (Exclusive to log login, logout, create, rename, delete actions)
+# 35 - Arenas
+# 36 - SQL Driver
+# 37 - SQL Dev
+# 38 - Opcodes
+
+Logger.Root=0,5,Console Server
+Logger.Units=1,3,Console Server
+Logger.Pets=2,3,Console Server
+Logger.Vehicles=3,3,Console Server
+Logger.TCSR=4,3,Console Server
+Logger.AI=5,3,Console Server
+Logger.MapScripts=6,3,Console Server
+Logger.NetWork=7,3,Console Server
+Logger.Spells=8,3,Console Server
+Logger.Achievements=9,3,Console Server
+Logger.Conditions=10,3,Console Server
+Logger.Pool=11,3,Console Server
+Logger.AuctionHouse=12,3,Console Server
+Logger.Battlegrounds=13,3,Console Server
+Logger.OutdoorPvP=14,3,Console Server
+Logger.ChatSystem=15,3,Console Server
+Logger.LFG=16,3,Console Server
+Logger.Maps=17,3,Console Server
+Logger.Player=18,3,Console Server
+Logger.PlayerLoading=19,3,Console Server
+Logger.PlayerItems=20,3,Console Server
+Logger.PlayerSkills=21,3,Console Server
+Logger.PlayerChat=22,3,Chat
+Logger.Loot=23,3,Console Server
+Logger.Guilds=24,3,Console Server
+Logger.Transports=25,3,Console Server
+Logger.SQL=26,2,Console Server SQL
+Logger.GM=27,3,Console Server GM
+Logger.RA=28,3,RA
+Logger.Warden=29,3,Warden
+Logger.Authserver=30,3,Console Server
+Logger.Worldserver=31,3,Console Server
+Logger.GameEvents=32,3,Console Server
+Logger.Calendar=33,3,Console Server
+Logger.Character=34,3,Char
+Logger.Arenas=35,3,Arenas
+Logger.SQLDriver=36,5,SQLDriver
+Logger.SQLDev=37,3,SQLDev
+Logger.Opcodes=38,2,Console Server
+
+# LogLevel
+# 0 - (Disabled)
+# 1 - (Trace)
+# 2 - (Debug)
+# 3 - (Info)
+# 4 - (Warn)
+# 5 - (Error)
+# 6 - (Fatal)
+#
+# AppenderList: List of appenders linked to logger
+# (Using spaces as separator).
+#
+# Appenders
+# Description: List of Appenders to read from config
+# (Using spaces as separator).
+# Default: "Console Server"
+
+Appenders=Console Server
+
+#
+# Loggers
+# Description: List of Loggers to read from config
+# (Using spaces as separator).
+# Default: "root"
+
+Loggers=Root Opcodes NetWork SQL