Configuration/ConfigMgr: converted from singleton to namespace with free functions.
This commit is contained in:
@@ -40,7 +40,7 @@ WorldLog::~WorldLog()
|
||||
/// Open the log file (if specified so in the configuration file)
|
||||
void WorldLog::Initialize()
|
||||
{
|
||||
std::string logsDir = sConfig->GetStringDefault("LogsDir", "");
|
||||
std::string logsDir = ConfigMgr::GetStringDefault("LogsDir", "");
|
||||
|
||||
if (!logsDir.empty())
|
||||
{
|
||||
@@ -48,13 +48,13 @@ void WorldLog::Initialize()
|
||||
logsDir.push_back('/');
|
||||
}
|
||||
|
||||
std::string logname = sConfig->GetStringDefault("WorldLogFile", "");
|
||||
std::string logname = ConfigMgr::GetStringDefault("WorldLogFile", "");
|
||||
if (!logname.empty())
|
||||
{
|
||||
i_file = fopen((logsDir+logname).c_str(), "w");
|
||||
}
|
||||
|
||||
m_dbWorld = sConfig->GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled
|
||||
m_dbWorld = ConfigMgr::GetBoolDefault("LogDB.World", false); // can be VERY heavy if enabled
|
||||
}
|
||||
|
||||
void WorldLog::outTimestampLog(char const* fmt, ...)
|
||||
|
||||
@@ -230,9 +230,9 @@ WorldSocketMgr::~WorldSocketMgr()
|
||||
int
|
||||
WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
|
||||
{
|
||||
m_UseNoDelay = sConfig->GetBoolDefault ("Network.TcpNodelay", true);
|
||||
m_UseNoDelay = ConfigMgr::GetBoolDefault ("Network.TcpNodelay", true);
|
||||
|
||||
int num_threads = sConfig->GetIntDefault ("Network.Threads", 1);
|
||||
int num_threads = ConfigMgr::GetIntDefault ("Network.Threads", 1);
|
||||
|
||||
if (num_threads <= 0)
|
||||
{
|
||||
@@ -247,9 +247,9 @@ WorldSocketMgr::StartReactiveIO (ACE_UINT16 port, const char* address)
|
||||
sLog->outBasic ("Max allowed socket connections %d", ACE::max_handles());
|
||||
|
||||
// -1 means use default
|
||||
m_SockOutKBuff = sConfig->GetIntDefault ("Network.OutKBuff", -1);
|
||||
m_SockOutKBuff = ConfigMgr::GetIntDefault ("Network.OutKBuff", -1);
|
||||
|
||||
m_SockOutUBuff = sConfig->GetIntDefault ("Network.OutUBuff", 65536);
|
||||
m_SockOutUBuff = ConfigMgr::GetIntDefault ("Network.OutUBuff", 65536);
|
||||
|
||||
if (m_SockOutUBuff <= 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user