summaryrefslogtreecommitdiff
path: root/src/net/ea/loginhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-04-06 02:15:54 +0300
committerAndrei Karas <akaras@inbox.ru>2013-04-06 02:15:54 +0300
commitd70cdbc7ab543988d16712a5981a54bd853620cc (patch)
tree46ecb257860ad2c12c3818abcb7c4a6c87d175ff /src/net/ea/loginhandler.cpp
parent0d3b6da53db29cdf0ee2648fb9b0a02dd1d82dc8 (diff)
downloadplus-d70cdbc7ab543988d16712a5981a54bd853620cc.tar.gz
plus-d70cdbc7ab543988d16712a5981a54bd853620cc.tar.bz2
plus-d70cdbc7ab543988d16712a5981a54bd853620cc.tar.xz
plus-d70cdbc7ab543988d16712a5981a54bd853620cc.zip
improve loginhandler class.
Diffstat (limited to 'src/net/ea/loginhandler.cpp')
-rw-r--r--src/net/ea/loginhandler.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 56538687f..ea4452528 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -50,18 +50,18 @@ LoginHandler::~LoginHandler()
delete_all(mWorlds);
}
-bool LoginHandler::isRegistrationEnabled()
+bool LoginHandler::isRegistrationEnabled() const
{
return mRegistrationEnabled;
}
-void LoginHandler::getRegistrationDetails()
+void LoginHandler::getRegistrationDetails() const
{
// Not supported, so move on
Client::setState(STATE_REGISTER);
}
-void LoginHandler::loginAccount(LoginData *loginData)
+void LoginHandler::loginAccount(LoginData *const loginData) const
{
if (loginData)
@@ -76,7 +76,7 @@ void LoginHandler::loginAccount(LoginData *loginData)
}
}
-void LoginHandler::chooseServer(unsigned int server)
+void LoginHandler::chooseServer(const unsigned int server) const
{
if (server >= mWorlds.size() || !mWorlds[server])
return;
@@ -94,7 +94,7 @@ void LoginHandler::chooseServer(unsigned int server)
Client::setState(STATE_UPDATE);
}
-void LoginHandler::registerAccount(LoginData *loginData)
+void LoginHandler::registerAccount(LoginData *const loginData) const
{
if (!loginData)
return;
@@ -130,7 +130,7 @@ void LoginHandler::clearWorlds()
mWorlds.clear();
}
-void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg)
+void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg) const
{
// 0: acc not found, 1: success, 2: password mismatch, 3: pass too short
const int errMsg = msg.readInt8();
@@ -164,9 +164,7 @@ void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg)
void LoginHandler::processUpdateHost(Net::MessageIn &msg)
{
- int len;
-
- len = msg.readInt16() - 4;
+ int len = msg.readInt16() - 4;
mUpdateHost = msg.readString(len);
if (!checkPath(mUpdateHost))
@@ -221,7 +219,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
Client::setState(STATE_WORLD_SELECT);
}
-void LoginHandler::processLoginError(Net::MessageIn &msg)
+void LoginHandler::processLoginError(Net::MessageIn &msg) const
{
const int code = msg.readInt8();
logger->log("Login::error code: %i", code);
@@ -277,18 +275,19 @@ void LoginHandler::processLoginError(Net::MessageIn &msg)
Client::setState(STATE_ERROR);
}
-void LoginHandler::logout()
+void LoginHandler::logout() const
{
// TODO
}
-void LoginHandler::changeEmail(const std::string &email A_UNUSED)
+void LoginHandler::changeEmail(const std::string &email A_UNUSED) const
{
// TODO
}
void LoginHandler::unregisterAccount(const std::string &username A_UNUSED,
- const std::string &password A_UNUSED)
+ const std::string &password
+ A_UNUSED) const
{
// TODO
}