summaryrefslogtreecommitdiff
path: root/src/net/eathena/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/eathena/loginhandler.cpp
parent0d3b6da53db29cdf0ee2648fb9b0a02dd1d82dc8 (diff)
downloadManaVerse-d70cdbc7ab543988d16712a5981a54bd853620cc.tar.gz
ManaVerse-d70cdbc7ab543988d16712a5981a54bd853620cc.tar.bz2
ManaVerse-d70cdbc7ab543988d16712a5981a54bd853620cc.tar.xz
ManaVerse-d70cdbc7ab543988d16712a5981a54bd853620cc.zip
improve loginhandler class.
Diffstat (limited to 'src/net/eathena/loginhandler.cpp')
-rw-r--r--src/net/eathena/loginhandler.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index eb0d1914b..d0aa9b808 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -105,7 +105,7 @@ void LoginHandler::connect()
MessageOut outMsg(CMSG_SERVER_VERSION_REQUEST);
}
-bool LoginHandler::isConnected()
+bool LoginHandler::isConnected() const
{
if (!mNetwork)
return false;
@@ -121,7 +121,7 @@ void LoginHandler::disconnect()
void LoginHandler::changePassword(const std::string &username A_UNUSED,
const std::string &oldPassword,
- const std::string &newPassword)
+ const std::string &newPassword) const
{
MessageOut outMsg(CMSG_CHAR_PASSWORD_CHANGE);
outMsg.writeStringNoLog(oldPassword, 24);
@@ -130,7 +130,7 @@ void LoginHandler::changePassword(const std::string &username A_UNUSED,
void LoginHandler::sendLoginRegister(const std::string &username,
const std::string &password,
- const std::string &email A_UNUSED)
+ const std::string &email A_UNUSED) const
{
MessageOut outMsg(0x0064);
outMsg.writeInt32(0); // client version
@@ -146,12 +146,12 @@ void LoginHandler::sendLoginRegister(const std::string &username,
outMsg.writeInt8(0x03);
}
-ServerInfo *LoginHandler::getCharServer()
+ServerInfo *LoginHandler::getCharServer() const
{
return &charServer;
}
-void LoginHandler::requestUpdateHosts()
+void LoginHandler::requestUpdateHosts() const
{
MessageOut outMsg(CMSG_SEND_CLIENT_INFO);
outMsg.writeInt8(CLIENT_PROTOCOL_VERSION);
@@ -174,12 +174,10 @@ void LoginHandler::processServerVersion(Net::MessageIn &msg)
mVersionResponse = true;
}
-void LoginHandler::processUpdateHost2(Net::MessageIn &msg)
+void LoginHandler::processUpdateHost2(Net::MessageIn &msg) const
{
- int len;
-
- len = msg.readInt16() - 4;
- std::string updateHost = msg.readString(len);
+ int len = msg.readInt16() - 4;
+ const std::string updateHost = msg.readString(len);
splitToStringVector(loginData.updateHosts, updateHost, '|');
FOR_EACH (StringVectIter, it, loginData.updateHosts)