mirror of
https://github.com/mangosfour/server.git
synced 2025-12-16 13:37:00 +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
|
|
@ -50,7 +50,7 @@ char serviceDescription[] = "Massive Network Game Object Server";
|
|||
int m_ServiceStatus = -1;
|
||||
#endif
|
||||
|
||||
bool StartDB(std::string &dbstring);
|
||||
bool StartDB();
|
||||
void UnhookSignals();
|
||||
void HookSignals();
|
||||
|
||||
|
|
@ -187,8 +187,7 @@ extern int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
///- Initialize the database connection
|
||||
std::string dbstring;
|
||||
if(!StartDB(dbstring))
|
||||
if(!StartDB())
|
||||
return 1;
|
||||
|
||||
///- Get the list of realms for the server
|
||||
|
|
@ -312,9 +311,10 @@ void OnSignal(int s)
|
|||
}
|
||||
|
||||
/// Initialize connection to the database
|
||||
bool StartDB(std::string &dbstring)
|
||||
bool StartDB()
|
||||
{
|
||||
if(!sConfig.GetString("LoginDatabaseInfo", &dbstring))
|
||||
std::string dbstring = sConfig.GetStringDefault("LoginDatabaseInfo", "");
|
||||
if(dbstring.empty())
|
||||
{
|
||||
sLog.outError("Database not specified");
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue