diff options
author | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-09-22 18:45:57 +0000 |
---|---|---|
committer | Guillaume Melquiond <guillaume.melquiond@gmail.com> | 2007-09-22 18:45:57 +0000 |
commit | ac5375e554e882e0b56eeed9b6e51c06c8d37656 (patch) | |
tree | 8c0095d23e880ab112dacc7e94505aac86d04dd7 /src/account-server/accounthandler.cpp | |
parent | 88e3d219588052a8ab222ab4f6f2b27c9c29c1b2 (diff) | |
download | manaserv-ac5375e554e882e0b56eeed9b6e51c06c8d37656.tar.gz manaserv-ac5375e554e882e0b56eeed9b6e51c06c8d37656.tar.bz2 manaserv-ac5375e554e882e0b56eeed9b6e51c06c8d37656.tar.xz manaserv-ac5375e554e882e0b56eeed9b6e51c06c8d37656.zip |
Cleaned both configuration and resource managers.
Diffstat (limited to 'src/account-server/accounthandler.cpp')
-rw-r--r-- | src/account-server/accounthandler.cpp | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index 9eb6264e..77e66660 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -24,7 +24,6 @@ #include "account-server/accounthandler.hpp" #include "defines.h" -#include "configuration.h" #include "point.h" #include "account-server/account.hpp" #include "account-server/accountclient.hpp" @@ -34,6 +33,7 @@ #include "account-server/guildmanager.hpp" #include "account-server/serverhandler.hpp" #include "chat-server/chathandler.hpp" +#include "common/configuration.hpp" #include "net/connectionhandler.hpp" #include "net/messagein.hpp" #include "net/messageout.hpp" @@ -182,7 +182,7 @@ AccountHandler::handleLoginMessage(AccountClient &computer, MessageIn &msg) int clientVersion = msg.readLong(); - if (clientVersion < config.getValue("clientVersion", 0)) + if (clientVersion < Configuration::getValue("clientVersion", 0)) { reply.writeByte(LOGIN_INVALID_VERSION); computer.send(reply); @@ -296,7 +296,7 @@ AccountHandler::handleRegisterMessage(AccountClient &computer, MessageIn &msg) { reply.writeByte(ERRMSG_FAILURE); } - else if (clientVersion < config.getValue("clientVersion", 0)) + else if (clientVersion < Configuration::getValue("clientVersion", 0)) { reply.writeByte(REGISTER_INVALID_VERSION); } @@ -392,8 +392,8 @@ AccountHandler::handleUnregisterMessage(AccountClient &computer, } // Delete account and associated characters - LOG_DEBUG("Unregistered \"" << username - << "\", AccountID: " << acc->getID()); + LOG_INFO("Unregistered \"" << username + << "\", AccountID: " << acc->getID()); storage->delAccount(acc); reply.writeByte(ERRMSG_OK); @@ -589,9 +589,9 @@ AccountHandler::handleCharacterCreateMessage(AccountClient &computer, newCharacter->setGender(gender); newCharacter->setHairStyle(hairStyle); newCharacter->setHairColor(hairColor); - newCharacter->setMapId((int) config.getValue("defaultMap", 1)); - Point startingPos((int) config.getValue("startX", 512), - (int) config.getValue("startY", 512)); + newCharacter->setMapId(Configuration::getValue("defaultMap", 1)); + Point startingPos(Configuration::getValue("startX", 512), + Configuration::getValue("startY", 512)); newCharacter->setPosition(startingPos); acc->addCharacter(newCharacter); @@ -660,9 +660,10 @@ handleCharacterSelectMessage(AccountClient &computer, MessageIn &msg) reply.writeShort(port); // TODO: get correct address and port for the chat server - reply.writeString(config.getValue("accountServerAddress", "localhost")); - reply.writeShort(int(config.getValue("accountServerPort", - DEFAULT_SERVER_PORT)) + 2); + reply.writeString(Configuration::getValue("accountServerAddress", + "localhost")); + reply.writeShort(Configuration::getValue("accountServerPort", + DEFAULT_SERVER_PORT) + 2); serverHandler->registerGameClient(magic_token, selectedChar); registerChatClient(magic_token, selectedChar->getName(), AL_NORMAL); |