* HIGHLY EXPERIMENTAL - USE AT OWN RISK *
Database Layer: - Implement connection pooling: Instead of 1 delay thread per database, you can configure between 1 and 32 worker threads that have a seperate thread in the core and have a seperate connection to the MySQL server (based on raczman/Albator´s database layer for Trinitycore3) - Implement a configurable thread bundle for synchroneous requests from seperate core threads (see worldserver.conf.dist for more info) - Every mapupdate thread now has its seperate MySQL connection to the world and characters database - Drop inconsistent PExecuteLog function - query logging will be implemented CONSISTENTLY later - Drop current prepared statement interface - this will be done *properly* later - You´ll need to update your worldserver.conf and authserver.conf - You´re recommended to make a backup of your databases before using this. * HIGHLY EXPERIMENTAL - USE AT OWN RISK * * HIGHLY EXPERIMENTAL - USE AT OWN RISK * etc. --HG-- branch : trunk
This commit is contained in:
1 parent
1ab2bd6d58
commit
87218eadcd
39 files changed
+1568
-731
No files matched your search
@@ -370,9 +370,9 @@ int Master::Run()
|
||||
clearOnlineAccounts();
|
||||
|
||||
///- Wait for delay threads to end
|
||||
CharacterDatabase.HaltDelayThread();
|
||||
WorldDatabase.HaltDelayThread();
|
||||
LoginDatabase.HaltDelayThread();
|
||||
CharacterDatabase.Close();
|
||||
WorldDatabase.Close();
|
||||
LoginDatabase.Close();
|
||||
|
||||
sLog.outString( "Halting process..." );
|
||||
|
||||
@@ -439,8 +439,8 @@ bool Master::_StartDB()
|
||||
{
|
||||
sLog.SetLogDB(false);
|
||||
std::string dbstring;
|
||||
uint8 num_threads;
|
||||
|
||||
///- Get world database info from configuration file
|
||||
dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", "");
|
||||
if (dbstring.empty())
|
||||
{
|
||||
@@ -448,13 +448,20 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Initialise the world database
|
||||
if( !WorldDatabase.Initialize(dbstring.c_str()))
|
||||
num_threads = sConfig.GetIntDefault("WorldDatabase.WorkerThreads", 1);
|
||||
if (num_threads < 1 || num_threads > 32)
|
||||
{
|
||||
sLog.outError("Cannot connect to world database %s",dbstring.c_str());
|
||||
sLog.outError("World database: invalid number of worker threads specified. "
|
||||
"Please pick a value between 1 and 32.");
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Initialise the world database
|
||||
if (!WorldDatabase.Open(dbstring, num_threads))
|
||||
{
|
||||
sLog.outError("Cannot connect to world database %s", dbstring.c_str());
|
||||
return false;
|
||||
}
|
||||
///- Get character database info from configuration file
|
||||
dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", "");
|
||||
if (dbstring.empty())
|
||||
@@ -463,13 +470,20 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Initialise the Character database
|
||||
if (!CharacterDatabase.Initialize(dbstring.c_str()))
|
||||
num_threads = sConfig.GetIntDefault("CharacterDatabase.WorkerThreads", 1);
|
||||
if (num_threads < 1 || num_threads > 32)
|
||||
{
|
||||
sLog.outError("Cannot connect to Character database %s",dbstring.c_str());
|
||||
sLog.outError("Character database: invalid number of worker threads specified. "
|
||||
"Please pick a value between 1 and 32.");
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Initialise the Character database
|
||||
if (!CharacterDatabase.Open(dbstring, num_threads))
|
||||
{
|
||||
sLog.outError("Cannot connect to Character database %s", dbstring.c_str());
|
||||
return false;
|
||||
}
|
||||
///- Get login database info from configuration file
|
||||
dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
|
||||
if (dbstring.empty())
|
||||
@@ -478,13 +492,20 @@ bool Master::_StartDB()
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Initialise the login database
|
||||
if (!LoginDatabase.Initialize(dbstring.c_str()))
|
||||
num_threads = sConfig.GetIntDefault("LoginDatabase.WorkerThreads", 1);
|
||||
if (num_threads < 1 || num_threads > 32)
|
||||
{
|
||||
sLog.outError("Cannot connect to login database %s",dbstring.c_str());
|
||||
sLog.outError("Login database: invalid number of worker threads specified. "
|
||||
"Please pick a value between 1 and 32.");
|
||||
return false;
|
||||
}
|
||||
|
||||
///- Initialise the login database
|
||||
if (!LoginDatabase.Open(dbstring, num_threads))
|
||||
{
|
||||
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);
|
||||
if (!realmID)
|
||||
|
||||
Reference in new issue
Block a user