diff options
Diffstat (limited to 'src/net')
-rw-r--r-- | src/net/eathena/loginhandler.cpp | 12 | ||||
-rw-r--r-- | src/net/eathena/loginhandler.h | 2 | ||||
-rw-r--r-- | src/net/eathena/packetsout.inc | 3 | ||||
-rw-r--r-- | src/net/loginhandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.cpp | 4 | ||||
-rw-r--r-- | src/net/tmwa/loginhandler.h | 2 |
6 files changed, 25 insertions, 0 deletions
diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index 3293317c8..cd22e44eb 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -182,4 +182,16 @@ void LoginHandler::sendMobileCode(const BeingId accountId, outMsg.writeStringNoLog(code, 6, "code"); } +void LoginHandler::sendOtpCode(const std::string &code) const +{ + if (packetVersionMain < 20181114 && + packetVersionRe < 20181114 && + packets_zero == false) + { + return; + } + createOutPacket(CMSG_LOGIN_OTP_CODE); + outMsg.writeStringNoLog(code, 9, "code"); +} + } // namespace EAthena diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h index 87d5e16cf..e45a4a72c 100644 --- a/src/net/eathena/loginhandler.h +++ b/src/net/eathena/loginhandler.h @@ -61,6 +61,8 @@ class LoginHandler final : public Ea::LoginHandler void sendMobileCode(const BeingId accountId, const std::string &code) const override final; + void sendOtpCode(const std::string &code) const override final; + private: void sendLoginRegister(const std::string &restrict username, const std::string &restrict password, diff --git a/src/net/eathena/packetsout.inc b/src/net/eathena/packetsout.inc index d9b269ba9..b1a41e4d2 100644 --- a/src/net/eathena/packetsout.inc +++ b/src/net/eathena/packetsout.inc @@ -343,6 +343,7 @@ packet(CMSG_CHANGE_DRESS, 0x0000, 0, nullptr); packet(CMSG_INSTANCE_COMMAND, 0x0000, 0, nullptr); packet(CMSG_ACHIEVEMENT_GET_REWARD, 0x0000, 0, nullptr); packet(CMSG_LOGIN_MOBILE_OTP, 0x0000, 0, nullptr); +packet(CMSG_LOGIN_OTP_CODE, 0x0000, 0, nullptr); #else // 20040713 if (packetVersion >= 20040713) @@ -1467,12 +1468,14 @@ if (packetVersionRe >= 20180718) if (packetVersionMain >= 20181114) { packet(CMSG_LOGIN_MOBILE_OTP, 0x09a3, -1, lclif->p->parse_CA_ACK_MOBILE_OTP); + packet(CMSG_LOGIN_OTP_CODE, 0x0ad0, 11, lclif->p->parse_CA_OTP_CODE); } // 20181114 re if (packetVersionRe >= 20181114) { packet(CMSG_LOGIN_MOBILE_OTP, 0x09a3, -1, lclif->p->parse_CA_ACK_MOBILE_OTP); + packet(CMSG_LOGIN_OTP_CODE, 0x0ad0, 11, lclif->p->parse_CA_OTP_CODE); } #endif diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 3abc91443..40ba768dc 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -101,6 +101,8 @@ class LoginHandler notfinal virtual void sendMobileCode(const BeingId accountId, const std::string &code) const = 0; + virtual void sendOtpCode(const std::string &code) const = 0; + virtual ~LoginHandler() { } diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index e88069d25..c0abf22bc 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -146,4 +146,8 @@ void LoginHandler::sendMobileCode(const BeingId accountId A_UNUSED, { } +void LoginHandler::sendOtpCode(const std::string &code A_UNUSED) const +{ +} + } // namespace TmwAthena diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h index 7539569a0..abd70cf69 100644 --- a/src/net/tmwa/loginhandler.h +++ b/src/net/tmwa/loginhandler.h @@ -63,6 +63,8 @@ class LoginHandler final : public Ea::LoginHandler void sendMobileCode(const BeingId accountId, const std::string &code) const override final; + void sendOtpCode(const std::string &code) const override final; + private: void sendLoginRegister(const std::string &restrict username, const std::string &restrict password, |