aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-07-15 17:31:44 +0200
committerShauren <shauren.trinity@gmail.com>2013-07-15 17:31:44 +0200
commit779a59e7e218e340ac5cefd3297ea970d804239d (patch)
treec47bf18ae837020983a325139df4de49627f1f8e /src/server/worldserver
parentbaeecba6c9e3a2b9d4e98551b9746d27016305a2 (diff)
Core/Config: Refactored ConfigMgr
* Loading initial configuration files is now separate from loading any additional custom configs
Diffstat (limited to 'src/server/worldserver')
-rw-r--r--src/server/worldserver/CommandLine/CliRunnable.cpp2
-rw-r--r--src/server/worldserver/Main.cpp2
-rw-r--r--src/server/worldserver/Master.cpp38
-rw-r--r--src/server/worldserver/RemoteAccess/RARunnable.cpp6
-rw-r--r--src/server/worldserver/RemoteAccess/RASocket.cpp2
5 files changed, 25 insertions, 25 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp
index 9cdfe0ad5a5..361af453712 100644
--- a/src/server/worldserver/CommandLine/CliRunnable.cpp
+++ b/src/server/worldserver/CommandLine/CliRunnable.cpp
@@ -141,7 +141,7 @@ void CliRunnable::run()
rl_event_hook = cli_hook_func;
#endif
- if (ConfigMgr::GetBoolDefault("BeepAtStart", true))
+ if (sConfigMgr->GetBoolDefault("BeepAtStart", true))
printf("\a"); // \a = Alert
// print this here the first time
diff --git a/src/server/worldserver/Main.cpp b/src/server/worldserver/Main.cpp
index f9c672b4945..33ece8197f8 100644
--- a/src/server/worldserver/Main.cpp
+++ b/src/server/worldserver/Main.cpp
@@ -129,7 +129,7 @@ extern int main(int argc, char **argv)
++c;
}
- if (!ConfigMgr::Load(cfg_file))
+ if (!sConfigMgr->LoadInitial(cfg_file))
{
printf("Invalid or missing configuration file : %s\n", cfg_file);
printf("Verify that the file exists and has \'[worldserver]' written in the top of the file!\n");
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 88165814d84..69b163b4a4b 100644
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -138,7 +138,7 @@ int Master::Run()
TC_LOG_INFO(LOG_FILTER_WORLDSERVER, "http://TrinityCore.org \\/__/\n");
/// worldserver PID file creation
- std::string pidfile = ConfigMgr::GetStringDefault("PidFile", "");
+ std::string pidfile = sConfigMgr->GetStringDefault("PidFile", "");
if (!pidfile.empty())
{
uint32 pid = CreatePIDFile(pidfile);
@@ -182,9 +182,9 @@ int Master::Run()
ACE_Based::Thread* cliThread = NULL;
#ifdef _WIN32
- if (ConfigMgr::GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
+ if (sConfigMgr->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
#else
- if (ConfigMgr::GetBoolDefault("Console.Enable", true))
+ if (sConfigMgr->GetBoolDefault("Console.Enable", true))
#endif
{
///- Launch CliRunnable thread
@@ -198,7 +198,7 @@ int Master::Run()
{
HANDLE hProcess = GetCurrentProcess();
- uint32 Aff = ConfigMgr::GetIntDefault("UseProcessors", 0);
+ uint32 Aff = sConfigMgr->GetIntDefault("UseProcessors", 0);
if (Aff > 0)
{
ULONG_PTR appAff;
@@ -222,7 +222,7 @@ int Master::Run()
}
}
- bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false);
+ bool Prio = sConfigMgr->GetBoolDefault("ProcessPriority", false);
//if (Prio && (m_ServiceStatus == -1) /* need set to default process priority class in service mode*/)
if (Prio)
@@ -237,15 +237,15 @@ int Master::Run()
//Start soap serving thread
ACE_Based::Thread* soap_thread = NULL;
- if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false))
+ if (sConfigMgr->GetBoolDefault("SOAP.Enabled", false))
{
TCSoapRunnable* runnable = new TCSoapRunnable();
- runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(ConfigMgr::GetIntDefault("SOAP.Port", 7878)));
+ runnable->setListenArguments(sConfigMgr->GetStringDefault("SOAP.IP", "127.0.0.1"), uint16(sConfigMgr->GetIntDefault("SOAP.Port", 7878)));
soap_thread = new ACE_Based::Thread(runnable);
}
///- Start up freeze catcher thread
- if (uint32 freeze_delay = ConfigMgr::GetIntDefault("MaxCoreStuckTime", 0))
+ if (uint32 freeze_delay = sConfigMgr->GetIntDefault("MaxCoreStuckTime", 0))
{
FreezeDetectorRunnable* fdr = new FreezeDetectorRunnable();
fdr->SetDelayTime(freeze_delay * 1000);
@@ -255,7 +255,7 @@ int Master::Run()
///- Launch the world listener socket
uint16 wsport = uint16(sWorld->getIntConfig(CONFIG_PORT_WORLD));
- std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
+ std::string bind_ip = sConfigMgr->GetStringDefault("BindIP", "0.0.0.0");
if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str()) == -1)
{
@@ -357,14 +357,14 @@ bool Master::_StartDB()
std::string dbstring;
uint8 async_threads, synch_threads;
- dbstring = ConfigMgr::GetStringDefault("WorldDatabaseInfo", "");
+ dbstring = sConfigMgr->GetStringDefault("WorldDatabaseInfo", "");
if (dbstring.empty())
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World database not specified in configuration file");
return false;
}
- async_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1));
+ async_threads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.WorkerThreads", 1));
if (async_threads < 1 || async_threads > 32)
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "World database: invalid number of worker threads specified. "
@@ -372,7 +372,7 @@ bool Master::_StartDB()
return false;
}
- synch_threads = uint8(ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1));
+ synch_threads = uint8(sConfigMgr->GetIntDefault("WorldDatabase.SynchThreads", 1));
///- Initialise the world database
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
{
@@ -381,14 +381,14 @@ bool Master::_StartDB()
}
///- Get character database info from configuration file
- dbstring = ConfigMgr::GetStringDefault("CharacterDatabaseInfo", "");
+ dbstring = sConfigMgr->GetStringDefault("CharacterDatabaseInfo", "");
if (dbstring.empty())
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Character database not specified in configuration file");
return false;
}
- async_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1));
+ async_threads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.WorkerThreads", 1));
if (async_threads < 1 || async_threads > 32)
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Character database: invalid number of worker threads specified. "
@@ -396,7 +396,7 @@ bool Master::_StartDB()
return false;
}
- synch_threads = uint8(ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2));
+ synch_threads = uint8(sConfigMgr->GetIntDefault("CharacterDatabase.SynchThreads", 2));
///- Initialise the Character database
if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads))
@@ -406,14 +406,14 @@ bool Master::_StartDB()
}
///- Get login database info from configuration file
- dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", "");
+ dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Login database not specified in configuration file");
return false;
}
- async_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1));
+ async_threads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1));
if (async_threads < 1 || async_threads > 32)
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Login database: invalid number of worker threads specified. "
@@ -421,7 +421,7 @@ bool Master::_StartDB()
return false;
}
- synch_threads = uint8(ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1));
+ synch_threads = uint8(sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1));
///- Initialise the login database
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
{
@@ -430,7 +430,7 @@ bool Master::_StartDB()
}
///- Get the realm Id from the configuration file
- realmID = ConfigMgr::GetIntDefault("RealmID", 0);
+ realmID = sConfigMgr->GetIntDefault("RealmID", 0);
if (!realmID)
{
TC_LOG_ERROR(LOG_FILTER_WORLDSERVER, "Realm ID not defined in configuration file");
diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp
index edb7e048aa3..465e605beac 100644
--- a/src/server/worldserver/RemoteAccess/RARunnable.cpp
+++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp
@@ -56,13 +56,13 @@ RARunnable::~RARunnable()
void RARunnable::run()
{
- if (!ConfigMgr::GetBoolDefault("Ra.Enable", false))
+ if (!sConfigMgr->GetBoolDefault("Ra.Enable", false))
return;
ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor;
- uint16 raport = uint16(ConfigMgr::GetIntDefault("Ra.Port", 3443));
- std::string stringip = ConfigMgr::GetStringDefault("Ra.IP", "0.0.0.0");
+ uint16 raport = uint16(sConfigMgr->GetIntDefault("Ra.Port", 3443));
+ std::string stringip = sConfigMgr->GetStringDefault("Ra.IP", "0.0.0.0");
ACE_INET_Addr listen_addr(raport, stringip.c_str());
if (acceptor.open(listen_addr, m_Reactor) == -1)
diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp
index fa5fdfd3ca0..3fd4e34e89e 100644
--- a/src/server/worldserver/RemoteAccess/RASocket.cpp
+++ b/src/server/worldserver/RemoteAccess/RASocket.cpp
@@ -32,7 +32,7 @@
RASocket::RASocket()
{
- _minLevel = uint8(ConfigMgr::GetIntDefault("RA.MinLevel", 3));
+ _minLevel = uint8(sConfigMgr->GetIntDefault("RA.MinLevel", 3));
_commandExecuting = false;
}