mirror of
https://github.com/mangosfour/server.git
synced 2025-12-18 01:37:01 +00:00
[8645] Cleanup code for config loading/store/access.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
4d3e43e814
commit
aff1a3e59f
9 changed files with 532 additions and 474 deletions
|
|
@ -398,8 +398,8 @@ int Master::Run()
|
|||
bool Master::_StartDB()
|
||||
{
|
||||
///- Get world database info from configuration file
|
||||
std::string dbstring;
|
||||
if(!sConfig.GetString("WorldDatabaseInfo", &dbstring))
|
||||
std::string dbstring = sConfig.GetStringDefault("WorldDatabaseInfo", "");
|
||||
if(dbstring.empty())
|
||||
{
|
||||
sLog.outError("Database not specified in configuration file");
|
||||
return false;
|
||||
|
|
@ -416,7 +416,8 @@ bool Master::_StartDB()
|
|||
if(!WorldDatabase.CheckRequiredField("db_version",REVISION_DB_MANGOS))
|
||||
return false;
|
||||
|
||||
if(!sConfig.GetString("CharacterDatabaseInfo", &dbstring))
|
||||
dbstring = sConfig.GetStringDefault("CharacterDatabaseInfo", "");
|
||||
if(dbstring.empty())
|
||||
{
|
||||
sLog.outError("Character Database not specified in configuration file");
|
||||
return false;
|
||||
|
|
@ -434,7 +435,8 @@ bool Master::_StartDB()
|
|||
return false;
|
||||
|
||||
///- Get login database info from configuration file
|
||||
if(!sConfig.GetString("LoginDatabaseInfo", &dbstring))
|
||||
dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
|
||||
if(dbstring.empty())
|
||||
{
|
||||
sLog.outError("Login database not specified in configuration file");
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue