summaryrefslogtreecommitdiff
path: root/src/resources/settingsmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/settingsmanager.cpp')
-rw-r--r--src/resources/settingsmanager.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/src/resources/settingsmanager.cpp b/src/resources/settingsmanager.cpp
index 9323d4d1..3dfb5eb4 100644
--- a/src/resources/settingsmanager.cpp
+++ b/src/resources/settingsmanager.cpp
@@ -27,6 +27,7 @@
#include "resources/monsterdb.h"
#include "resources/npcdb.h"
#include "resources/abilitydb.h"
+#include "resources/questdb.h"
#include "resources/statuseffectdb.h"
#include "net/net.h"
@@ -38,6 +39,9 @@
#include "log.h"
#include "units.h"
+#include <string>
+#include <set>
+
namespace SettingsManager
{
static std::string mSettingsFile;
@@ -53,6 +57,7 @@ namespace SettingsManager
hairDB.init();
itemDb->init();
MonsterDB::init();
+ QuestDB::init();
AbilityDB::init();
NPCDB::init();
EmoteDB::init();
@@ -96,6 +101,7 @@ namespace SettingsManager
NPCDB::unload();
AbilityDB::unload();
MonsterDB::unload();
+ QuestDB::unload();
if (itemDb)
itemDb->unload();
hairDB.unload();
@@ -107,7 +113,7 @@ namespace SettingsManager
*/
static bool loadFile(const std::string &filename)
{
- logger->log("Loading game settings from %s", filename.c_str());
+ Log::info("Loading game settings from %s", filename.c_str());
XML::Document doc(filename);
XML::Node node = doc.rootNode();
@@ -118,7 +124,7 @@ namespace SettingsManager
// FIXME: check root node's name when bjorn decides it's time
if (!node /*|| node.name() != "settings" */)
{
- logger->log("Settings Manager: %s is not a valid settings file!", filename.c_str());
+ Log::info("Settings Manager: %s is not a valid settings file!", filename.c_str());
return false;
}
@@ -156,7 +162,7 @@ namespace SettingsManager
// check if we're not entering a loop
if (mIncludedFiles.find(includeFile) != mIncludedFiles.end())
{
- logger->log("Warning: Circular include loop detecting while including %s from %s", includeFile.c_str(), filename.c_str());
+ Log::warn("Circular include loop detecting while including %s from %s", includeFile.c_str(), filename.c_str());
}
else
{
@@ -165,7 +171,7 @@ namespace SettingsManager
}
else
{
- logger->log("Warning: <include> element without 'file' or 'name' attribute in %s", filename.c_str());
+ Log::warn("<include> element without 'file' or 'name' attribute in %s", filename.c_str());
}
}
else if (childNode.name() == "option")
@@ -177,7 +183,7 @@ namespace SettingsManager
if (!name.empty())
paths.setValue(name, value);
else
- logger->log("Warning: option without a name found in %s", filename.c_str());
+ Log::warn("option without a name found in %s", filename.c_str());
}
else if (childNode.name() == "attribute")
{
@@ -221,6 +227,10 @@ namespace SettingsManager
{
NPCDB::readNPCNode(childNode, filename);
}
+ else if (childNode.name() == "var")
+ {
+ QuestDB::readQuestVarNode(childNode, filename);
+ }
else if (childNode.name() == "emote")
{
EmoteDB::readEmoteNode(childNode, filename);