summaryrefslogtreecommitdiff
path: root/src/net/ea/loginhandler.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-09-02 12:21:26 +0300
committerAndrei Karas <akaras@inbox.ru>2014-09-06 01:18:55 +0300
commitfe4f4d4e33ba04f05b9b316c9a262c5bd35e5b70 (patch)
treede81575c0c3889a4362b3ebcd9c65d4d1f54f28a /src/net/ea/loginhandler.cpp
parent3f483c84d47d872b51406d841d92ac50f08a190c (diff)
downloadManaVerse-fe4f4d4e33ba04f05b9b316c9a262c5bd35e5b70.tar.gz
ManaVerse-fe4f4d4e33ba04f05b9b316c9a262c5bd35e5b70.tar.bz2
ManaVerse-fe4f4d4e33ba04f05b9b316c9a262c5bd35e5b70.tar.xz
ManaVerse-fe4f4d4e33ba04f05b9b316c9a262c5bd35e5b70.zip
add packet comments into login handler.
Diffstat (limited to 'src/net/ea/loginhandler.cpp')
-rw-r--r--src/net/ea/loginhandler.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index ece10c725..24c9d8e09 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -136,7 +136,7 @@ void LoginHandler::clearWorlds()
void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg) const
{
// 0: acc not found, 1: success, 2: password mismatch, 3: pass too short
- const uint8_t errMsg = msg.readUInt8();
+ const uint8_t errMsg = msg.readUInt8("result code");
// Successful pass change
if (errMsg == 1)
{
@@ -171,7 +171,7 @@ void LoginHandler::procecessCharPasswordResponse(Net::MessageIn &msg) const
void LoginHandler::processUpdateHost(Net::MessageIn &msg)
{
- const int len = msg.readInt16() - 4;
+ const int len = msg.readInt16("len") - 4;
mUpdateHost = msg.readString(len);
if (!checkPath(mUpdateHost))
@@ -187,37 +187,35 @@ void LoginHandler::processUpdateHost(Net::MessageIn &msg)
void LoginHandler::processLoginData(Net::MessageIn &msg)
{
- // Skip the length word
- msg.skip(2); // size
+ msg.skip(2, "len");
clearWorlds();
const int worldCount = (msg.getLength() - 47) / 32;
- mToken.session_ID1 = msg.readInt32();
- mToken.account_ID = msg.readInt32();
- mToken.session_ID2 = msg.readInt32();
- msg.skip(4); // old ip
- loginData.lastLogin = msg.readString(24);
- msg.skip(2); // 0 unused bytes
+ mToken.session_ID1 = msg.readInt32("session id1");
+ mToken.account_ID = msg.readInt32("accound id");
+ mToken.session_ID2 = msg.readInt32("session id2");
+ msg.readInt32("old ip");
+ loginData.lastLogin = msg.readString(24, "last login");
+ msg.skip(2, "unused");
-// msg.skip(30); // unknown
// reserve bits for future usage
mToken.sex = Being::intToGender(static_cast<uint8_t>(
- msg.readUInt8() & 3U));
+ msg.readUInt8("gender") & 3U));
for (int i = 0; i < worldCount; i++)
{
WorldInfo *const world = new WorldInfo;
- world->address = msg.readInt32();
- world->port = msg.readInt16();
- world->name = msg.readString(20);
- world->online_users = msg.readInt16();
+ world->address = msg.readInt32("ip address");
+ world->port = msg.readInt16("port");
+ world->name = msg.readString(20, "name");
+ world->online_users = msg.readInt16("online number");
config.setValue("updatehost", mUpdateHost);
world->updateHost = mUpdateHost;
- msg.skip(2); // maintenance
- msg.skip(2); // new
+ msg.skip(2, "maintenance");
+ msg.skip(2, "new");
logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
ipToString(world->address), world->port);
@@ -229,7 +227,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
void LoginHandler::processLoginError(Net::MessageIn &msg) const
{
- const uint8_t code = msg.readUInt8();
+ const uint8_t code = msg.readUInt8("error");
logger->log("Login::error code: %u", static_cast<unsigned int>(code));
switch (code)