aboutsummaryrefslogtreecommitdiff
path: root/src/server/worldserver/Master.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/worldserver/Master.cpp')
-rwxr-xr-xsrc/server/worldserver/Master.cpp136
1 files changed, 68 insertions, 68 deletions
diff --git a/src/server/worldserver/Master.cpp b/src/server/worldserver/Master.cpp
index 81f13d5144a..ce4b322cb4a 100755
--- a/src/server/worldserver/Master.cpp
+++ b/src/server/worldserver/Master.cpp
@@ -82,7 +82,7 @@ public:
{
if (!_delaytime)
return;
- sLog.outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000);
+ sLog->outString("Starting up anti-freeze thread (%u seconds max stuck time)...",_delaytime/1000);
m_loops = 0;
w_loops = 0;
m_lastchange = 0;
@@ -100,11 +100,11 @@ public:
// possible freeze
else if (getMSTimeDiff(w_lastchange,curtime) > _delaytime)
{
- sLog.outError("World Thread hangs, kicking out server!");
+ sLog->outError("World Thread hangs, kicking out server!");
*((uint32 volatile*)NULL) = 0; // bang crash
}
}
- sLog.outString("Anti-freeze thread exiting without problems.");
+ sLog->outString("Anti-freeze thread exiting without problems.");
}
};
@@ -122,38 +122,38 @@ int Master::Run()
BigNumber seed1;
seed1.SetRand(16 * 8);
- sLog.outString( "%s (core-daemon)", _FULLVERSION );
- sLog.outString( "<Ctrl-C> to stop.\n" );
+ sLog->outString( "%s (core-daemon)", _FULLVERSION );
+ sLog->outString( "<Ctrl-C> to stop.\n" );
- sLog.outString( " ______ __");
- sLog.outString( "/\\__ _\\ __ __/\\ \\__");
- sLog.outString( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __");
- sLog.outString( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
- sLog.outString( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
- sLog.outString( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
- sLog.outString( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
- sLog.outString( " C O R E /\\___/");
- sLog.outString( "http://TrinityCore.org \\/__/\n");
+ sLog->outString( " ______ __");
+ sLog->outString( "/\\__ _\\ __ __/\\ \\__");
+ sLog->outString( "\\/_/\\ \\/ _ __ /\\_\\ ___ /\\_\\ \\ ,_\\ __ __");
+ sLog->outString( " \\ \\ \\/\\`'__\\/\\ \\ /' _ `\\/\\ \\ \\ \\/ /\\ \\/\\ \\");
+ sLog->outString( " \\ \\ \\ \\ \\/ \\ \\ \\/\\ \\/\\ \\ \\ \\ \\ \\_\\ \\ \\_\\ \\");
+ sLog->outString( " \\ \\_\\ \\_\\ \\ \\_\\ \\_\\ \\_\\ \\_\\ \\__\\\\/`____ \\");
+ sLog->outString( " \\/_/\\/_/ \\/_/\\/_/\\/_/\\/_/\\/__/ `/___/> \\");
+ sLog->outString( " C O R E /\\___/");
+ sLog->outString( "http://TrinityCore.org \\/__/\n");
#ifdef USE_SFMT_FOR_RNG
- sLog.outString( "\n");
- sLog.outString( "SFMT has been enabled as the random number generator, if worldserver");
- sLog.outString( "freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration");
- sLog.outString( "\n");
+ sLog->outString( "\n");
+ sLog->outString( "SFMT has been enabled as the random number generator, if worldserver");
+ sLog->outString( "freezes or crashes randomly, first, try disabling SFMT in CMAKE configuration");
+ sLog->outString( "\n");
#endif //USE_SFMT_FOR_RNG
/// worldd PID file creation
- std::string pidfile = sConfig.GetStringDefault("PidFile", "");
+ std::string pidfile = sConfig->GetStringDefault("PidFile", "");
if(!pidfile.empty())
{
uint32 pid = CreatePIDFile(pidfile);
if( !pid )
{
- sLog.outError( "Cannot create PID file %s.\n", pidfile.c_str() );
+ sLog->outError( "Cannot create PID file %s.\n", pidfile.c_str() );
return 1;
}
- sLog.outString( "Daemon PID: %u\n", pid );
+ sLog->outString( "Daemon PID: %u\n", pid );
}
///- Start the databases
@@ -161,7 +161,7 @@ int Master::Run()
return 1;
///- Initialize the World
- sWorld.SetInitialWorldSettings();
+ sWorld->SetInitialWorldSettings();
// Initialise the signal handlers
@@ -189,9 +189,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 (sConfig->GetBoolDefault("Console.Enable", true) && (m_ServiceStatus == -1)/* need disable console in service mode*/)
#else
- if (sConfig.GetBoolDefault("Console.Enable", true))
+ if (sConfig->GetBoolDefault("Console.Enable", true))
#endif
{
///- Launch CliRunnable thread
@@ -205,7 +205,7 @@ int Master::Run()
{
HANDLE hProcess = GetCurrentProcess();
- uint32 Aff = sConfig.GetIntDefault("UseProcessors", 0);
+ uint32 Aff = sConfig->GetIntDefault("UseProcessors", 0);
if(Aff > 0)
{
ULONG_PTR appAff;
@@ -217,39 +217,39 @@ int Master::Run()
if(!curAff )
{
- sLog.outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff);
+ sLog->outError("Processors marked in UseProcessors bitmask (hex) %x not accessible for Trinityd. Accessible processors bitmask (hex): %x",Aff,appAff);
}
else
{
if(SetProcessAffinityMask(hProcess,curAff))
- sLog.outString("Using processors (bitmask, hex): %x", curAff);
+ sLog->outString("Using processors (bitmask, hex): %x", curAff);
else
- sLog.outError("Can't set used processors (hex): %x",curAff);
+ sLog->outError("Can't set used processors (hex): %x",curAff);
}
}
- sLog.outString("");
+ sLog->outString("");
}
- bool Prio = sConfig.GetBoolDefault("ProcessPriority", false);
+ bool Prio = sConfig->GetBoolDefault("ProcessPriority", false);
// if(Prio && (m_ServiceStatus == -1)/* need set to default process priority class in service mode*/)
if(Prio)
{
if(SetPriorityClass(hProcess,HIGH_PRIORITY_CLASS))
- sLog.outString("TrinityCore process priority class set to HIGH");
+ sLog->outString("TrinityCore process priority class set to HIGH");
else
- sLog.outError("Can't set Trinityd process priority class.");
- sLog.outString("");
+ sLog->outError("Can't set Trinityd process priority class.");
+ sLog->outString("");
}
}
#endif
//Start soap serving thread
ACE_Based::Thread* soap_thread = NULL;
- if(sConfig.GetBoolDefault("SOAP.Enabled", false))
+ if(sConfig->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(sConfig->GetStringDefault("SOAP.IP", "127.0.0.1"), sConfig->GetIntDefault("SOAP.Port", 7878));
soap_thread = new ACE_Based::Thread(runnable);
}
@@ -257,7 +257,7 @@ int Master::Run()
realCurrTime = realPrevTime = getMSTime();
///- Start up freeze catcher thread
- if(uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0))
+ if(uint32 freeze_delay = sConfig->GetIntDefault("MaxCoreStuckTime", 0))
{
FreezeDetectorRunnable *fdr = new FreezeDetectorRunnable();
fdr->SetDelayTime(freeze_delay*1000);
@@ -266,12 +266,12 @@ 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");
+ uint16 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)
{
- sLog.outError ("Failed to start network");
+ sLog->outError ("Failed to start network");
World::StopNow(ERROR_EXIT_CODE);
// go down and shutdown the server
}
@@ -301,7 +301,7 @@ int Master::Run()
WorldDatabase.Close();
LoginDatabase.Close();
- sLog.outString( "Halting process..." );
+ sLog->outString( "Halting process..." );
if (cliThread)
{
@@ -364,95 +364,95 @@ int Master::Run()
/// Initialize connection to the databases
bool Master::_StartDB()
{
- sLog.SetLogDB(false);
+ sLog->SetLogDB(false);
std::string dbstring;
uint8 async_threads, synch_threads;
- dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", "");
+ dbstring = sConfig->GetStringDefault("WorldDatabaseInfo", "");
if (dbstring.empty())
{
- sLog.outError("World database not specified in configuration file");
+ sLog->outError("World database not specified in configuration file");
return false;
}
- async_threads = sConfig.GetIntDefault("WorldDatabase.WorkerThreads", 1);
+ async_threads = sConfig->GetIntDefault("WorldDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog.outError("World database: invalid number of worker threads specified. "
+ sLog->outError("World database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
- synch_threads = sConfig.GetIntDefault("WorldDatabase.SynchThreads", 1);
+ synch_threads = sConfig->GetIntDefault("WorldDatabase.SynchThreads", 1);
///- Initialise the world database
if (!WorldDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog.outError("Cannot connect to world database %s", dbstring.c_str());
+ sLog->outError("Cannot connect to world database %s", dbstring.c_str());
return false;
}
///- Get character database info from configuration file
- dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", "");
+ dbstring = sConfig->GetStringDefault("CharacterDatabaseInfo", "");
if (dbstring.empty())
{
- sLog.outError("Character database not specified in configuration file");
+ sLog->outError("Character database not specified in configuration file");
return false;
}
- async_threads = sConfig.GetIntDefault("CharacterDatabase.WorkerThreads", 1);
+ async_threads = sConfig->GetIntDefault("CharacterDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog.outError("Character database: invalid number of worker threads specified. "
+ sLog->outError("Character database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
- synch_threads = sConfig.GetIntDefault("CharacterDatabase.SynchThreads", 2);
+ synch_threads = sConfig->GetIntDefault("CharacterDatabase.SynchThreads", 2);
///- Initialise the Character database
if (!CharacterDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog.outError("Cannot connect to Character database %s", dbstring.c_str());
+ sLog->outError("Cannot connect to Character database %s", dbstring.c_str());
return false;
}
///- Get login database info from configuration file
- dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
+ dbstring = sConfig->GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
- sLog.outError("Login database not specified in configuration file");
+ sLog->outError("Login database not specified in configuration file");
return false;
}
- async_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1);
+ async_threads = sConfig->GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (async_threads < 1 || async_threads > 32)
{
- sLog.outError("Login database: invalid number of worker threads specified. "
+ sLog->outError("Login database: invalid number of worker threads specified. "
"Please pick a value between 1 and 32.");
return false;
}
- synch_threads = sConfig.GetIntDefault("LoginDatabase.SynchThreads", 1);
+ synch_threads = sConfig->GetIntDefault("LoginDatabase.SynchThreads", 1);
///- Initialise the login database
if (!LoginDatabase.Open(dbstring, async_threads, synch_threads))
{
- sLog.outError("Cannot connect to login database %s", dbstring.c_str());
+ sLog->outError("Cannot connect to login database %s", dbstring.c_str());
return false;
}
///- Get the realm Id from the configuration file
- realmID = sConfig.GetIntDefault("RealmID", 0);
+ realmID = sConfig->GetIntDefault("RealmID", 0);
if (!realmID)
{
- sLog.outError("Realm ID not defined in configuration file");
+ sLog->outError("Realm ID not defined in configuration file");
return false;
}
- sLog.outString("Realm running as realm ID %d", realmID);
+ 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.SetLogDB(false);
- sLog.SetRealmID(realmID);
+ sLog->SetLogDBLater(sConfig->GetBoolDefault("EnableLogDB", false)); // set var to enable DB logging once startup finished.
+ sLog->SetLogDB(false);
+ sLog->SetRealmID(realmID);
///- Clean the database before starting
clearOnlineAccounts();
@@ -460,10 +460,10 @@ bool Master::_StartDB()
///- Insert version info into DB
WorldDatabase.PExecute("UPDATE version SET core_version = '%s', core_revision = '%s'", _FULLVERSION, _REVISION);
- sWorld.LoadDBVersion();
+ sWorld->LoadDBVersion();
- sLog.outString("Using World DB: %s", sWorld.GetDBVersion());
- sLog.outString("Using creature EventAI: %s", sWorld.GetCreatureEventAIVersion());
+ sLog->outString("Using World DB: %s", sWorld->GetDBVersion());
+ sLog->outString("Using creature EventAI: %s", sWorld->GetCreatureEventAIVersion());
return true;
}