aboutsummaryrefslogtreecommitdiff
path: root/src/server/authserver/Main.cpp
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2011-09-28 13:00:43 +0200
committerSpp <spp@jorge.gr>2011-09-28 13:00:43 +0200
commitbe12603150d8392ce1596dddc7d01ff716e1e67e (patch)
tree94d64c59f7c9c20b1bfb1f41a7410c7aca8d406a /src/server/authserver/Main.cpp
parent71228f90bb281f07901859272b4868b7d63a6eea (diff)
Configuration/ConfigMgr: converted from singleton to namespace with free functions.
Diffstat (limited to 'src/server/authserver/Main.cpp')
-rwxr-xr-xsrc/server/authserver/Main.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/authserver/Main.cpp b/src/server/authserver/Main.cpp
index 0696377c0c3..dbc5f65c711 100755
--- a/src/server/authserver/Main.cpp
+++ b/src/server/authserver/Main.cpp
@@ -91,7 +91,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 \'[authserver]\' written in the top of the file!");
@@ -114,7 +114,7 @@ extern int main(int argc, char **argv)
sLog->outBasic("Max allowed open files is %d", ACE::max_handles());
// authserver PID file creation
- std::string pidfile = sConfig->GetStringDefault("PidFile", "");
+ std::string pidfile = ConfigMgr::GetStringDefault("PidFile", "");
if (!pidfile.empty())
{
uint32 pid = CreatePIDFile(pidfile);
@@ -132,12 +132,12 @@ extern int main(int argc, char **argv)
return 1;
// Initialize the log database
- 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(0); // ensure we've set realm to 0 (authserver realmid)
// Get the list of realms for the server
- sRealmList->Initialize(sConfig->GetIntDefault("RealmsStateUpdateDelay", 20));
+ sRealmList->Initialize(ConfigMgr::GetIntDefault("RealmsStateUpdateDelay", 20));
if (sRealmList->size() == 0)
{
sLog->outError("No valid realms specified.");
@@ -147,8 +147,8 @@ extern int main(int argc, char **argv)
// Launch the listening network socket
RealmAcceptor acceptor;
- uint16 rmport = sConfig->GetIntDefault("RealmServerPort", 3724);
- std::string bind_ip = sConfig->GetStringDefault("BindIP", "0.0.0.0");
+ uint16 rmport = ConfigMgr::GetIntDefault("RealmServerPort", 3724);
+ std::string bind_ip = ConfigMgr::GetStringDefault("BindIP", "0.0.0.0");
ACE_INET_Addr bind_addr(rmport, bind_ip.c_str());
@@ -171,7 +171,7 @@ extern int main(int argc, char **argv)
{
HANDLE hProcess = GetCurrentProcess();
- uint32 Aff = sConfig->GetIntDefault("UseProcessors", 0);
+ uint32 Aff = ConfigMgr::GetIntDefault("UseProcessors", 0);
if (Aff > 0)
{
ULONG_PTR appAff;
@@ -191,7 +191,7 @@ extern int main(int argc, char **argv)
sLog->outString();
}
- bool Prio = sConfig->GetBoolDefault("ProcessPriority", false);
+ bool Prio = ConfigMgr::GetBoolDefault("ProcessPriority", false);
if (Prio)
{
@@ -205,7 +205,7 @@ extern int main(int argc, char **argv)
#endif
// maximum counter for next ping
- uint32 numLoops = (sConfig->GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000));
+ uint32 numLoops = (ConfigMgr::GetIntDefault("MaxPingTime", 30) * (MINUTE * 1000000 / 100000));
uint32 loopCounter = 0;
// possibly enable db logging; avoid massive startup spam by doing it here.
@@ -248,21 +248,21 @@ bool StartDB()
{
MySQL::Library_Init();
- std::string dbstring = sConfig->GetStringDefault("LoginDatabaseInfo", "");
+ std::string dbstring = ConfigMgr::GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
sLog->outError("Database not specified");
return false;
}
- uint8 worker_threads = sConfig->GetIntDefault("LoginDatabase.WorkerThreads", 1);
+ uint8 worker_threads = ConfigMgr::GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (worker_threads < 1 || worker_threads > 32)
{
sLog->outError("Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
worker_threads = 1;
}
- uint8 synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1);
+ uint8 synch_threads = ConfigMgr::GetIntDefault("LoginDatabase.SynchThreads", 1);
if (synch_threads < 1 || synch_threads > 32)
{
sLog->outError("Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");