diff options
Diffstat (limited to 'src/account-server')
-rw-r--r-- | src/account-server/account.cpp | 24 | ||||
-rw-r--r-- | src/account-server/account.hpp | 15 | ||||
-rw-r--r-- | src/account-server/accounthandler.cpp | 2 | ||||
-rw-r--r-- | src/account-server/dalstorage.cpp | 3 |
4 files changed, 8 insertions, 36 deletions
diff --git a/src/account-server/account.cpp b/src/account-server/account.cpp index fb4e057..883654f 100644 --- a/src/account-server/account.cpp +++ b/src/account-server/account.cpp @@ -20,10 +20,10 @@ * $Id$ */ -#include "account-server/account.hpp" - #include <cassert> +#include "account-server/account.hpp" + #include "account-server/accountclient.hpp" #include "utils/functors.h" @@ -33,30 +33,14 @@ Account::Account(const std::string& name, const std::string& password, const std::string& email, + int level, int id) : mName(name), mPassword(password), mEmail(email), mCharacters(), mID(id), - mLevel(AL_NORMAL) -{ - // NOOP -} - - -/** - * Constructor with initial account info. - */ -Account::Account(const std::string& name, - const std::string& password, - const std::string& email, - const Characters& characters) - : mName(name), - mPassword(password), - mEmail(email), - mCharacters(characters), - mLevel(AL_NORMAL) + mLevel(level) { // NOOP } diff --git a/src/account-server/account.hpp b/src/account-server/account.hpp index 6b1cf8a..7c5b570 100644 --- a/src/account-server/account.hpp +++ b/src/account-server/account.hpp @@ -56,24 +56,11 @@ class Account Account(const std::string& name, const std::string& password, const std::string& email, + int level, int id = -1); /** - * Constructor with initial account info. - * - * @param name the user name. - * @param password the user password. - * @param email the user email. - * @param characters the characters. - */ - Account(const std::string& name, - const std::string& password, - const std::string& email, - const Characters& characters); - - - /** * Destructor. */ ~Account(); diff --git a/src/account-server/accounthandler.cpp b/src/account-server/accounthandler.cpp index a199a96..edb72b7 100644 --- a/src/account-server/accounthandler.cpp +++ b/src/account-server/accounthandler.cpp @@ -337,7 +337,7 @@ AccountHandler::handleRegisterMessage(AccountClient &computer, MessageIn &msg) } else { - AccountPtr acc(new Account(username, password, email)); + AccountPtr acc(new Account(username, password, email, AL_NORMAL)); store.addAccount(acc); reply.writeByte(ERRMSG_OK); diff --git a/src/account-server/dalstorage.cpp b/src/account-server/dalstorage.cpp index 612d056..5709fb7 100644 --- a/src/account-server/dalstorage.cpp +++ b/src/account-server/dalstorage.cpp @@ -234,7 +234,8 @@ AccountPtr DALStorage::getAccountBySQL(std::string const &query) // and initialize it with information about the user. AccountPtr account(new Account(accountInfo(0, 1), accountInfo(0, 2), - accountInfo(0, 3), id)); + accountInfo(0, 3), + toUint(accountInfo(0, 4)), id)); mAccounts.insert(std::make_pair(id, account)); |