diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/account-server/accounthandler.cpp | 13 | ||||
-rw-r--r-- | src/account-server/accounthandler.hpp | 3 | ||||
-rw-r--r-- | src/account-server/main-account.cpp | 10 | ||||
-rw-r--r-- | src/game-server/attributemanager.cpp | 6 | ||||
-rw-r--r-- | src/game-server/main-game.cpp | 2 |
5 files changed, 20 insertions, 14 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); diff --git a/src/account-server/accounthandler.hpp b/src/account-server/accounthandler.hpp index 5fa2a06f..f1ffcfe2 100644 --- a/src/account-server/accounthandler.hpp +++ b/src/account-server/accounthandler.hpp @@ -28,7 +28,8 @@ namespace AccountClientHandler /** * Creates a connection handler and starts listening on given port. */ - bool initialize(int port, const std::string &host); + bool initialize(const std::string &configFile, int port, + const std::string &host); /** * Stops listening to messages and destroys the connection handler. diff --git a/src/account-server/main-account.cpp b/src/account-server/main-account.cpp index e43f1a65..a059c38e 100644 --- a/src/account-server/main-account.cpp +++ b/src/account-server/main-account.cpp @@ -50,9 +50,10 @@ using utils::Logger; // Default options that automake should be able to override. -#define DEFAULT_LOG_FILE "manaserv-account.log" -#define DEFAULT_STATS_FILE "manaserv.stats" -#define DEFAULT_CONFIG_FILE "manaserv.xml" +#define DEFAULT_LOG_FILE "manaserv-account.log" +#define DEFAULT_STATS_FILE "manaserv.stats" +#define DEFAULT_CONFIG_FILE "manaserv.xml" +#define DEFAULT_ATTRIBUTEDB_FILE "attributes.xml" static bool running = true; /**< Determines if server keeps running */ @@ -339,7 +340,8 @@ int main(int argc, char *argv[]) initialize(); std::string host = Configuration::getValue("net_listenHost", std::string()); - if (!AccountClientHandler::initialize(options.port, host) || + if (!AccountClientHandler::initialize(DEFAULT_ATTRIBUTEDB_FILE, + options.port, host) || !GameServerHandler::initialize(options.port + 1, host) || !chatHandler->startListen(options.port + 2, host)) { diff --git a/src/game-server/attributemanager.cpp b/src/game-server/attributemanager.cpp index f62abbc1..817eb6d6 100644 --- a/src/game-server/attributemanager.cpp +++ b/src/game-server/attributemanager.cpp @@ -43,7 +43,8 @@ void AttributeManager::reload() absPathFile = ResourceManager::resolve(mAttributeReferenceFile); if (absPathFile.empty()) { - LOG_ERROR("Attribute Manager: Could not find " << mAttributeReferenceFile << "!"); + LOG_FATAL("Attribute Manager: Could not find " << mAttributeReferenceFile << "!"); + exit(3); return; } @@ -52,8 +53,9 @@ void AttributeManager::reload() if (!node || !xmlStrEqual(node->name, BAD_CAST "stats")) { - LOG_ERROR("Attribute Manager: " << mAttributeReferenceFile + LOG_FATAL("Attribute Manager: " << mAttributeReferenceFile << " is not a valid database file!"); + exit(3); return; } diff --git a/src/game-server/main-game.cpp b/src/game-server/main-game.cpp index 405ec68f..5c146dea 100644 --- a/src/game-server/main-game.cpp +++ b/src/game-server/main-game.cpp @@ -66,7 +66,7 @@ using utils::Logger; #define DEFAULT_ITEMSDB_FILE "items.xml" #define DEFAULT_EQUIPDB_FILE "equip.xml" #define DEFAULT_SKILLSDB_FILE "mana-skills.xml" -#define DEFAULT_ATTRIBUTEDB_FILE "stats.xml" +#define DEFAULT_ATTRIBUTEDB_FILE "attributes.xml" #define DEFAULT_MAPSDB_FILE "maps.xml" #define DEFAULT_MONSTERSDB_FILE "monsters.xml" #define DEFAULT_STATUSDB_FILE "mana-status-effect.xml" |