Replace World::getConfig with World::getFloatConfig, World::getIntConfig, and World::getBoolConfig.
Also fix a warning from a previous commit. --HG-- branch : trunk
This commit is contained in:
@@ -471,7 +471,7 @@ bool ChatHandler::HandleCharacterDeletedDeleteCommand(const char* args)
|
||||
*/
|
||||
bool ChatHandler::HandleCharacterDeletedOldCommand(const char* args)
|
||||
{
|
||||
int32 keepDays = sWorld.getConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
||||
int32 keepDays = sWorld.getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
||||
|
||||
char* px = strtok((char*)args, " ");
|
||||
if (px)
|
||||
@@ -700,19 +700,19 @@ void CliRunnable::run()
|
||||
{
|
||||
///- Init MySQL threads or connections
|
||||
bool needInit = true;
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
WorldDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
LoginDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
CharacterDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
@@ -788,12 +788,12 @@ void CliRunnable::run()
|
||||
}
|
||||
|
||||
///- Free MySQL thread resources and deallocate lingering connections
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
WorldDatabase.End_MySQL_Connection();
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
LoginDatabase.End_MySQL_Connection();
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
CharacterDatabase.End_MySQL_Connection();
|
||||
if (needInit)
|
||||
MySQL::Thread_End();
|
||||
|
||||
@@ -122,7 +122,7 @@ public:
|
||||
|
||||
RARunnable ()
|
||||
{
|
||||
uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
|
||||
uint32 socketSelecttime = sWorld.getIntConfig(CONFIG_SOCKET_SELECTTIME);
|
||||
numLoops = (sConfig.GetIntDefault ("MaxPingTime", 30) * (MINUTE * 1000000 / socketSelecttime));
|
||||
loopCounter = 0;
|
||||
}
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
}
|
||||
|
||||
// Socket Selet time is in microseconds , not miliseconds!!
|
||||
uint32 socketSelecttime = sWorld.getConfig (CONFIG_SOCKET_SELECTTIME);
|
||||
uint32 socketSelecttime = sWorld.getIntConfig(CONFIG_SOCKET_SELECTTIME);
|
||||
|
||||
// if use ra spend time waiting for io, if not use ra ,just sleep
|
||||
if (usera)
|
||||
@@ -339,7 +339,7 @@ int Master::Run()
|
||||
}
|
||||
|
||||
///- Launch the world listener socket
|
||||
port_t wsport = sWorld.getConfig (CONFIG_PORT_WORLD);
|
||||
port_t wsport = sWorld.getIntConfig(CONFIG_PORT_WORLD);
|
||||
std::string bind_ip = sConfig.GetStringDefault ("BindIP", "0.0.0.0");
|
||||
|
||||
if (sWorldSocketMgr->StartNetwork (wsport, bind_ip.c_str ()) == -1)
|
||||
|
||||
@@ -45,18 +45,18 @@ void WorldRunnable::run()
|
||||
{
|
||||
///- Init MySQL threads or connections
|
||||
bool needInit = true;
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
WorldDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
LoginDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
}
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
{
|
||||
CharacterDatabase.Init_MySQL_Connection();
|
||||
needInit = false;
|
||||
@@ -117,13 +117,13 @@ void WorldRunnable::run()
|
||||
sMapMgr.UnloadAll(); // unload all grids (including locked in memory)
|
||||
|
||||
///- Free MySQL thread resources and deallocate lingering connections
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_WORLDDB) & MYSQL_BUNDLE_RA))
|
||||
WorldDatabase.End_MySQL_Connection();
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_LOGINDB) & MYSQL_BUNDLE_RA))
|
||||
LoginDatabase.End_MySQL_Connection();
|
||||
|
||||
if (!(sWorld.getConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
if (!(sWorld.getIntConfig(CONFIG_MYSQL_BUNDLE_CHARDB) & MYSQL_BUNDLE_RA))
|
||||
CharacterDatabase.End_MySQL_Connection();
|
||||
|
||||
if (needInit)
|
||||
|
||||
Reference in New Issue
Block a user