mirror of
https://github.com/mangosfour/server.git
synced 2025-12-17 16:37:00 +00:00
[8441] Implement check DBs versions (required_* fields) at mangosd/realmd loading.
* git_id updated to generate revision_sql.h file with required_* fields strings. * mangosd/realmd changed to include header and check this strings at startup. * mangosd/realmd will terminated if related strings not match in DB content. In most cases this meaning that not all expected sql updates applied. Current required_* field stored in DB output in error to help find what last sql updates applied. IMPORTNAT NOTE for mangos devs: please update used git_id before adding next commits with sql updates!
This commit is contained in:
parent
c9f475dfa0
commit
8a7b77c088
7 changed files with 111 additions and 7 deletions
|
|
@ -38,6 +38,7 @@
|
|||
#include "RASocket.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "Util.h"
|
||||
#include "revision_sql.h"
|
||||
|
||||
#include "sockets/TcpSocket.h"
|
||||
#include "sockets/Utility.h"
|
||||
|
|
@ -416,6 +417,9 @@ bool Master::_StartDB()
|
|||
return false;
|
||||
}
|
||||
|
||||
if(!WorldDatabase.CheckRequiredField("db_version",REVISION_DB_MANGOS))
|
||||
return false;
|
||||
|
||||
if(!sConfig.GetString("CharacterDatabaseInfo", &dbstring))
|
||||
{
|
||||
sLog.outError("Character Database not specified in configuration file");
|
||||
|
|
@ -430,6 +434,9 @@ bool Master::_StartDB()
|
|||
return false;
|
||||
}
|
||||
|
||||
if(!CharacterDatabase.CheckRequiredField("character_db_version",REVISION_DB_CHARACTERS))
|
||||
return false;
|
||||
|
||||
///- Get login database info from configuration file
|
||||
if(!sConfig.GetString("LoginDatabaseInfo", &dbstring))
|
||||
{
|
||||
|
|
@ -445,6 +452,9 @@ bool Master::_StartDB()
|
|||
return false;
|
||||
}
|
||||
|
||||
if(!loginDatabase.CheckRequiredField("realmd_db_version",REVISION_DB_REALMD))
|
||||
return false;
|
||||
|
||||
///- Get the realm Id from the configuration file
|
||||
realmID = sConfig.GetIntDefault("RealmID", 0);
|
||||
if(!realmID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue