diff options
| author | Spp <spp@jorge.gr> | 2011-09-28 13:00:43 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2011-09-28 13:00:43 +0200 |
| commit | be12603150d8392ce1596dddc7d01ff716e1e67e (patch) | |
| tree | 94d64c59f7c9c20b1bfb1f41a7410c7aca8d406a /src/server/worldserver | |
| parent | 71228f90bb281f07901859272b4868b7d63a6eea (diff) | |
Configuration/ConfigMgr: converted from singleton to namespace with free functions.
Diffstat (limited to 'src/server/worldserver')
| -rwxr-xr-x | src/server/worldserver/CommandLine/CliRunnable.cpp | 2 | ||||
| -rwxr-xr-x | src/server/worldserver/Main.cpp | 2 | ||||
| -rwxr-xr-x | src/server/worldserver/Master.cpp | 40 | ||||
| -rw-r--r-- | src/server/worldserver/RemoteAccess/RARunnable.cpp | 6 | ||||
| -rwxr-xr-x | src/server/worldserver/RemoteAccess/RASocket.cpp | 2 |
5 files changed, 26 insertions, 26 deletions
diff --git a/src/server/worldserver/CommandLine/CliRunnable.cpp b/src/server/worldserver/CommandLine/CliRunnable.cpp index 3fd47c42dc3..794f79f536d 100755 --- a/src/server/worldserver/CommandLine/CliRunnable.cpp +++ b/src/server/worldserver/CommandLine/CliRunnable.cpp @@ -566,7 +566,7 @@ void CliRunnable::run() rl_attempted_completion_function = cli_completion; rl_event_hook = cli_hook_func; #endif - if (sConfig->GetBoolDefault("BeepAtStart", true)) + if (ConfigMgr::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 ede65d07910..85f10e0cf9b 100755 --- 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 (!sConfig->SetSource(cfg_file)) + 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!"); diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp index cb3cd1289f7..e16494bdeac 100755 --- a/src/server/worldserver/Master.cpp +++ b/src/server/worldserver/Master.cpp @@ -144,7 +144,7 @@ int Master::Run() #endif //USE_SFMT_FOR_RNG /// worldserver PID file creation - std::string pidfile = sConfig->GetStringDefault("PidFile", ""); + std::string pidfile = ConfigMgr::GetStringDefault("PidFile", ""); if (!pidfile.empty()) { uint32 pid = CreatePIDFile(pidfile); @@ -188,9 +188,9 @@ int Master::Run() ACE_Based::Thread* cliThread = NULL; #ifdef _WIN32 - if (sConfig->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) + if (ConfigMgr::GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/) #else - if (sConfig->GetBoolDefault("Console.Enable", true)) + if (ConfigMgr::GetBoolDefault("Console.Enable", true)) #endif { ///- Launch CliRunnable thread @@ -204,7 +204,7 @@ int Master::Run() { HANDLE hProcess = GetCurrentProcess(); - uint32 Aff = sConfig->GetIntDefault("UseProcessors", 0); + uint32 Aff = ConfigMgr::GetIntDefault("UseProcessors", 0); if (Aff > 0) { ULONG_PTR appAff; @@ -229,7 +229,7 @@ int Master::Run() sLog->outString(""); } - bool Prio = sConfig->GetBoolDefault("ProcessPriority", false); + bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false); //if (Prio && (m_ServiceStatus == -1) /* need set to default process priority class in service mode*/) if (Prio) @@ -245,15 +245,15 @@ int Master::Run() //Start soap serving thread ACE_Based::Thread* soap_thread = NULL; - if (sConfig->GetBoolDefault("SOAP.Enabled", false)) + if (ConfigMgr::GetBoolDefault("SOAP.Enabled", false)) { TCSoapRunnable* runnable = new TCSoapRunnable(); - runnable->setListenArguments(sConfig->GetStringDefault("SOAP.IP", "127.0.0.1"), sConfig->GetIntDefault("SOAP.Port", 7878)); + runnable->setListenArguments(ConfigMgr::GetStringDefault("SOAP.IP", "127.0.0.1"), ConfigMgr::GetIntDefault("SOAP.Port", 7878)); soap_thread = new ACE_Based::Thread(runnable); } ///- Start up freeze catcher thread - if (uint32 freeze_delay = sConfig->GetIntDefault("MaxCoreStuckTime", 0)) + if (uint32 freeze_delay = ConfigMgr::GetIntDefault("MaxCoreStuckTime", 0)) { FreezeDetectorRunnable* fdr = new FreezeDetectorRunnable(); fdr->SetDelayTime(freeze_delay*1000); @@ -263,7 +263,7 @@ int Master::Run() ///- Launch the world listener socket uint16 wsport = sWorld->getIntConfig(CONFIG_PORT_WORLD); - std::string bind_ip = sConfig->GetStringDefault("BindIP", "0.0.0.0"); + std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0"); if (sWorldSocketMgr->StartNetwork(wsport, bind_ip.c_str ()) == -1) { @@ -367,14 +367,14 @@ bool Master::_StartDB() std::string dbstring; uint8 async_threads, synch_threads; - dbstring = sConfig->GetStringDefault("WorldDatabaseInfo", ""); + dbstring = ConfigMgr::GetStringDefault("WorldDatabaseInfo", ""); if (dbstring.empty()) { sLog->outError("World database not specified in configuration file"); return false; } - async_threads = sConfig->GetIntDefault("WorldDatabase.WorkerThreads", 1); + async_threads = ConfigMgr::GetIntDefault("WorldDatabase.WorkerThreads", 1); if (async_threads < 1 || async_threads > 32) { sLog->outError("World database: invalid number of worker threads specified. " @@ -382,7 +382,7 @@ bool Master::_StartDB() return false; } - synch_threads = sConfig->GetIntDefault("WorldDatabase.SynchThreads", 1); + synch_threads = ConfigMgr::GetIntDefault("WorldDatabase.SynchThreads", 1); ///- Initialise the world database if (!WorldDatabase.Open(dbstring, async_threads, synch_threads)) { @@ -391,14 +391,14 @@ bool Master::_StartDB() } ///- Get character database info from configuration file - dbstring = sConfig->GetStringDefault("CharacterDatabaseInfo", ""); + dbstring = ConfigMgr::GetStringDefault("CharacterDatabaseInfo", ""); if (dbstring.empty()) { sLog->outError("Character database not specified in configuration file"); return false; } - async_threads = sConfig->GetIntDefault("CharacterDatabase.WorkerThreads", 1); + async_threads = ConfigMgr::GetIntDefault("CharacterDatabase.WorkerThreads", 1); if (async_threads < 1 || async_threads > 32) { sLog->outError("Character database: invalid number of worker threads specified. " @@ -406,7 +406,7 @@ bool Master::_StartDB() return false; } - synch_threads = sConfig->GetIntDefault("CharacterDatabase.SynchThreads", 2); + synch_threads = ConfigMgr::GetIntDefault("CharacterDatabase.SynchThreads", 2); ///- Initialise the Character database if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads)) @@ -416,14 +416,14 @@ bool Master::_StartDB() } ///- Get login database info from configuration file - dbstring = sConfig->GetStringDefault("LoginDatabaseInfo", ""); + dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", ""); if (dbstring.empty()) { sLog->outError("Login database not specified in configuration file"); return false; } - async_threads = sConfig->GetIntDefault("LoginDatabase.WorkerThreads", 1); + async_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1); if (async_threads < 1 || async_threads > 32) { sLog->outError("Login database: invalid number of worker threads specified. " @@ -431,7 +431,7 @@ bool Master::_StartDB() return false; } - synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1); + synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1); ///- Initialise the login database if (!LoginDatabase.Open(dbstring, async_threads, synch_threads)) { @@ -440,7 +440,7 @@ bool Master::_StartDB() } ///- Get the realm Id from the configuration file - realmID = sConfig->GetIntDefault("RealmID", 0); + realmID = ConfigMgr::GetIntDefault("RealmID", 0); if (!realmID) { sLog->outError("Realm ID not defined in configuration file"); @@ -449,7 +449,7 @@ bool Master::_StartDB() sLog->outString("Realm running as realm ID %d", realmID); ///- Initialize the DB logging system - sLog->SetLogDBLater(sConfig->GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. + sLog->SetLogDBLater(ConfigMgr::GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished. sLog->SetLogDB(false); sLog->SetRealmID(realmID); diff --git a/src/server/worldserver/RemoteAccess/RARunnable.cpp b/src/server/worldserver/RemoteAccess/RARunnable.cpp index a6ccf0879d9..d7cee88b994 100644 --- a/src/server/worldserver/RemoteAccess/RARunnable.cpp +++ b/src/server/worldserver/RemoteAccess/RARunnable.cpp @@ -61,13 +61,13 @@ RARunnable::~RARunnable() void RARunnable::run() { - if (!sConfig->GetBoolDefault("Ra.Enable", false)) + if (!ConfigMgr::GetBoolDefault("Ra.Enable", false)) return; ACE_Acceptor<RASocket, ACE_SOCK_ACCEPTOR> acceptor; - uint16 raport = sConfig->GetIntDefault("Ra.Port", 3443); - std::string stringip = sConfig->GetStringDefault("Ra.IP", "0.0.0.0"); + uint16 raport = ConfigMgr::GetIntDefault("Ra.Port", 3443); + std::string stringip = ConfigMgr::GetStringDefault("Ra.IP", "0.0.0.0"); ACE_INET_Addr listen_addr(raport, stringip.c_str()); diff --git a/src/server/worldserver/RemoteAccess/RASocket.cpp b/src/server/worldserver/RemoteAccess/RASocket.cpp index 500869973d3..9c31c189822 100755 --- a/src/server/worldserver/RemoteAccess/RASocket.cpp +++ b/src/server/worldserver/RemoteAccess/RASocket.cpp @@ -32,7 +32,7 @@ RASocket::RASocket() { - iMinLevel = sConfig->GetIntDefault("RA.MinLevel", 3); + iMinLevel = ConfigMgr::GetIntDefault("RA.MinLevel", 3); } RASocket::~RASocket() |
