aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2013-12-20 17:39:13 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2013-12-20 17:39:13 +0100
commit8658b5338c905c79daf50cb56dbe739f82d25acc (patch)
treeebb2c18b6d9618ac9fef1d2c5f8b335f34d3702c /src/server/worldserver
parent59fd1a164fc38ddd282707b3221dcd64af284166 (diff)
parent9ac96fd702d8ed23491d13eda2238312120cf52f (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps_rw
Conflicts: src/server/collision/Management/MMapManager.cpp src/server/game/Maps/Map.cpp src/server/game/Movement/PathGenerator.cpp
Diffstat (limited to 'src/server/worldserver')
-rw-r--r--src/server/worldserver/CMakeLists.txt1
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp2
-rw-r--r--src/server/worldserver/Main.cpp6
-rw-r--r--src/server/worldserver/Master.cpp87
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp6
-rw-r--r--src/server/worldserver/RemoteAccess/RASocket.cpp30
-rw-r--r--src/server/worldserver/TCSoap/TCSoap.cpp18
-rw-r--r--src/server/worldserver/worldserver.conf.dist140
8 files changed, 126 insertions, 164 deletions
diff --git a/src/server/worldserver/CMakeLists.txt b/src/server/worldserver/CMakeLists.txt
index e48197aeb2c..99ea60ba76f 100644
--- a/src/server/worldserver/CMakeLists.txt
+++ b/src/server/worldserver/CMakeLists.txt
@@ -70,7 +70,6 @@ include_directories(
${CMAKE_SOURCE_DIR}/src/server/game/Addons
${CMAKE_SOURCE_DIR}/src/server/game/AI
${CMAKE_SOURCE_DIR}/src/server/game/AI/CoreAI
- ${CMAKE_SOURCE_DIR}/src/server/game/AI/EventAI
${CMAKE_SOURCE_DIR}/src/server/game/AI/ScriptedAI
${CMAKE_SOURCE_DIR}/src/server/game/AI/SmartScripts
${CMAKE_SOURCE_DIR}/src/server/game/AuctionHouse
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 1ebb58eef1a..218fe052cb3 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -134,7 +134,7 @@ int kb_hit_return()
void CliRunnable::run()
{
///- Display the list of available CLI functions then beep
- //TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "");
+ //TC_LOG_INFO("server.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 61aaf5f2ee9..a5f07c036c2 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -132,10 +132,10 @@ extern int main(int argc, char** argv)
return 1;
}
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using configuration file %s.", cfg_file);
+ TC_LOG_INFO("server.worldserver", "Using configuration file %s.", cfg_file);
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using ACE version: %s", ACE_VERSION);
+ TC_LOG_INFO("server.worldserver", "Using SSL version: %s (library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION));
+ TC_LOG_INFO("server.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 d9b97cfd3f5..3fcd4c28f0f 100644
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -86,7 +86,12 @@ private:
uint32 _lastChange;
uint32 _delaytime;
public:
- FreezeDetectorRunnable() { _delaytime = 0; }
+ FreezeDetectorRunnable()
+ {
+ _loops = 0;
+ _lastChange = 0;
+ _delaytime = 0;
+ }
void SetDelayTime(uint32 t) { _delaytime = t; }
@@ -95,7 +100,7 @@ public:
if (!_delaytime)
return;
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
+ TC_LOG_INFO("server.worldserver", "Starting up anti-freeze thread (%u seconds max stuck time)...", _delaytime/1000);
_loops = 0;
_lastChange = 0;
while (!World::IsStopped())
@@ -112,11 +117,11 @@ public:
// possible freeze
else if (getMSTimeDiff(_lastChange, curtime) > _delaytime)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World Thread hangs, kicking out server!");
+ TC_LOG_ERROR("server.worldserver", "World Thread hangs, kicking out server!");
ASSERT(false);
}
}
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Anti-freeze thread exiting without problems.");
+ TC_LOG_INFO("server.worldserver", "Anti-freeze thread exiting without problems.");
}
};
@@ -127,28 +132,28 @@ int Master::Run()
BigNumber seed1;
seed1.SetRand(16 * 8);
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "%s (worldserver-daemon)", _FULLVERSION);
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "<Ctrl-C> to stop.\n");
+ TC_LOG_INFO("server.worldserver", "%s (worldserver-daemon)", _FULLVERSION);
+ TC_LOG_INFO("server.worldserver", "<Ctrl-C> to stop.\n");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, " ______ __");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "/\\__ _\\ __ __/\\ \\__");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, " C O R E /\\___/");
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "http://TrinityCore.org \\/__/\n");
+ TC_LOG_INFO("server.worldserver", " ______ __");
+ TC_LOG_INFO("server.worldserver", "/\\__ _\\ __ __/\\ \\__");
+ TC_LOG_INFO("server.worldserver", "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\, _\\ __ __");
+ TC_LOG_INFO("server.worldserver", " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
+ TC_LOG_INFO("server.worldserver", " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
+ TC_LOG_INFO("server.worldserver", " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
+ TC_LOG_INFO("server.worldserver", " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
+ TC_LOG_INFO("server.worldserver", " C O R E /\\___/");
+ TC_LOG_INFO("server.worldserver", "http://TrinityCore.org \\/__/\n");
/// worldserver PID file creation
std::string pidFile = sConfigMgr->GetStringDefault("PidFile", "");
if (!pidFile.empty())
{
if (uint32 pid = CreatePIDFile(pidFile))
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Daemon PID: %u\n", pid);
+ TC_LOG_INFO("server.worldserver", "Daemon PID: %u\n", pid);
else
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot create PID file %s.\n", pidFile.c_str());
+ TC_LOG_ERROR("server.worldserver", "Cannot create PID file %s.\n", pidFile.c_str());
return 1;
}
}
@@ -213,20 +218,20 @@ int Master::Run()
ULONG_PTR currentAffinity = affinity & appAff; // remove non accessible processors
if (!currentAffinity)
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", affinity, appAff);
+ TC_LOG_ERROR("server.worldserver", "Processors marked in UseProcessors bitmask (hex) %x are not accessible for the worldserver. Accessible processors bitmask (hex): %x", affinity, appAff);
else if (SetProcessAffinityMask(hProcess, currentAffinity))
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", currentAffinity);
+ TC_LOG_INFO("server.worldserver", "Using processors (bitmask, hex): %x", currentAffinity);
else
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x", currentAffinity);
+ TC_LOG_ERROR("server.worldserver", "Can't set used processors (hex): %x", currentAffinity);
}
}
if (highPriority)
{
if (SetPriorityClass(hProcess, HIGH_PRIORITY_CLASS))
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to HIGH");
+ TC_LOG_INFO("server.worldserver", "worldserver process priority class set to HIGH");
else
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class.");
+ TC_LOG_ERROR("server.worldserver", "Can't set worldserver process priority class.");
}
}
#elif __linux__ // Linux
@@ -241,21 +246,21 @@ int Master::Run()
CPU_SET(i, &mask);
if (sched_setaffinity(0, sizeof(mask), &mask))
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno));
+ TC_LOG_ERROR("server.worldserver", "Can't set used processors (hex): %x, error: %s", affinity, strerror(errno));
else
{
CPU_ZERO(&mask);
sched_getaffinity(0, sizeof(mask), &mask);
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using processors (bitmask, hex): %x", *(uint32*)(&mask));
+ TC_LOG_INFO("server.worldserver", "Using processors (bitmask, hex): %x", *(uint32*)(&mask));
}
}
if (highPriority)
{
if (setpriority(PRIO_PROCESS, 0, PROCESS_HIGH_PRIORITY))
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Can't set worldserver process priority class, error: %s", strerror(errno));
+ TC_LOG_ERROR("server.worldserver", "Can't set worldserver process priority class, error: %s", strerror(errno));
else
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0));
+ TC_LOG_INFO("server.worldserver", "worldserver process priority class set to %i", getpriority(PRIO_PROCESS, 0));
}
#endif
@@ -285,7 +290,7 @@ int Master::Run()
if (sWorldSocketMgr->StartNetwork(worldPort, bindIp.c_str()) == -1)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Failed to start network");
+ TC_LOG_ERROR("server.worldserver", "Failed to start network");
World::StopNow(ERROR_EXIT_CODE);
// go down and shutdown the server
}
@@ -293,7 +298,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);
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "%s (worldserver-daemon) ready...", _FULLVERSION);
+ TC_LOG_INFO("server.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
@@ -315,7 +320,7 @@ int Master::Run()
_StopDB();
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Halting process...");
+ TC_LOG_INFO("server.worldserver", "Halting process...");
if (cliThread)
{
@@ -387,14 +392,14 @@ bool Master::_StartDB()
dbString = sConfigMgr->GetStringDefault("WorldDatabaseInfo", "");
if (dbString.empty())
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World database not specified in configuration file");
+ TC_LOG_ERROR("server.worldserver", "World database not specified in configuration file");
return false;
}
asyncThreads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.WorkerThreads", 1));
if (asyncThreads < 1 || asyncThreads > 32)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. "
+ TC_LOG_ERROR("server.worldserver", "World database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -403,7 +408,7 @@ bool Master::_StartDB()
///- Initialize the world database
if (!WorldDatabase.Open(dbString, asyncThreads, synchThreads))
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to world database %s", dbString.c_str());
+ TC_LOG_ERROR("server.worldserver", "Cannot connect to world database %s", dbString.c_str());
return false;
}
@@ -411,14 +416,14 @@ bool Master::_StartDB()
dbString = sConfigMgr->GetStringDefault("CharacterDatabaseInfo", "");
if (dbString.empty())
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Character database not specified in configuration file");
+ TC_LOG_ERROR("server.worldserver", "Character database not specified in configuration file");
return false;
}
asyncThreads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.WorkerThreads", 1));
if (asyncThreads < 1 || asyncThreads > 32)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. "
+ TC_LOG_ERROR("server.worldserver", "Character database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -428,7 +433,7 @@ bool Master::_StartDB()
///- Initialize the Character database
if (!CharacterDatabase.Open(dbString, asyncThreads, synchThreads))
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to Character database %s", dbString.c_str());
+ TC_LOG_ERROR("server.worldserver", "Cannot connect to Character database %s", dbString.c_str());
return false;
}
@@ -436,14 +441,14 @@ bool Master::_StartDB()
dbString = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
if (dbString.empty())
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Login database not specified in configuration file");
+ TC_LOG_ERROR("server.worldserver", "Login database not specified in configuration file");
return false;
}
asyncThreads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1));
if (asyncThreads < 1 || asyncThreads > 32)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. "
+ TC_LOG_ERROR("server.worldserver", "Login database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
@@ -452,7 +457,7 @@ bool Master::_StartDB()
///- Initialise the login database
if (!LoginDatabase.Open(dbString, asyncThreads, synchThreads))
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Cannot connect to login database %s", dbString.c_str());
+ TC_LOG_ERROR("server.worldserver", "Cannot connect to login database %s", dbString.c_str());
return false;
}
@@ -460,10 +465,10 @@ bool Master::_StartDB()
realmID = sConfigMgr->GetIntDefault("RealmID", 0);
if (!realmID)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Realm ID not defined in configuration file");
+ TC_LOG_ERROR("server.worldserver", "Realm ID not defined in configuration file");
return false;
}
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Realm running as realm ID %d", realmID);
+ TC_LOG_INFO("server.worldserver", "Realm running as realm ID %d", realmID);
///- Clean the database before starting
ClearOnlineAccounts();
@@ -473,7 +478,7 @@ bool Master::_StartDB()
sWorld->LoadDBVersion();
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Using World DB: %s", sWorld->GetDBVersion());
+ TC_LOG_INFO("server.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 1493df7aa2f..424c3b9a5a6 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(listenAddress, m_Reactor) == -1)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Trinity RA can not bind to port %d on %s", raPort, stringIp.c_str());
+ TC_LOG_ERROR("server.worldserver", "Trinity RA can not bind to port %d on %s", raPort, stringIp.c_str());
return;
}
- TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "Starting Trinity RA on port %d on %s", raPort, stringIp.c_str());
+ TC_LOG_INFO("server.worldserver", "Starting Trinity RA on port %d on %s", raPort, stringIp.c_str());
while (!World::IsStopped())
{
@@ -80,5 +80,5 @@ void RARunnable::run()
break;
}
- TC_LOG_DEBUG(LOG_FILTER_WORLDSERVER, "Trinity RA thread exiting");
+ TC_LOG_DEBUG("server.worldserver", "Trinity RA thread exiting");
}
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index a4d402286ed..195b2992244 100644
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -42,18 +42,18 @@ int RASocket::open(void *)
if (peer().get_remote_addr(remoteAddress) == -1)
{
- TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
+ TC_LOG_ERROR("server.worldserver", "RASocket::open: peer().get_remote_addr error is %s", ACE_OS::strerror(errno));
return -1;
}
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Incoming connection from %s", remoteAddress.get_host_addr());
+ TC_LOG_INFO("commands.ra", "Incoming connection from %s", remoteAddress.get_host_addr());
return activate();
}
int RASocket::handle_close(ACE_HANDLE /*handle*/, ACE_Reactor_Mask /*mask*/)
{
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Closing connection");
+ TC_LOG_INFO("commands.ra", "Closing connection");
peer().close_reader();
wait();
// While the above wait() will wait for the ::svc() to finish, it will not wait for the async event
@@ -129,7 +129,7 @@ int RASocket::recv_line(std::string& out_line)
if (recv_line(message_block) == -1)
{
- TC_LOG_DEBUG(LOG_FILTER_REMOTECOMMAND, "Recv error %s", ACE_OS::strerror(errno));
+ TC_LOG_DEBUG("commands.ra", "Recv error %s", ACE_OS::strerror(errno));
return -1;
}
@@ -143,7 +143,7 @@ int RASocket::process_command(const std::string& command)
if (command.length() == 0)
return 0;
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Received command: %s", command.c_str());
+ TC_LOG_INFO("commands.ra", "Received command: %s", command.c_str());
// handle quit, exit and logout commands to terminate connection
if (command == "quit" || command == "exit" || command == "logout") {
@@ -192,7 +192,7 @@ int RASocket::check_access_level(const std::string& user)
if (!result)
{
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "User %s does not exist in database", user.c_str());
+ TC_LOG_INFO("commands.ra", "User %s does not exist in database", user.c_str());
return -1;
}
@@ -200,12 +200,12 @@ int RASocket::check_access_level(const std::string& user)
if (fields[1].GetUInt8() < _minLevel)
{
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "User %s has no privilege to login", user.c_str());
+ TC_LOG_INFO("commands.ra", "User %s has no privilege to login", user.c_str());
return -1;
}
else if (fields[2].GetInt32() != -1)
{
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
+ TC_LOG_INFO("commands.ra", "User %s has to be assigned on all realms (with RealmID = '-1')", user.c_str());
return -1;
}
@@ -231,7 +231,7 @@ int RASocket::check_password(const std::string& user, const std::string& pass)
if (!result)
{
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Wrong password for user: %s", user.c_str());
+ TC_LOG_INFO("commands.ra", "Wrong password for user: %s", user.c_str());
return -1;
}
@@ -254,7 +254,7 @@ int RASocket::authenticate()
if (recv_line(pass) == -1)
return -1;
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "Login attempt for user: %s", user.c_str());
+ TC_LOG_INFO("commands.ra", "Login attempt for user: %s", user.c_str());
if (check_access_level(user) == -1)
return -1;
@@ -262,7 +262,7 @@ int RASocket::authenticate()
if (check_password(user, pass) == -1)
return -1;
- TC_LOG_INFO(LOG_FILTER_REMOTECOMMAND, "User login: %s", user.c_str());
+ TC_LOG_INFO("commands.ra", "User login: %s", user.c_str());
return 0;
}
@@ -296,7 +296,7 @@ int RASocket::subnegotiate()
if (n >= 1024)
{
- TC_LOG_DEBUG(LOG_FILTER_REMOTECOMMAND, "RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
+ TC_LOG_DEBUG("commands.ra", "RASocket::subnegotiate: allocated buffer 1024 bytes was too small for negotiation packet, size: %u", uint32(n));
return -1;
}
@@ -330,7 +330,7 @@ int RASocket::subnegotiate()
uint8 param = buf[++i];
ss << uint32(param);
- TC_LOG_DEBUG(LOG_FILTER_REMOTECOMMAND, ss.str().c_str());
+ TC_LOG_DEBUG("commands.ra", ss.str().c_str());
}
++i;
}
@@ -396,7 +396,7 @@ void RASocket::zprint(void* callbackArg, const char * szText)
ACE_Time_Value tv = ACE_Time_Value::zero;
if (socket->putq(mb, &tv) == -1)
{
- TC_LOG_DEBUG(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
+ TC_LOG_DEBUG("commands.ra", "Failed to enqueue message, queue is full or closed. Error is %s", ACE_OS::strerror(errno));
mb->release();
}
}
@@ -416,7 +416,7 @@ void RASocket::commandFinished(void* callbackArg, bool /*success*/)
// hence we don't put timeout, because it shouldn't increase queue size and shouldn't block
if (socket->putq(mb->duplicate()) == -1)
// getting here is bad, command can't be marked as complete
- TC_LOG_DEBUG(LOG_FILTER_REMOTECOMMAND, "Failed to enqueue command end message. Error is %s", ACE_OS::strerror(errno));
+ TC_LOG_DEBUG("commands.ra", "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 e10968bcbee..c76298b0de9 100644
--- a/src/server/worldserver/TCSoap/TCSoap.cpp
+++ b/src/server/worldserver/TCSoap/TCSoap.cpp
@@ -35,18 +35,18 @@ void TCSoapRunnable::run()
soap.send_timeout = 5;
if (!soap_valid_socket(soap_bind(&soap, _host.c_str(), _port, 100)))
{
- TC_LOG_ERROR(LOG_FILTER_SOAP, "Couldn't bind to %s:%d", _host.c_str(), _port);
+ TC_LOG_ERROR("network.soap", "Couldn't bind to %s:%d", _host.c_str(), _port);
exit(-1);
}
- TC_LOG_INFO(LOG_FILTER_SOAP, "Bound to http://%s:%d", _host.c_str(), _port);
+ TC_LOG_INFO("network.soap", "Bound to http://%s:%d", _host.c_str(), _port);
while (!World::IsStopped())
{
if (!soap_valid_socket(soap_accept(&soap)))
continue; // ran into an accept timeout
- TC_LOG_DEBUG(LOG_FILTER_SOAP, "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF);
+ TC_LOG_DEBUG("network.soap", "Accepted connection from IP=%d.%d.%d.%d", (int)(soap.ip>>24)&0xFF, (int)(soap.ip>>16)&0xFF, (int)(soap.ip>>8)&0xFF, (int)soap.ip&0xFF);
struct soap* thread_soap = soap_copy(&soap);// make a safe copy
ACE_Message_Block* mb = new ACE_Message_Block(sizeof(struct soap*));
@@ -81,33 +81,33 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
// security check
if (!soap->userid || !soap->passwd)
{
- TC_LOG_INFO(LOG_FILTER_SOAP, "Client didn't provide login information");
+ TC_LOG_INFO("network.soap", "Client didn't provide login information");
return 401;
}
uint32 accountId = AccountMgr::GetId(soap->userid);
if (!accountId)
{
- TC_LOG_INFO(LOG_FILTER_SOAP, "Client used invalid username '%s'", soap->userid);
+ TC_LOG_INFO("network.soap", "Client used invalid username '%s'", soap->userid);
return 401;
}
if (!AccountMgr::CheckPassword(accountId, soap->passwd))
{
- TC_LOG_INFO(LOG_FILTER_SOAP, "Invalid password for account '%s'", soap->userid);
+ TC_LOG_INFO("network.soap", "Invalid password for account '%s'", soap->userid);
return 401;
}
if (AccountMgr::GetSecurity(accountId) < SEC_ADMINISTRATOR)
{
- TC_LOG_INFO(LOG_FILTER_SOAP, "%s's gmlevel is too low", soap->userid);
+ TC_LOG_INFO("network.soap", "%s's gmlevel is too low", soap->userid);
return 403;
}
if (!command || !*command)
return soap_sender_fault(soap, "Command can not be empty", "The supplied command was an empty string");
- TC_LOG_INFO(LOG_FILTER_SOAP, "Received command '%s'", command);
+ TC_LOG_INFO("network.soap", "Received command '%s'", command);
SOAPCommand connection;
// commands are executed in the world thread. We have to wait for them to be completed
@@ -121,7 +121,7 @@ int ns1__executeCommand(soap* soap, char* command, char** result)
int acc = connection.pendingCommands.acquire();
if (acc)
- TC_LOG_ERROR(LOG_FILTER_SOAP, "Error while acquiring lock, acc = %i, errno = %u", acc, errno);
+ TC_LOG_ERROR("network.soap", "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 23db3330943..4e594fc88c0 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -2703,79 +2703,13 @@ UI.ShowQuestLevelsInDialogs = 0
Appender.Console=1,3,0
Appender.Server=2,2,0,Server.log,w
-Appender.GM=2,2,0,GM.log
+Appender.GM=2,2,15,gm/gm_%s.log
Appender.DBErrors=2,2,0,DBErrors.log
-Appender.Char=2,2,0,Char.log,w
-Appender.RA=2,2,0,RA.log
-Appender.Warden=2,4,0,Warden.log
-Appender.Chat=2,2,0,Chat.log
-Appender.CharDump=2,2,0,%s.log
-Appender.Arenas=2,2,0,Arena.log
-Appender.SQLDev=2,2,0,SQLDev.log
-Appender.SQLDriver=2,2,0,SQLDriver.log
-
-# Appenders
-# Description: List of Appenders to read from config
-# (Using spaces as separator).
-# Default: "Console Server GM DBErrors Char RA Warden Chat"
-
-Appenders=Console Server GM DBErrors Char RA Warden Chat
# 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)
-# 35 - Arenas
-# 36 - SQL Driver
-# 37 - SQL Dev
-# 38 - Player Dump
-# 39 - Battlefield
-# 40 - Server Loading
-# 41 - Opcodes (just id and name sent / received)
-# 42 - SOAP
-# 43 - RBAC (Role Based Access Control)
-# 44 - Cheat (used to log cheat attempts)
+# Format: LogLevel,AppenderList
#
# LogLevel
# 0 - (Disabled)
@@ -2790,28 +2724,52 @@ Appenders=Console Server GM DBErrors Char RA Warden Chat
# (Using spaces as separator).
#
-Logger.Root=0,5,Console Server
-Logger.Chat=22,2,Chat
-Logger.DBErrors=26,5,Console Server DBErrors
-Logger.GM=27,3,Console Server GM
-Logger.RA=28,3,RA
-Logger.Warden=29,4,Warden
-Logger.WorldServer=31,3,Console Server
-Logger.Character=34,3,Char
-Logger.Arenas=35,3,Arenas
-Logger.SQLDriver=36,5,SQLDriver
-Logger.SQLDev=37,3,SQLDev
-Logger.CharDump=38,3,CharDump
-Logger.Load=40,3,Console Server
-Logger.Opcodes=41,6,Console Server
-
-#
-# Loggers
-# Description: List of Loggers to read from config
-# (Using spaces as separator).
-# Default: "Root Chat DBErrors GM RA Warden Character Load"
-
-Loggers=Root Chat DBErrors GM RA Warden Character Load WorldServer Opcodes
+Logger.root=5,Console Server
+Logger.server=3,Console Server
+Logger.commands.gm=3,Console GM
+Logger.sql.sql=5,Console DBErrors
+
+#Logger.achievement=3,Console Server
+#Logger.auctionHouse=3,Console Server
+#Logger.bg.arena=3,Console Server
+#Logger.bg.battlefield=3,Console Server
+#Logger.bg.battleground=3,Console Server
+#Logger.chat.log=3,Console Server
+#Logger.calendar=3,Console Server
+#Logger.chat.system=3,Console Server
+#Logger.cheat=3,Console Server
+#Logger.commands.ra=3,Console Server
+#Logger.condition=3,Console Server
+#Logger.entities.pet=3,Console Server
+#Logger.entities.player.character=3,Console Server
+#Logger.entities.player.dump=3,Console Server
+#Logger.entities.player=3,Console Server
+#Logger.entities.player.items=3,Console Server
+#Logger.entities.player.loading=3,Console Server
+#Logger.entities.player.skills=3,Console Server
+#Logger.entities.transport=3,Console Server
+#Logger.entities.unit=3,Console Server
+#Logger.entities.vehicle=3,Console Server
+#Logger.gameevent=3,Console Server
+#Logger.guild=3,Console Server
+#Logger.lfg=3,Console Server
+#Logger.loot=3,Console Server
+#Logger.maps.script=3,Console Server
+#Logger.maps=3,Console Server
+#Logger.misc=3,Console Server
+#Logger.network=3,Console Server
+#Logger.network.opcode=3,Console Server
+#Logger.network.soap=3,Console Server
+#Logger.outdoorpvp=3,Console Server
+#Logger.pool=3,Console Server
+#Logger.rbac=3,Console Server
+#Logger.scripts=3,Console Server
+#Logger.scripts.ai=3,Console Server
+#Logger.server.authserver=3,Console Server
+#Logger.spells=3,Console Server
+#Logger.sql.dev=3,Console Server
+#Logger.sql.driver=3,Console Server
+#Logger.warden=3,Console Server
#
# Log.Async.Enable
@@ -2832,7 +2790,7 @@ Log.Async.Enable = 0
# PacketSpoof.Policy
# Description: Determines the course of action when packet spoofing is detected.
# Default: 1 - Log + kick
-# 0 - Log only (LOG_FILTER_NETWORKIO)
+# 0 - Log only ("network")
# 2 - Log + kick + ban
PacketSpoof.Policy = 1