* Fixed/improved the config library: Removed useless methods and fixed the existing.

* Few related changes to make the rest of the core reflect the changes.

--HG--
branch : trunk
This commit is contained in:
XTZGZoReX
2009-03-18 20:46:39 +01:00
parent 5f2e9f1ed1
commit 5184783bd1
5 changed files with 46 additions and 122 deletions

View File

@@ -625,17 +625,18 @@ extern void AddSC_zulaman();
void LoadDatabase()
{
//Get db string from file
char const* dbstring = NULL;
std::string dbstring;
TScriptConfig.GetStringDefault("WorldDatabaseInfo", "");
if (!TScriptConfig.GetString("WorldDatabaseInfo", &dbstring) )
if (dbstring.empty() )
{
error_log("TSCR: Missing world database info from configuration file. Load database aborted.");
return;
}
//Initialize connection to DB
if (dbstring && TScriptDB.Initialize(dbstring) )
outstring_log("TSCR: TrinityScript database: %s",dbstring);
if (!dbstring.empty() && TScriptDB.Initialize(dbstring.c_str()) )
outstring_log("TSCR: TrinityScript database: %s",dbstring.c_str());
else
{
error_log("TSCR: Unable to connect to Database. Load database aborted.");