summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-10-23 22:02:46 +0300
committerAndrei Karas <akaras@inbox.ru>2014-10-23 22:02:46 +0300
commit117bd5507d5e644107d7a53c9b12d7a2587b69a5 (patch)
treebd3f186fcc6cea40c078050a046b28e6dfe085eb
parent4d02075c3daaefca2dcad72546e1e45b4219b5ad (diff)
downloadmv-117bd5507d5e644107d7a53c9b12d7a2587b69a5.tar.gz
mv-117bd5507d5e644107d7a53c9b12d7a2587b69a5.tar.bz2
mv-117bd5507d5e644107d7a53c9b12d7a2587b69a5.tar.xz
mv-117bd5507d5e644107d7a53c9b12d7a2587b69a5.zip
Add packet fields comments in loginhandler.
-rw-r--r--src/net/ea/loginhandler.cpp10
-rw-r--r--src/net/eathena/loginhandler.cpp6
-rw-r--r--src/net/tmwa/loginhandler.cpp10
3 files changed, 13 insertions, 13 deletions
diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp
index 57eea9101..11fe197c2 100644
--- a/src/net/ea/loginhandler.cpp
+++ b/src/net/ea/loginhandler.cpp
@@ -177,7 +177,7 @@ void LoginHandler::processCharPasswordResponse(Net::MessageIn &msg)
void LoginHandler::processUpdateHost(Net::MessageIn &msg)
{
const int len = msg.readInt16("len") - 4;
- mUpdateHost = msg.readString(len);
+ mUpdateHost = msg.readString(len, "update host");
if (!checkPath(mUpdateHost))
{
@@ -192,7 +192,7 @@ void LoginHandler::processUpdateHost(Net::MessageIn &msg)
void LoginHandler::processLoginData(Net::MessageIn &msg)
{
- msg.skip(2, "len");
+ msg.readInt16("len");
loginHandler->clearWorlds();
@@ -203,7 +203,7 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
mToken.session_ID2 = msg.readInt32("session id2");
msg.readInt32("old ip");
loginData.lastLogin = msg.readString(24, "last login");
- msg.skip(2, "unused");
+ msg.readInt16("unused");
// reserve bits for future usage
mToken.sex = Being::intToGender(static_cast<uint8_t>(
@@ -219,8 +219,8 @@ void LoginHandler::processLoginData(Net::MessageIn &msg)
world->online_users = msg.readInt16("online number");
config.setValue("updatehost", mUpdateHost);
world->updateHost = mUpdateHost;
- msg.skip(2, "maintenance");
- msg.skip(2, "new");
+ msg.readInt16("maintenance");
+ msg.readInt16("new");
logger->log("Network: Server: %s (%s:%d)", world->name.c_str(),
ipToString(world->address), world->port);
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp
index ed05e2b07..763baeccd 100644
--- a/src/net/eathena/loginhandler.cpp
+++ b/src/net/eathena/loginhandler.cpp
@@ -118,8 +118,8 @@ void LoginHandler::changePassword(const std::string &restrict username
const
{
createOutPacket(CMSG_CHAR_PASSWORD_CHANGE);
- outMsg.writeStringNoLog(oldPassword, 24);
- outMsg.writeStringNoLog(newPassword, 24);
+ outMsg.writeStringNoLog(oldPassword, 24, "old password");
+ outMsg.writeStringNoLog(newPassword, 24, "new password");
}
void LoginHandler::sendLoginRegister(const std::string &restrict username,
@@ -185,7 +185,7 @@ void LoginHandler::processLoginError2(Net::MessageIn &msg)
"banned from the game until "
"%s.\nPlease contact the GM "
"team via the forums."),
- msg.readString(20).c_str());
+ msg.readString(20, "date").c_str());
break;
case 7:
// look like unused
diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp
index 75b5dba65..b0e381407 100644
--- a/src/net/tmwa/loginhandler.cpp
+++ b/src/net/tmwa/loginhandler.cpp
@@ -189,15 +189,15 @@ void LoginHandler::requestUpdateHosts()
void LoginHandler::processServerVersion(Net::MessageIn &msg)
{
- const uint8_t b1 = msg.readUInt8(); // -1
- const uint8_t b2 = msg.readUInt8(); // E
- const uint8_t b3 = msg.readUInt8(); // V
- const uint8_t b4 = msg.readUInt8(); // L
+ const uint8_t b1 = msg.readUInt8("b1"); // -1
+ const uint8_t b2 = msg.readUInt8("b2"); // E
+ const uint8_t b3 = msg.readUInt8("b3"); // V
+ const uint8_t b4 = msg.readUInt8("b4"); // L
if (b1 == 255 && b2 == 'E' && b3 == 'V' && b4 == 'L')
{
const unsigned int options = msg.readUInt8("options");
mRegistrationEnabled = options & FLAG_REGISTRATION;
- msg.skip(2, "unused");
+ msg.readInt16("unused");
serverVersion = msg.readUInt8("server version");
tmwServerVersion = 0;
if (serverVersion >= 5)