From 117bd5507d5e644107d7a53c9b12d7a2587b69a5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 23 Oct 2014 22:02:46 +0300 Subject: Add packet fields comments in loginhandler. --- src/net/ea/loginhandler.cpp | 10 +++++----- src/net/eathena/loginhandler.cpp | 6 +++--- src/net/tmwa/loginhandler.cpp | 10 +++++----- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'src') 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( @@ -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) -- cgit v1.2.3-60-g2f50