summaryrefslogtreecommitdiff
path: root/src/account-server/accounthandler.cpp
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-08-02 22:59:34 +0200
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2010-08-02 23:48:29 +0200
commit5f4936e70b92a625f54d791debadf65d8fa3a02c (patch)
treeea80783c5fc66416c92abb3d8c5d21ce599ac7bb /src/account-server/accounthandler.cpp
parent9b30cad049d8f3ac9c63290331e73515d51c0260 (diff)
downloadmanaserv-5f4936e70b92a625f54d791debadf65d8fa3a02c.tar.gz
manaserv-5f4936e70b92a625f54d791debadf65d8fa3a02c.tar.bz2
manaserv-5f4936e70b92a625f54d791debadf65d8fa3a02c.tar.xz
manaserv-5f4936e70b92a625f54d791debadf65d8fa3a02c.zip
Changed the stat file name to attributes.xml.
I also made it required to start properly since it's now the case. Reviewed-by: Jaxad0127.
Diffstat (limited to 'src/account-server/accounthandler.cpp')
-rw-r--r--src/account-server/accounthandler.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp
index 0acd3f52..af04119a 100644
--- a/src/account-server/accounthandler.cpp
+++ b/src/account-server/accounthandler.cpp
@@ -43,8 +43,6 @@
#include "utils/string.hpp"
#include "utils/xml.hpp"
-#define DEFAULT_ATTRIBUTEDB_FILE "stats.xml"
-
static void addUpdateHost(MessageOut *msg)
{
std::string updateHost = Configuration::getValue("defaultUpdateHost", "");
@@ -130,7 +128,8 @@ AccountHandler::AccountHandler(const std::string &attrFile):
absPathFile = ResourceManager::resolve(attrFile);
if (absPathFile.empty()) {
- LOG_ERROR("Account handler: Could not find " << attrFile << "!");
+ LOG_FATAL("Account handler: Could not find " << attrFile << "!");
+ exit(3);
return;
}
@@ -139,8 +138,9 @@ AccountHandler::AccountHandler(const std::string &attrFile):
if (!node || !xmlStrEqual(node->name, BAD_CAST "stats"))
{
- LOG_ERROR("Account handler: " << attrFile
+ LOG_FATAL("Account handler: " << attrFile
<< " is not a valid database file!");
+ exit(3);
return;
}
for_each_xml_child_node(attributenode, node)
@@ -150,9 +150,10 @@ AccountHandler::AccountHandler(const std::string &attrFile):
}
}
-bool AccountClientHandler::initialize(int port, const std::string &host)
+bool AccountClientHandler::initialize(const std::string &configFile, int port,
+ const std::string &host)
{
- accountHandler = new AccountHandler(DEFAULT_ATTRIBUTEDB_FILE);
+ accountHandler = new AccountHandler(configFile);
LOG_INFO("Account handler started:");
return accountHandler->startListen(port, host);