Core/Updates: Add an automatic database update system. Automatically detects new and edited sql updates through file lists and hashing. Detects renames, deletes and is able to create and auto import full databases. * cleanups in main.cpp of world & bnetserver * refactoring in DatabaseWorkerPool.h & MySQLConnection.cpp

Make sure you re-run cmake, because boost::iostreams was added as dependency.
Maybe you need to install libboost-iostreams1.55-dev on unix as well.

Import every update manual until (included) those INSERT IGNORE updates for each database.

Thanks DDuarte and Shauren for your amazing ideas, help and advises.

In hope that nobody gets a "Your database structure is not up to date..." anymore ,-)

(cherry picked from commit 352012e53173372ebc82898e1b6854c983b01b25)
(cherry picked from commit 1f7f9feafc3f5017d617634ae993d2cdf4430920)

For 3.3.5:
* Synchronized ConfigureBoost.cmake with 6.x, libboost-filesystem1.55-dev also added as dependency!

Signed-off-by: Naios <naios-dev@live.de>
Signed-off-by: Nayd <dnpd.dd@gmail.com>
This commit is contained in:
Naios authored and Nayd committed 2015-03-21 20:54:54 +00:00
1 parent 236e43443c
commit 2bd1c8541d
122 files changed
+6736 -138

No files matched your search

+9 -26
View File
@@ -28,6 +28,7 @@
#include "Common.h"
#include "Config.h"
#include "DatabaseEnv.h"
#include "DatabaseLoader.h"
#include "Log.h"
#include "ProcessPriority.h"
#include "RealmList.h"
@@ -150,33 +151,15 @@ bool StartDB()
{
MySQL::Library_Init();
std::string dbstring = sConfigMgr->GetStringDefault("LoginDatabaseInfo", "");
if (dbstring.empty())
{
TC_LOG_ERROR("server.authserver", "Database not specified");
// Load databases
// NOTE: While authserver is singlethreaded you should keep synch_threads == 1.
// Increasing it is just silly since only 1 will be used ever.
DatabaseLoader loader("server.authserver", DatabaseLoader::DATABASE_NONE);
loader
.AddDatabase(LoginDatabase, "Login");
if (!loader.Load())
return false;
}
int32 worker_threads = sConfigMgr->GetIntDefault("LoginDatabase.WorkerThreads", 1);
if (worker_threads < 1 || worker_threads > 32)
{
TC_LOG_ERROR("server.authserver", "Improper value specified for LoginDatabase.WorkerThreads, defaulting to 1.");
worker_threads = 1;
}
int32 synch_threads = sConfigMgr->GetIntDefault("LoginDatabase.SynchThreads", 1);
if (synch_threads < 1 || synch_threads > 32)
{
TC_LOG_ERROR("server.authserver", "Improper value specified for LoginDatabase.SynchThreads, defaulting to 1.");
synch_threads = 1;
}
// NOTE: While authserver is singlethreaded you should keep synch_threads == 1. Increasing it is just silly since only 1 will be used ever.
if (!LoginDatabase.Open(dbstring, uint8(worker_threads), uint8(synch_threads)))
{
TC_LOG_ERROR("server.authserver", "Cannot connect to database");
return false;
}
TC_LOG_INFO("server.authserver", "Started auth database connection pool.");
sLog->SetRealmId(0); // Enables DB appenders when realm is set.